Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,34 +14,20 @@ from PIL import Image
|
|
| 14 |
# --- IMPORTAÇÃO DOS SERVIÇOS DE BACKEND E UTILS ---
|
| 15 |
# ==============================================================================
|
| 16 |
|
| 17 |
-
try:
|
| 18 |
# --- MUDANÇA PRINCIPAL: Importamos apenas o ORQUESTRADOR ---
|
| 19 |
# O orquestrador é agora nosso único ponto de entrada para a geração de vídeo.
|
| 20 |
-
|
| 21 |
|
| 22 |
# O SeedVR (upscaler de resolução) ainda é um serviço separado que pode ser chamado após a geração.
|
| 23 |
-
|
| 24 |
|
| 25 |
# Nosso decorador de logging para depuração
|
| 26 |
-
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
# Lógica de falha para o decorador de log
|
| 32 |
-
def log_function_io(func): return func
|
| 33 |
-
logging.warning(f"Could not import a module. Debug logger might be disabled. Details: {e}")
|
| 34 |
-
# Verifica se o orquestrador, que é CRÍTICO, falhou ao importar.
|
| 35 |
-
if 'ltx_aduc_orchestrator' not in locals() or ltx_aduc_orchestrator is None:
|
| 36 |
-
logging.critical(f"FATAL: Main Orchestrator service failed to import or initialize.", exc_info=True)
|
| 37 |
-
sys.exit(1)
|
| 38 |
-
# SeedVR é opcional, então apenas avisamos se ele falhar.
|
| 39 |
-
if 'seed_aduc_pipeline' not in locals():
|
| 40 |
-
seed_aduc_pipeline = None
|
| 41 |
-
logging.warning("SeedVR server could not be initialized. The SeedVR upscaling tab will be disabled.")
|
| 42 |
-
except Exception as e:
|
| 43 |
-
logging.critical(f"FATAL ERROR: An unexpected error occurred during backend initialization. Details: {e}", exc_info=True)
|
| 44 |
-
sys.exit(1)
|
| 45 |
|
| 46 |
# ==============================================================================
|
| 47 |
# --- FUNÇÕES WRAPPER (PONTE ENTRE UI E BACKEND) ---
|
|
|
|
| 14 |
# --- IMPORTAÇÃO DOS SERVIÇOS DE BACKEND E UTILS ---
|
| 15 |
# ==============================================================================
|
| 16 |
|
| 17 |
+
#try:
|
| 18 |
# --- MUDANÇA PRINCIPAL: Importamos apenas o ORQUESTRADOR ---
|
| 19 |
# O orquestrador é agora nosso único ponto de entrada para a geração de vídeo.
|
| 20 |
+
from api.ltx.ltx_aduc_orchestrator import ltx_aduc_orchestrator
|
| 21 |
|
| 22 |
# O SeedVR (upscaler de resolução) ainda é um serviço separado que pode ser chamado após a geração.
|
| 23 |
+
from api.seedvr.seed_aduc_pipeline import seed_aduc_pipeline
|
| 24 |
|
| 25 |
# Nosso decorador de logging para depuração
|
| 26 |
+
from utils.debug_utils import log_function_io
|
| 27 |
|
| 28 |
+
logging.info("All backend services (Orchestrator, SeedVR) and debug utils imported successfully.")
|
| 29 |
+
|
| 30 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# ==============================================================================
|
| 33 |
# --- FUNÇÕES WRAPPER (PONTE ENTRE UI E BACKEND) ---
|