Integrate tested Seed-VC GPU conversion into Stimmatelier

This commit is contained in:
Mikei386 committed 2026-10-19 17:36:11 +02:00
1 parent 73e803e943
commit 1445152fec
22 files changed
+688 -17

No files matched your search

+27 -2
View File
@@ -188,6 +188,19 @@ class Server(ThreadingHTTPServer):
if not any(humaneness_model(p.get('model')) for p in self.profiles.status()['profiles']):
self.profiles.save(dict(id=None,revision=0,name='Humaneness Voice Conversion',api_id='humaneness-vc',kind='voice',model_id=model_id,parameters={k:v[2] for k,v in SCHEMAS['voice'].items()}))
marker.write_text('Humaneness profile registered; endpoint publication requires GUI\n')
from seedvc_runtime import SeedVCRuntime,supported as seedvc_model
from seedvc import SeedVC
self.seedvc_runtime=SeedVCRuntime(self.catalog.root.parent/'seedvc-runtime')
self.seedvc=SeedVC(self.catalog.root.parent/'seedvc-jobs',self.seedvc_runtime,self.profiles,self.scheduler)
self.seedvc.voice_path=self.qwen_native.voice_path
self.profiles.seedvc_blockers=self.seedvc.blockers;self.endpoint.seedvc=self.seedvc
model_id=self.seedvc_runtime.register(self.catalog)
marker=self.seedvc_runtime.root/'profile-created'
if model_id and not marker.exists():
from profiles import SCHEMAS
if not any(seedvc_model(p.get('model')) for p in self.profiles.status()['profiles']):
self.profiles.save(dict(id=None,revision=0,name='Seed-VC GPU',api_id='seed-vc',kind='voice',model_id=model_id,parameters={}))
marker.write_text('Seed-VC profile registered; endpoint publication requires GUI\n')
self.endpoint.stt=self.stt
from applio import Applio
self.applio=Applio(self.catalog.root.parent/'applio-data',self.applio_runtime,self.scheduler,self.profiles,lambda:self.endpoint.config['enabled_profiles'])
@@ -209,7 +222,7 @@ class Server(ThreadingHTTPServer):
self.chat_tests=ChatTests(self.profiles,self.worker,self.scheduler)
self.auto_tests=AutoTests(self.catalog.root.parent/'auto-tests.json',self.profiles,self.worker,self.scheduler)
def stop_gpu_work():
self.humaneness.stop();self.qwen_native.stop();self.pocket.stop();self.strata_runtime.stop();self.remix.stop();self.voxcpm_tests.stop();self.separator_tests.stop();self.music.close();self.auto_tests.stop();self.chat_tests.stop();self.image_tests.stop();self.prompt_enhancer.stop_preview();self.tts_tests.stop();self.worker.stop()
self.seedvc.stop();self.humaneness.stop();self.qwen_native.stop();self.pocket.stop();self.strata_runtime.stop();self.remix.stop();self.voxcpm_tests.stop();self.separator_tests.stop();self.music.close();self.auto_tests.stop();self.chat_tests.stop();self.image_tests.stop();self.prompt_enhancer.stop_preview();self.tts_tests.stop();self.worker.stop()
from video_original import VideoRuntimes
from ltx_original_runtime import LTXOriginalRuntime
from audio_cpp_runtime import AudioCppRuntime
@@ -307,6 +320,7 @@ class Server(ThreadingHTTPServer):
threading.Thread(target=preload_music,daemon=True).start()
def server_close(self):
if getattr(self,'seedvc',None):self.seedvc.stop()
if getattr(self,'humaneness',None):self.humaneness.stop()
if getattr(self,'soulx_singer',None):self.soulx_singer.stop()
if getattr(self,'xvc',None):self.xvc.stop()
@@ -464,7 +478,7 @@ class Handler(BaseHTTPRequestHandler):
else self.server.video.runtime)
return {'embeddings':chat,'stt':chat,'chat':chat,
'image':self.server.image_runtime.status().get('installed',False),
'humaneness':self.server.humaneness_runtime.status()['installed'],'qwen_native':self.server.qwen_native_runtime.status()['installed'],'pocket':self.server.pocket_runtime.status()['installed'],'audio':self.server.tts_runtime.status().get('installed',False),'parakeet':self.server.stt.parakeet.status()['installed'],
'seedvc':self.server.seedvc_runtime.status()['installed'],'humaneness':self.server.humaneness_runtime.status()['installed'],'qwen_native':self.server.qwen_native_runtime.status()['installed'],'pocket':self.server.pocket_runtime.status()['installed'],'audio':self.server.tts_runtime.status().get('installed',False),'parakeet':self.server.stt.parakeet.status()['installed'],
'video':video_runtime.status().get('installed',False),
'acestep':self.server.acestep_runtime.status()['installed'],
'audio_cpp':self.server.audio_cpp_runtime.status()['installed'],
@@ -507,6 +521,10 @@ class Handler(BaseHTTPRequestHandler):
if self.path == '/api/v1/docker':return self.respond(self.server.docker.status())
if self.path == '/api/v1/stt':return self.respond(self.server.stt.status())
if self.path == '/api/v1/voice/profiles':return self.respond({'profiles':[dict(id=p['id'],name=p['name'],repo=p['model']['repo'],enabled=p['enabled'],runnable=p['runnable']) for p in self.server.endpoint.rows() if p['kind']=='voice' and p.get('model')]})
if self.path == '/api/v1/seed-vc':return self.respond(self.server.seedvc.status())
if urlsplit(self.path).path == '/api/v1/seed-vc/audio':
try:return self.respond(self.server.seedvc.audio(parse_qs(urlsplit(self.path).query).get('id',[''])[0]),mime='audio/wav')
except (OSError,ValueError) as exc:return self.respond({'error':str(exc)},400)
if self.path == '/api/v1/conversion':return self.respond(self.server.humaneness.status())
if urlsplit(self.path).path == '/api/v1/conversion/audio':
try:return self.respond(self.server.humaneness.audio(parse_qs(urlsplit(self.path).query).get('id',[''])[0]),mime='audio/wav')
@@ -904,6 +922,13 @@ class Handler(BaseHTTPRequestHandler):
if not selected:raise ValueError('Dieses Stimmprofil ist nicht aktiviert. In Deck das gewünschte Profil freigeben.')
return self.respond(self.server.voxcpm_tests.start(**fields))
except (ValueError,OSError) as exc:return self.respond({'error':str(exc)},400)
if self.path == '/api/v1/seed-vc/start':
try:
from humaneness import read_upload as read_conversion_upload
ident,source,reference,options=read_conversion_upload(self,validator=lambda a:a,reference_required=False,auto_default=True)
return self.respond(self.server.seedvc.start(ident,source,reference,**options))
except (OSError,ValueError,InferenceError) as exc:return self.respond({'error':str(exc)},400)
if self.path == '/api/v1/seed-vc/cancel':return self.respond(self.server.seedvc.stop() or {'ok':True})
if self.path == '/api/v1/conversion/start':
try:
from humaneness import read_upload as read_conversion_upload