Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
9 |
|
10 |
# Load the pipeline
|
11 |
pipeline = StableVideoDiffusionPipeline.from_pretrained(
|
12 |
-
"stabilityai/stable-video-diffusion-img2vid-xt", torch_dtype=torch.float16, variant="fp16"
|
13 |
)
|
14 |
pipeline.to(device)
|
15 |
|
@@ -27,7 +27,7 @@ def generate_video(image_path, seed):
|
|
27 |
|
28 |
# Export the frames to a video file
|
29 |
output_video_path = "generated.mp4"
|
30 |
-
export_to_video(frames, output_video_path, fps=
|
31 |
|
32 |
return output_video_path
|
33 |
|
@@ -43,5 +43,7 @@ iface = gr.Interface(
|
|
43 |
description="Generate a video from an uploaded image using Stable Video Diffusion.",
|
44 |
)
|
45 |
|
|
|
|
|
46 |
# Launch the interface
|
47 |
iface.launch()
|
|
|
9 |
|
10 |
# Load the pipeline
|
11 |
pipeline = StableVideoDiffusionPipeline.from_pretrained(
|
12 |
+
"stabilityai/stable-video-diffusion-img2vid-xt-1-1", torch_dtype=torch.float16, variant="fp16"
|
13 |
)
|
14 |
pipeline.to(device)
|
15 |
|
|
|
27 |
|
28 |
# Export the frames to a video file
|
29 |
output_video_path = "generated.mp4"
|
30 |
+
export_to_video(frames, output_video_path, fps=25)
|
31 |
|
32 |
return output_video_path
|
33 |
|
|
|
43 |
description="Generate a video from an uploaded image using Stable Video Diffusion.",
|
44 |
)
|
45 |
|
46 |
+
example_image = "image.jpeg"
|
47 |
+
example_video = "videos/generated.mp4"
|
48 |
# Launch the interface
|
49 |
iface.launch()
|