Spaces:
Paused
Paused
Update api/ltx_server.py
Browse files- api/ltx_server.py +13 -8
api/ltx_server.py
CHANGED
|
@@ -642,10 +642,10 @@ class VideoService:
|
|
| 642 |
progress_callback=progress_callback
|
| 643 |
)
|
| 644 |
|
| 645 |
-
|
| 646 |
try:
|
| 647 |
-
shutil.move(output_video_path,
|
| 648 |
-
final_output_path =
|
| 649 |
print(f"[DEBUG] MP4 parte {par} movido para {final_output_path}")
|
| 650 |
partes_mp4.append(final_output_path)
|
| 651 |
|
|
@@ -653,13 +653,18 @@ class VideoService:
|
|
| 653 |
final_output_path = output_video_path
|
| 654 |
print(f"[DEBUG] Falha no move; usando tmp como final: {e}")
|
| 655 |
|
| 656 |
-
|
| 657 |
-
self._concat_mp4s_no_reencode(partes_mp4[0], partes_mp4[1],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 658 |
|
| 659 |
-
self._register_tmp_file(final_concat_tmp)
|
| 660 |
self._log_gpu_memory("Fim da Geração")
|
| 661 |
-
|
| 662 |
-
return final_concat_tmp, used_seed
|
| 663 |
|
| 664 |
|
| 665 |
except Exception as e:
|
|
|
|
| 642 |
progress_callback=progress_callback
|
| 643 |
)
|
| 644 |
|
| 645 |
+
candidate = os.path.join(results_dir, f"output_{used_seed}.mp4")
|
| 646 |
try:
|
| 647 |
+
shutil.move(output_video_path, candidate)
|
| 648 |
+
final_output_path = candidate
|
| 649 |
print(f"[DEBUG] MP4 parte {par} movido para {final_output_path}")
|
| 650 |
partes_mp4.append(final_output_path)
|
| 651 |
|
|
|
|
| 653 |
final_output_path = output_video_path
|
| 654 |
print(f"[DEBUG] Falha no move; usando tmp como final: {e}")
|
| 655 |
|
| 656 |
+
final_concat = os.path.join(results_dir, f"concat_{used_seed}.mp4")
|
| 657 |
+
self._concat_mp4s_no_reencode(partes_mp4[0], partes_mp4[1], final_concat)
|
| 658 |
+
|
| 659 |
+
try:
|
| 660 |
+
shutil.move(output_video_path, final_concat)
|
| 661 |
+
final_output_path = final_concat
|
| 662 |
+
except Exception:
|
| 663 |
+
final_output_path = output_video_path
|
| 664 |
+
self._register_tmp_file(output_video_path)
|
| 665 |
|
|
|
|
| 666 |
self._log_gpu_memory("Fim da Geração")
|
| 667 |
+
return final_output_path, used_seed
|
|
|
|
| 668 |
|
| 669 |
|
| 670 |
except Exception as e:
|