Spaces:
Paused
Paused
Update api/ltx/ltx_aduc_manager.py
Browse files
api/ltx/ltx_aduc_manager.py
CHANGED
|
@@ -22,6 +22,7 @@ from huggingface_hub import hf_hub_download
|
|
| 22 |
# --- Importações da nossa arquitetura ---
|
| 23 |
from managers.gpu_manager import gpu_manager
|
| 24 |
from api.ltx.ltx_utils import build_ltx_pipeline_on_cpu
|
|
|
|
| 25 |
|
| 26 |
LTX_VIDEO_REPO_DIR = Path("/data/LTX-Video")
|
| 27 |
LTX_REPO_ID = "Lightricks/LTX-Video"
|
|
@@ -73,6 +74,7 @@ class LatentConditioningItem:
|
|
| 73 |
# Nossa versão customizada de `prepare_conditioning` que entende ambos os Data Classes.
|
| 74 |
# ==============================================================================
|
| 75 |
|
|
|
|
| 76 |
def _aduc_prepare_conditioning_patch(
|
| 77 |
self: "LTXVideoPipeline",
|
| 78 |
conditioning_items: Optional[List[Union[ConditioningItem, LatentConditioningItem]]],
|
|
@@ -148,6 +150,7 @@ class LTXWorker:
|
|
| 148 |
self.pipeline: LTXVideoPipeline = None
|
| 149 |
self._load_and_patch_pipeline()
|
| 150 |
|
|
|
|
| 151 |
def _load_and_patch_pipeline(self):
|
| 152 |
logging.info(f"[LTXWorker-{self.main_device}] Carregando pipeline LTX para a CPU...")
|
| 153 |
self.pipeline, _ = build_ltx_pipeline_on_cpu(self.config)
|
|
@@ -181,12 +184,14 @@ class LtxAducManager:
|
|
| 181 |
self._initialized = True
|
| 182 |
logging.info("✅ LTXPoolManager pronto.")
|
| 183 |
|
|
|
|
| 184 |
def _load_config(self) -> Dict:
|
| 185 |
"""Carrega a configuração YAML principal do LTX."""
|
| 186 |
config_path = Path("/data/LTX-Video/configs/ltxv-13b-0.9.8-dev-fp8.yaml")
|
| 187 |
with open(config_path, "r") as file:
|
| 188 |
return yaml.safe_load(file)
|
| 189 |
|
|
|
|
| 190 |
def get_pipeline(self) -> LTXVideoPipeline:
|
| 191 |
"""Retorna a instância do pipeline, já carregada e corrigida."""
|
| 192 |
return self.worker.pipeline
|
|
|
|
| 22 |
# --- Importações da nossa arquitetura ---
|
| 23 |
from managers.gpu_manager import gpu_manager
|
| 24 |
from api.ltx.ltx_utils import build_ltx_pipeline_on_cpu
|
| 25 |
+
from utils.debug_utils import log_function_io
|
| 26 |
|
| 27 |
LTX_VIDEO_REPO_DIR = Path("/data/LTX-Video")
|
| 28 |
LTX_REPO_ID = "Lightricks/LTX-Video"
|
|
|
|
| 74 |
# Nossa versão customizada de `prepare_conditioning` que entende ambos os Data Classes.
|
| 75 |
# ==============================================================================
|
| 76 |
|
| 77 |
+
@log_function_io
|
| 78 |
def _aduc_prepare_conditioning_patch(
|
| 79 |
self: "LTXVideoPipeline",
|
| 80 |
conditioning_items: Optional[List[Union[ConditioningItem, LatentConditioningItem]]],
|
|
|
|
| 150 |
self.pipeline: LTXVideoPipeline = None
|
| 151 |
self._load_and_patch_pipeline()
|
| 152 |
|
| 153 |
+
@log_function_io
|
| 154 |
def _load_and_patch_pipeline(self):
|
| 155 |
logging.info(f"[LTXWorker-{self.main_device}] Carregando pipeline LTX para a CPU...")
|
| 156 |
self.pipeline, _ = build_ltx_pipeline_on_cpu(self.config)
|
|
|
|
| 184 |
self._initialized = True
|
| 185 |
logging.info("✅ LTXPoolManager pronto.")
|
| 186 |
|
| 187 |
+
@log_function_io
|
| 188 |
def _load_config(self) -> Dict:
|
| 189 |
"""Carrega a configuração YAML principal do LTX."""
|
| 190 |
config_path = Path("/data/LTX-Video/configs/ltxv-13b-0.9.8-dev-fp8.yaml")
|
| 191 |
with open(config_path, "r") as file:
|
| 192 |
return yaml.safe_load(file)
|
| 193 |
|
| 194 |
+
@log_function_io
|
| 195 |
def get_pipeline(self) -> LTXVideoPipeline:
|
| 196 |
"""Retorna a instância do pipeline, já carregada e corrigida."""
|
| 197 |
return self.worker.pipeline
|