caarleexx commited on
Commit
cac6b1e
·
verified ·
1 Parent(s): ea172f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -1
app.py CHANGED
@@ -61,8 +61,36 @@ def run_generate_low(prompt, neg_prompt, start_img, height, width, duration, cfg
61
  }
62
 
63
  return video_path, new_state, gr.update(visible=True)
64
-
65
  def run_ltx_refinement(state, prompt, neg_prompt, cfg, progress=gr.Progress(track_tqdm=True)):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  """Executa o processo de refinamento e upscaling de textura com o pipeline LTX."""
67
  print("UI: Chamando run_ltx_refinement (generate_upscale_denoise)")
68
 
 
61
  }
62
 
63
  return video_path, new_state, gr.update(visible=True)
64
+
65
  def run_ltx_refinement(state, prompt, neg_prompt, cfg, progress=gr.Progress(track_tqdm=True)):
66
+ """Executa o processo de refinamento secundário."""
67
+ print("UI: Chamando a função ponte 'apply_secondary_refinement'")
68
+
69
+ try:
70
+ # AQUI ESTÁ A MUDANÇA: Chamamos a nova função ponte
71
+ video_path, tensor_path = video_generation_service.apply_secondary_refinement(
72
+ latents_path=state["low_res_latents"],
73
+ prompt=prompt,
74
+ negative_prompt=neg_prompt,
75
+ guidance_scale=cfg,
76
+ seed=state["used_seed"]
77
+ )
78
+
79
+ # Atualiza o estado com os novos artefatos refinados
80
+ state["refined_video_ltx"] = video_path
81
+ state["refined_latents_ltx"] = tensor_path
82
+
83
+ return video_path, state
84
+
85
+ except Exception as e:
86
+ print(f"[ERRO na UI] Falha durante o refinamento secundário: {e}")
87
+ traceback.print_exc()
88
+ # Você pode retornar uma mensagem de erro para a UI aqui se quiser
89
+ # Ex: return None, state
90
+ raise gr.Error(f"Falha no Refinamento: {e}")
91
+
92
+
93
+ def run_ltx_refinemen1t(state, prompt, neg_prompt, cfg, progress=gr.Progress(track_tqdm=True)):
94
  """Executa o processo de refinamento e upscaling de textura com o pipeline LTX."""
95
  print("UI: Chamando run_ltx_refinement (generate_upscale_denoise)")
96