Spaces:
Running
Running
fix error
Browse files
app.py
CHANGED
@@ -32,16 +32,12 @@ def generate_video(prompt):
|
|
32 |
print("Starting video generation...")
|
33 |
start_time = time.time()
|
34 |
|
35 |
-
# Generate video
|
36 |
-
|
37 |
-
print("Video frames generated successfully!")
|
38 |
|
39 |
-
# Save the generated
|
40 |
output_path = "generated_video.mp4"
|
41 |
-
|
42 |
-
# Convert images to video
|
43 |
-
import imageio
|
44 |
-
imageio.mimsave(output_path, images, fps=5)
|
45 |
|
46 |
end_time = time.time()
|
47 |
print(f"Video saved to {output_path} in {end_time - start_time:.2f} seconds")
|
@@ -62,6 +58,6 @@ demo = gr.Interface(
|
|
62 |
|
63 |
if __name__ == "__main__":
|
64 |
if pipe is not None:
|
65 |
-
demo.launch() #
|
66 |
else:
|
67 |
print("Could not launch app due to model loading failure.")
|
|
|
32 |
print("Starting video generation...")
|
33 |
start_time = time.time()
|
34 |
|
35 |
+
# Generate video
|
36 |
+
output = pipe(prompt)
|
|
|
37 |
|
38 |
+
# Save the generated video
|
39 |
output_path = "generated_video.mp4"
|
40 |
+
output.save_to_file(output_path)
|
|
|
|
|
|
|
41 |
|
42 |
end_time = time.time()
|
43 |
print(f"Video saved to {output_path} in {end_time - start_time:.2f} seconds")
|
|
|
58 |
|
59 |
if __name__ == "__main__":
|
60 |
if pipe is not None:
|
61 |
+
demo.launch(share=True) # Set share=True to create a public link
|
62 |
else:
|
63 |
print("Could not launch app due to model loading failure.")
|