Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import torch
|
|
2 |
import gradio as gr
|
3 |
from diffusers import StableVideoDiffusionPipeline
|
4 |
from diffusers.utils import load_image, export_to_video
|
|
|
5 |
|
6 |
# Check if GPU is available
|
7 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
@@ -12,6 +13,7 @@ pipeline = StableVideoDiffusionPipeline.from_pretrained(
|
|
12 |
)
|
13 |
pipeline.to(device)
|
14 |
|
|
|
15 |
def generate_video(image_path, seed):
|
16 |
# Load and preprocess the image
|
17 |
image = load_image(image_path)
|
|
|
2 |
import gradio as gr
|
3 |
from diffusers import StableVideoDiffusionPipeline
|
4 |
from diffusers.utils import load_image, export_to_video
|
5 |
+
import spaces
|
6 |
|
7 |
# Check if GPU is available
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
13 |
)
|
14 |
pipeline.to(device)
|
15 |
|
16 |
+
@spaces.GPU
|
17 |
def generate_video(image_path, seed):
|
18 |
# Load and preprocess the image
|
19 |
image = load_image(image_path)
|