Update deformes4D_engine.py
Browse files- deformes4D_engine.py +5 -23
deformes4D_engine.py
CHANGED
|
@@ -211,22 +211,8 @@ class Deformes4DEngine:
|
|
| 211 |
gc.collect()
|
| 212 |
torch.cuda.empty_cache()
|
| 213 |
|
| 214 |
-
# --- ATO
|
| 215 |
-
|
| 216 |
-
progress(current_step / TOTAL_STEPS, desc="Gerando trilha sonora...")
|
| 217 |
-
try:
|
| 218 |
-
video_with_audio_path = audio_specialist_singleton.generate_audio_for_video(
|
| 219 |
-
video_path=refined_silent_video_path,
|
| 220 |
-
prompt=global_prompt,
|
| 221 |
-
duration_seconds=self._get_video_duration(refined_silent_video_path)
|
| 222 |
-
)
|
| 223 |
-
temp_audio_path = os.path.join(self.workspace_dir, f"{base_name}_extracted_audio.aac")
|
| 224 |
-
extracted_audio_path = self._extract_audio_ffmpeg(video_with_audio_path, temp_audio_path)
|
| 225 |
-
except Exception as e:
|
| 226 |
-
logger.error(f"Falha na geração de áudio: {e}. O vídeo final será silencioso.")
|
| 227 |
-
extracted_audio_path = None
|
| 228 |
-
|
| 229 |
-
current_step += 1
|
| 230 |
progress(current_step / TOTAL_STEPS, desc="Aprimoramento final (HD)...")
|
| 231 |
hq_silent_video_path = os.path.join(self.workspace_dir, f"{base_name}_hq_silent.mp4")
|
| 232 |
try:
|
|
@@ -243,13 +229,9 @@ class Deformes4DEngine:
|
|
| 243 |
progress(current_step / TOTAL_STEPS, desc="Finalizando montagem...")
|
| 244 |
final_video_path = os.path.join(self.workspace_dir, f"{base_name}_FINAL.mp4")
|
| 245 |
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
os.rename(hq_silent_video_path, final_video_path)
|
| 250 |
-
|
| 251 |
-
logger.info(f"Processo concluído! Vídeo final salvo em: {final_video_path}")
|
| 252 |
-
yield {"final_path": final_video_path}
|
| 253 |
|
| 254 |
def refine_latents(self, latents: torch.Tensor,
|
| 255 |
fps: int = 24,
|
|
|
|
| 211 |
gc.collect()
|
| 212 |
torch.cuda.empty_cache()
|
| 213 |
|
| 214 |
+
# --- ATO II: FINAL (HD) ---
|
| 215 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
progress(current_step / TOTAL_STEPS, desc="Aprimoramento final (HD)...")
|
| 217 |
hq_silent_video_path = os.path.join(self.workspace_dir, f"{base_name}_hq_silent.mp4")
|
| 218 |
try:
|
|
|
|
| 229 |
progress(current_step / TOTAL_STEPS, desc="Finalizando montagem...")
|
| 230 |
final_video_path = os.path.join(self.workspace_dir, f"{base_name}_FINAL.mp4")
|
| 231 |
|
| 232 |
+
|
| 233 |
+
logger.info(f"Processo concluído! Vídeo final salvo em: {hq_silent_video_path}")
|
| 234 |
+
yield {"final_path": hq_silent_video_path}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
def refine_latents(self, latents: torch.Tensor,
|
| 237 |
fps: int = 24,
|