eeuuia commited on
Commit
c4a303b
·
verified ·
1 Parent(s): aa98d8e

Update api/seedvr/seedvr_aduc_pipeline.py

Browse files
Files changed (1) hide show
  1. api/seedvr/seedvr_aduc_pipeline.py +16 -16
api/seedvr/seedvr_aduc_pipeline.py CHANGED
@@ -18,7 +18,7 @@ import logging
18
  # ==============================================================================
19
  try:
20
  from managers.gpu_manager import gpu_manager
21
- from api.ltx.ltx_server_refactored_complete import ltx_aduc_pipeline
22
  from utils.debug_utils import log_function_io
23
  except ImportError:
24
  # Fallback para o decorador caso o import falhe
@@ -148,10 +148,10 @@ class SeedAducPipeline:
148
  """
149
  if progress: progress(0.01, "⌛ Initializing SeedVR inference...")
150
 
151
- if gpu_manager.requires_memory_swap():
152
- logging.warning("[SWAP] Memory swapping is active. Moving LTX service to CPU to free VRAM for SeedVR.")
153
- if progress: progress(0.02, "🔄 Freeing VRAM for SeedVR...")
154
- ltx_aduc_pipeline.move_to_cpu()
155
 
156
  try:
157
  if progress: progress(0.05, "🎬 Extracting frames from video...")
@@ -202,20 +202,20 @@ class SeedAducPipeline:
202
  logging.info(f"✅ Video successfully saved to: {output_filepath}")
203
  return str(output_filepath)
204
 
205
- finally:
206
  # --- CORREÇÃO IMPORTANTE ---
207
  # Restaura o LTX para seus dispositivos corretos (main e vae)
208
- if gpu_manager.requires_memory_swap():
209
- logging.warning("[SWAP] SeedVR inference finished. Moving LTX service back to GPU(s)...")
210
- if progress: progress(0.99, "🔄 Restoring LTX environment...")
211
- ltx_main_device = gpu_manager.get_ltx_device()
212
- ltx_vae_device = gpu_manager.get_ltx_vae_device()
213
  # Chama a função move_to_device com os dois dispositivos
214
- ltx_aduc_pipeline.move_to_device(
215
- main_device_str=str(ltx_main_device),
216
- vae_device_str=str(ltx_vae_device)
217
- )
218
- logging.info(f"[SWAP] LTX service restored to Main: {ltx_main_device}, VAE: {ltx_vae_device}.")
219
 
220
  # --- PONTO DE ENTRADA E INSTANCIAÇÃO ---
221
  # A instância é criada na primeira importação.
 
18
  # ==============================================================================
19
  try:
20
  from managers.gpu_manager import gpu_manager
21
+ #from api.ltx.ltx_server_refactored_complete import ltx_aduc_pipeline
22
  from utils.debug_utils import log_function_io
23
  except ImportError:
24
  # Fallback para o decorador caso o import falhe
 
148
  """
149
  if progress: progress(0.01, "⌛ Initializing SeedVR inference...")
150
 
151
+ #if false: #gpu_manager.requires_memory_swap():
152
+ # logging.warning("[SWAP] Memory swapping is active. Moving LTX service to CPU to free VRAM for SeedVR.")
153
+ # if progress: progress(0.02, "🔄 Freeing VRAM for SeedVR...")
154
+ # ltx_aduc_pipeline.move_to_cpu()
155
 
156
  try:
157
  if progress: progress(0.05, "🎬 Extracting frames from video...")
 
202
  logging.info(f"✅ Video successfully saved to: {output_filepath}")
203
  return str(output_filepath)
204
 
205
+ #finally:
206
  # --- CORREÇÃO IMPORTANTE ---
207
  # Restaura o LTX para seus dispositivos corretos (main e vae)
208
+ #if gpu_manager.requires_memory_swap():
209
+ #logging.warning("[SWAP] SeedVR inference finished. Moving LTX service back to GPU(s)...")
210
+ #if progress: progress(0.99, "🔄 Restoring LTX environment...")
211
+ #ltx_main_device = gpu_manager.get_ltx_device()
212
+ #ltx_vae_device = gpu_manager.get_ltx_vae_device()
213
  # Chama a função move_to_device com os dois dispositivos
214
+ #ltx_aduc_pipeline.move_to_device(
215
+ # main_device_str=str(ltx_main_device),
216
+ # vae_device_str=str(ltx_vae_device)
217
+ #)
218
+ #logging.info(f"[SWAP] LTX service restored to Main: {ltx_main_device}, VAE: {ltx_vae_device}.")
219
 
220
  # --- PONTO DE ENTRADA E INSTANCIAÇÃO ---
221
  # A instância é criada na primeira importação.