Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,17 @@ def video_generation(
|
|
| 40 |
generator=torch.Generator().manual_seed(42) # Optional seed
|
| 41 |
).frames[0]
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
@tool
|
|
|
|
| 40 |
generator=torch.Generator().manual_seed(42) # Optional seed
|
| 41 |
).frames[0]
|
| 42 |
|
| 43 |
+
output_path = "generated_video.mp4"
|
| 44 |
+
video_frames[0].save(
|
| 45 |
+
output_path,
|
| 46 |
+
save_all=True,
|
| 47 |
+
append_images=video_frames[1:],
|
| 48 |
+
duration=1000, # milliseconds per frame
|
| 49 |
+
loop=0
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
return f"Video saved to {output_path}"
|
| 53 |
+
|
| 54 |
|
| 55 |
|
| 56 |
@tool
|