feat: 新增代码
This commit is contained in:
15
video_worker/app/model_router.py
Normal file
15
video_worker/app/model_router.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from app.backends.hunyuan_backend import HunyuanBackend
|
||||
from app.backends.ltx_backend import LTXBackend
|
||||
|
||||
|
||||
class ModelRouter:
|
||||
def __init__(self, ltx_backend: LTXBackend, hunyuan_backend: HunyuanBackend):
|
||||
self._ltx = ltx_backend
|
||||
self._hunyuan = hunyuan_backend
|
||||
|
||||
def route(self, quality_mode: str):
|
||||
if quality_mode == "preview":
|
||||
return self._ltx
|
||||
if quality_mode == "refine":
|
||||
return self._hunyuan
|
||||
raise ValueError(f"Unsupported quality_mode: {quality_mode}")
|
||||
Reference in New Issue
Block a user