Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -643,6 +643,7 @@ def get_gpu_duration(
|
|
| 643 |
duration: float,
|
| 644 |
gpu_duration: float,
|
| 645 |
enhance_prompt: bool = True,
|
|
|
|
| 646 |
randomize_seed: bool = True,
|
| 647 |
height: int = 1024,
|
| 648 |
width: int = 1536,
|
|
@@ -682,6 +683,7 @@ def generate_video(
|
|
| 682 |
duration: float,
|
| 683 |
gpu_duration: float,
|
| 684 |
enhance_prompt: bool = True,
|
|
|
|
| 685 |
randomize_seed: bool = True,
|
| 686 |
height: int = 1024,
|
| 687 |
width: int = 1536,
|
|
@@ -786,6 +788,21 @@ def generate_video(
|
|
| 786 |
|
| 787 |
output_path = tempfile.mktemp(suffix=".mp4")
|
| 788 |
encode_video(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 789 |
|
| 790 |
|
| 791 |
# =============================================================================
|
|
|
|
| 643 |
duration: float,
|
| 644 |
gpu_duration: float,
|
| 645 |
enhance_prompt: bool = True,
|
| 646 |
+
seed: int = 42,
|
| 647 |
randomize_seed: bool = True,
|
| 648 |
height: int = 1024,
|
| 649 |
width: int = 1536,
|
|
|
|
| 683 |
duration: float,
|
| 684 |
gpu_duration: float,
|
| 685 |
enhance_prompt: bool = True,
|
| 686 |
+
seed: int = 42,
|
| 687 |
randomize_seed: bool = True,
|
| 688 |
height: int = 1024,
|
| 689 |
width: int = 1536,
|
|
|
|
| 788 |
|
| 789 |
output_path = tempfile.mktemp(suffix=".mp4")
|
| 790 |
encode_video(
|
| 791 |
+
video=video,
|
| 792 |
+
fps=DEFAULT_FRAME_RATE,
|
| 793 |
+
audio=audio,
|
| 794 |
+
output_path=output_path,
|
| 795 |
+
video_chunks_number=video_chunks_number,
|
| 796 |
+
)
|
| 797 |
+
|
| 798 |
+
log_memory("after encode_video")
|
| 799 |
+
return str(output_path), current_seed
|
| 800 |
+
|
| 801 |
+
except Exception as e:
|
| 802 |
+
import traceback
|
| 803 |
+
log_memory("on error")
|
| 804 |
+
print(f"Error: {str(e)}\n{traceback.format_exc()}")
|
| 805 |
+
return None, current_seed
|
| 806 |
|
| 807 |
|
| 808 |
# =============================================================================
|