Add exclusive LTX-2 video studio profile

This commit is contained in:
Mikei386
2026-09-13 21:33:57 +02:00
parent fce9900389
commit a78aed8e9e
12 changed files with 233 additions and 15 deletions
+21 -6
View File
@@ -114,6 +114,7 @@ VOICE_START_TIMEOUT = float(os.environ.get("VOICE_START_TIMEOUT", "600"))
VOICE_CHANGE_START_TIMEOUT = float(os.environ.get("VOICE_CHANGE_START_TIMEOUT", "600"))
APPLIO_START_TIMEOUT = float(os.environ.get("APPLIO_START_TIMEOUT", "900"))
TRELLIS_START_TIMEOUT = float(os.environ.get("TRELLIS_START_TIMEOUT", "900"))
VIDEO_START_TIMEOUT = float(os.environ.get("VIDEO_START_TIMEOUT", "900"))
# Optional worker APIs. The clean Docker baseline deliberately ships only
# text/multimodal chat; absent workers must fail explicitly instead of trying
@@ -502,6 +503,11 @@ def _wait_trellis_ready() -> None:
"TRELLIS.2", TRELLIS_START_TIMEOUT)
def _wait_video_ready() -> None:
_wait_aux_voice_ready("video_worker", "video_health",
"LTX-2 Studio", VIDEO_START_TIMEOUT)
def _special_worker(mode: str) -> tuple[str, str, callable]:
if mode == "music":
return "/workers/music/start", _music_worker_state(), _wait_music_ready
@@ -521,6 +527,9 @@ def _special_worker(mode: str) -> tuple[str, str, callable]:
if mode == "trellis":
return ("/workers/trellis/start", _worker_field("trellis_worker"),
_wait_trellis_ready)
if mode == "video":
return ("/workers/video/start", _worker_field("video_worker"),
_wait_video_ready)
raise ValueError(f"unbekannter Spezialmodus: {mode}")
@@ -529,7 +538,7 @@ def set_operating_mode(mode: str) -> dict:
if not ENABLE_MUSIC_MODE or not PROFILE_CONTROL_URL:
raise RuntimeError("Musikmodus ist nicht konfiguriert")
special_modes = {"music", "yue2", "separation", "voice", "voicechange",
"applio", "trellis"}
"applio", "trellis", "video"}
if mode not in {"llm", *special_modes}:
raise ValueError("unbekannter Betriebsmodus")
with STATE.lock:
@@ -582,6 +591,7 @@ def set_operating_mode(mode: str) -> dict:
_profile_controller_request("POST", "/workers/voice-change/stop")
_profile_controller_request("POST", "/workers/applio/stop")
_profile_controller_request("POST", "/workers/trellis/stop")
_profile_controller_request("POST", "/workers/video/stop")
_restore_qwen(profile)
STATE.mode = "llm"
STATE.mode_phase = "ready"
@@ -601,7 +611,7 @@ def schedule_operating_mode(mode: str) -> tuple[bool, str]:
if not ENABLE_MUSIC_MODE or not PROFILE_CONTROL_URL:
raise RuntimeError("Musikmodus ist nicht konfiguriert")
if mode not in {"llm", "music", "yue2", "separation", "voice",
"voicechange", "applio", "trellis"}:
"voicechange", "applio", "trellis", "video"}:
raise ValueError("unbekannter Betriebsmodus")
with STATE.lock:
if STATE.mode_phase not in {"ready", "error"}:
@@ -643,7 +653,8 @@ def _control_command(data: dict, path: str) -> str | None:
"/athena voicechange", "/athena changer",
"/athena applio",
"/athena 3d", "/athena trellis",
"/athena status"} else None
"/athena video", "/athena ltx",
"/athena ltx2", "/athena status"} else None
# ---------------------------------------------------------------------------
@@ -2129,6 +2140,8 @@ class Handler(BaseHTTPRequestHandler):
"applio_health": _worker_field("applio_health"),
"trellis_worker": _worker_field("trellis_worker"),
"trellis_health": _worker_field("trellis_health"),
"video_worker": _worker_field("video_worker"),
"video_health": _worker_field("video_health"),
"return_profile": state.get("return_profile"),
"last_error": STATE.mode_error,
"enabled": ENABLE_MUSIC_MODE,
@@ -2139,7 +2152,7 @@ class Handler(BaseHTTPRequestHandler):
data = json.loads(self._read_body() or b"{}")
mode = data.get("mode") if isinstance(data, dict) else None
if mode not in {"llm", "music", "yue2", "separation", "voice",
"voicechange", "applio", "trellis"}:
"voicechange", "applio", "trellis", "video"}:
raise ValueError("Feld 'mode' enthält einen unbekannten Betriebsmodus")
started, phase = schedule_operating_mode(mode)
self._send_json(202 if started else 200, {
@@ -2807,7 +2820,8 @@ class Handler(BaseHTTPRequestHandler):
f"{mode['separator_worker']}. Voice Studio: "
f"{mode['voice_worker']}. Voice Changer: "
f"{mode['voice_change_worker']}. 3D Studio: "
f"{mode['trellis_worker']}. LLM-Profil: {profile or 'entladen'}.")
f"{mode['trellis_worker']}. LTX-2 Studio: "
f"{mode['video_worker']}. LLM-Profil: {profile or 'entladen'}.")
else:
target = ("music" if command == "/athena music" else
"yue2" if command == "/athena yue2" else
@@ -2816,6 +2830,7 @@ class Handler(BaseHTTPRequestHandler):
else "voicechange" if command in {"/athena voicechange", "/athena changer"}
else "applio" if command == "/athena applio"
else "trellis" if command in {"/athena 3d", "/athena trellis"}
else "video" if command in {"/athena video", "/athena ltx", "/athena ltx2"}
else "llm")
try:
started, phase = schedule_operating_mode(target)
@@ -3128,7 +3143,7 @@ def _startup_reconcile() -> None:
special_mode = previous.get("mode")
if ENABLE_MUSIC_MODE and special_mode in {"music", "yue2", "separation",
"voice", "voicechange", "applio",
"trellis"}:
"trellis", "video"}:
STATE.mode = special_mode
STATE.mode_phase = f"starting-{special_mode}"
_set_qwen_unavailable(True)