eeuuia commited on
Commit
3aea503
·
verified ·
1 Parent(s): b0004ff

Update api/ltx/vae_aduc_pipeline.py

Browse files
Files changed (1) hide show
  1. api/ltx/vae_aduc_pipeline.py +13 -23
api/ltx/vae_aduc_pipeline.py CHANGED
@@ -18,19 +18,18 @@ from PIL import Image
18
  # ==============================================================================
19
  # --- IMPORTAÇÕES DA ARQUITETURA E DO LTX ---
20
  # ==============================================================================
21
- try:
22
- from api.ltx.ltx_aduc_manager import LatentConditioningItem
23
- from api.managers.gpu_manager import gpu_manager
24
- # Adiciona o path para as bibliotecas do LTX
25
- LTX_VIDEO_REPO_DIR = Path("/data/LTX-Video")
26
- if str(LTX_VIDEO_REPO_DIR.resolve()) not in sys.path:
27
- sys.path.insert(0, str(LTX_VIDEO_REPO_DIR.resolve()))
 
 
28
 
29
- from ltx_video.models.autoencoders.causal_video_autoencoder import CausalVideoAutoencoder
30
- from ltx_video.models.autoencoders.vae_encode import vae_encode, vae_decode
31
- # Nossos data classes customizados para condicionamento, importados do pool manager
32
- except ImportError as e:
33
- raise ImportError(f"A crucial import failed for VaeServer. Check dependencies. Error: {e}")
34
 
35
  # ==============================================================================
36
  # --- CLASSE DO SERVIÇO VAE ---
@@ -151,14 +150,5 @@ class VaeServer:
151
  finally:
152
  self._cleanup_gpu()
153
 
154
- # --- Instância Singleton ---
155
- try:
156
- # A inicialização depende do LTXPoolManager para obter o VAE
157
- from api.ltx.ltx_aduc_manager import ltx_pool_manager
158
- if ltx_pool_manager:
159
- vae_server_singleton = VaeServer()
160
- else:
161
- raise RuntimeError("LTXPoolManager failed to initialize, cannot start VaeServer.")
162
- except Exception as e:
163
- logging.critical("CRITICAL: Failed to initialize VaeServer singleton.", exc_info=True)
164
- vae_server_singleton = None
 
18
  # ==============================================================================
19
  # --- IMPORTAÇÕES DA ARQUITETURA E DO LTX ---
20
  # ==============================================================================
21
+ from api.ltx.ltx_aduc_manager import LatentConditioningItem
22
+ from api.managers.gpu_manager import gpu_manager
23
+ from api.ltx.ltx_aduc_manager import ltx_pool_manager
24
+
25
+ # Adiciona o path para as bibliotecas do LTX
26
+
27
+ LTX_VIDEO_REPO_DIR = Path("/data/LTX-Video")
28
+ if str(LTX_VIDEO_REPO_DIR.resolve()) not in sys.path:
29
+ sys.path.insert(0, str(LTX_VIDEO_REPO_DIR.resolve()))
30
 
31
+ from ltx_video.models.autoencoders.causal_video_autoencoder import CausalVideoAutoencoder
32
+ from ltx_video.models.autoencoders.vae_encode import vae_encode, vae_decode
 
 
 
33
 
34
  # ==============================================================================
35
  # --- CLASSE DO SERVIÇO VAE ---
 
150
  finally:
151
  self._cleanup_gpu()
152
 
153
+
154
+ vae_server_singleton = VaeServer()