Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import torch
|
|
4 |
from PIL import Image
|
5 |
import tempfile
|
6 |
import imageio
|
|
|
7 |
|
8 |
# Load the Stable Video Diffusion model
|
9 |
model_id = "stabilityai/stable-video-diffusion-img2vid-xt"
|
@@ -14,6 +15,7 @@ try:
|
|
14 |
except Exception as e:
|
15 |
raise RuntimeError(f"Failed to load the model: {e}")
|
16 |
|
|
|
17 |
def generate_video(image, num_frames=25, height=576, width=1024):
|
18 |
try:
|
19 |
# Convert the image to a format suitable for the pipeline
|
|
|
4 |
from PIL import Image
|
5 |
import tempfile
|
6 |
import imageio
|
7 |
+
import spaces
|
8 |
|
9 |
# Load the Stable Video Diffusion model
|
10 |
model_id = "stabilityai/stable-video-diffusion-img2vid-xt"
|
|
|
15 |
except Exception as e:
|
16 |
raise RuntimeError(f"Failed to load the model: {e}")
|
17 |
|
18 |
+
@spaces.GPU
|
19 |
def generate_video(image, num_frames=25, height=576, width=1024):
|
20 |
try:
|
21 |
# Convert the image to a format suitable for the pipeline
|