Add isolated Stimmatelier Qwen speech studio and restore recipe

This commit is contained in:
Mikei386 committed 2026-10-19 12:35:32 +02:00
1 parent 182c8a1e8f
commit 2664ea8bd8
21 files changed
+397 -14

No files matched your search

+13 -1
View File
@@ -311,7 +311,9 @@ class Handler(BaseHTTPRequestHandler):
self.send_header('Content-Length', str(len(body)))
self.send_header('Cache-Control', 'no-store')
self.send_header('X-Content-Type-Options', 'nosniff')
self.send_header('Content-Security-Policy', "default-src 'self'; script-src 'self'; style-src 'self'; frame-ancestors 'none'")
policy="default-src 'self'; script-src 'self'; style-src 'self'; frame-ancestors 'none'"
if self.path.startswith('/stimmatelier/'):policy+="; media-src 'self' blob:"
self.send_header('Content-Security-Policy',policy)
self.end_headers()
self.wfile.write(body)
@@ -469,6 +471,12 @@ class Handler(BaseHTTPRequestHandler):
return self.respond({'error':'Anmeldung erforderlich.'},401)
if not self.authenticated() and self.path == '/':
return self.respond((ROOT/'login.html').read_bytes(), mime='text/html; charset=utf-8')
if self.path.startswith('/stimmatelier/'):
try:
from stimmatelier_proxy import asset
body,mime=asset(self.path,self.server.catalog.root.parent)
return self.respond(body,mime=mime)
except (OSError,ValueError):return self.respond({'error':'Stimmatelier nicht erreichbar. Den Dienst unter Weitere Dienste starten.'},503)
routes = {'/strata-ui.js':('strata-ui.js','text/javascript'),'/soulx-singer-ui.js':('soulx-singer-ui.js','text/javascript'),'/xvc-ui.js':('xvc-ui.js','text/javascript'),'/applio-ui.js':('applio-ui.js','text/javascript'),'/acestep-ui.js':('acestep-ui.js','text/javascript'),'/voice-ui.js':('voice-ui.js','text/javascript'),'/voxcpm-ui.js':('voxcpm-ui.js','text/javascript'),'/separator-ui.js':('separator-ui.js','text/javascript'),'/music-ui.js':('music-ui.js','text/javascript'),'/audio-cpp-ui.js':('audio-cpp-ui.js','text/javascript'),'/ltx-original-ui.js':('ltx-original-ui.js','text/javascript'),'/backup-ui.js':('backup-ui.js','text/javascript'),'/dashboard-ui.js':('dashboard-ui.js','text/javascript'),'/dashboard.css':('dashboard.css','text/css'),'/themes.css':('themes.css','text/css'),'/video-ui.js':('video-ui.js','text/javascript'),'/stt-ui.js':('stt-ui.js','text/javascript'),'/tts-ui.js':('tts-ui.js','text/javascript'),'/auto-test-ui.js':('auto-test-ui.js','text/javascript'),'/chat-test-ui.js':('chat-test-ui.js','text/javascript'),'/endpoint-ui.js':('endpoint-ui.js','text/javascript'),'/docker-ui.js': ('docker-ui.js','text/javascript'), '/': ('index.html', 'text/html; charset=utf-8'), '/app.js': ('app.js', 'text/javascript'), '/style.css': ('style.css', 'text/css'), '/network-ui.js': ('network-ui.js', 'text/javascript'), '/access-ui.js': ('access-ui.js', 'text/javascript'), '/studio.js': ('studio.js', 'text/javascript'), '/catalog-ui.js': ('catalog-ui.js','text/javascript'), '/runtime-ui.js': ('runtime-ui.js','text/javascript'), '/profiles-ui.js': ('profiles-ui.js','text/javascript'), '/image-test-ui.js': ('image-test-ui.js','text/javascript')}
if self.path in routes:
name, mime = routes[self.path]
@@ -879,6 +887,10 @@ class Handler(BaseHTTPRequestHandler):
except (ValueError,OSError) as exc:return self.respond({'error':str(exc)},400)
if self.path in ('/api/v1/qwen-native/install','/api/v1/qwen-native/install-cancel','/api/v1/qwen-native/start','/api/v1/qwen-native/cancel'):
try:
if self.path.endswith('/start') and self.headers.get('Content-Type','').startswith('multipart/form-data'):
fields,audio=read_upload(self,validate=False,allowed_fields=('profile_id','text','speaker','language'),max_field=4096,max_audio=16*1024**2)
if not {'profile_id','text'}<=set(fields):raise ValueError('Profil und Text erforderlich.')
return self.respond(self.server.qwen_native.start(**fields,reference=audio))
data=self.read_json()
if self.path.endswith('/install') and not data:return self.respond(self.server.qwen_native_runtime.start())
if self.path.endswith('/install-cancel') and not data:return self.respond(self.server.qwen_native_runtime.stop())