Spaces:
Paused
Paused
Rename api/vae_server.py to api/ltx/vae_aduc_pipeline.py
Browse files
api/{vae_server.py → ltx/vae_aduc_pipeline.py}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# FILE: api/
|
| 2 |
# DESCRIPTION: A dedicated, "hot" VAE service specialist.
|
| 3 |
# It loads the VAE model onto a dedicated GPU and keeps it in memory
|
| 4 |
# to handle all encoding and decoding requests with minimal latency.
|
|
@@ -14,8 +14,8 @@ import torch
|
|
| 14 |
import numpy as np
|
| 15 |
from PIL import Image
|
| 16 |
|
| 17 |
-
from api.ltx_pool_manager import LatentConditioningItem
|
| 18 |
-
from
|
| 19 |
|
| 20 |
|
| 21 |
# --- Importações da Arquitetura e do LTX ---
|
|
@@ -31,7 +31,7 @@ except ImportError as e:
|
|
| 31 |
raise ImportError(f"A crucial import failed for VaeServer. Check dependencies. Error: {e}")
|
| 32 |
|
| 33 |
|
| 34 |
-
class
|
| 35 |
_instance = None
|
| 36 |
|
| 37 |
def __new__(cls, *args, **kwargs):
|
|
@@ -156,7 +156,7 @@ class VaeServer:
|
|
| 156 |
# --- Instância Singleton ---
|
| 157 |
# A inicialização ocorre quando o módulo é importado pela primeira vez.
|
| 158 |
try:
|
| 159 |
-
|
| 160 |
except Exception as e:
|
| 161 |
logging.critical("CRITICAL: Failed to initialize VaeServer singleton.", exc_info=True)
|
| 162 |
vae_server_singleton = None
|
|
|
|
| 1 |
+
# FILE: api/vae_aduc_pipeline.py
|
| 2 |
# DESCRIPTION: A dedicated, "hot" VAE service specialist.
|
| 3 |
# It loads the VAE model onto a dedicated GPU and keeps it in memory
|
| 4 |
# to handle all encoding and decoding requests with minimal latency.
|
|
|
|
| 14 |
import numpy as np
|
| 15 |
from PIL import Image
|
| 16 |
|
| 17 |
+
from api.ltx.ltx_pool_manager import LatentConditioningItem
|
| 18 |
+
from manager.gpu_manager import gpu_manager
|
| 19 |
|
| 20 |
|
| 21 |
# --- Importações da Arquitetura e do LTX ---
|
|
|
|
| 31 |
raise ImportError(f"A crucial import failed for VaeServer. Check dependencies. Error: {e}")
|
| 32 |
|
| 33 |
|
| 34 |
+
class VaeLtxAducPipeline:
|
| 35 |
_instance = None
|
| 36 |
|
| 37 |
def __new__(cls, *args, **kwargs):
|
|
|
|
| 156 |
# --- Instância Singleton ---
|
| 157 |
# A inicialização ocorre quando o módulo é importado pela primeira vez.
|
| 158 |
try:
|
| 159 |
+
vae_ltx_aduc_pipeline = VaeLtxAducPipeline()
|
| 160 |
except Exception as e:
|
| 161 |
logging.critical("CRITICAL: Failed to initialize VaeServer singleton.", exc_info=True)
|
| 162 |
vae_server_singleton = None
|