Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ import gradio as gr
|
|
3 |
from diffusers import StableVideoDiffusionPipeline
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
-
from moviepy
|
|
|
7 |
|
8 |
# Load the pipeline
|
9 |
pipeline = StableVideoDiffusionPipeline.from_pretrained(
|
@@ -11,6 +12,7 @@ pipeline = StableVideoDiffusionPipeline.from_pretrained(
|
|
11 |
)
|
12 |
pipeline.enable_model_cpu_offload()
|
13 |
|
|
|
14 |
def generate_video(image, seed):
|
15 |
# Preprocess the image
|
16 |
image = Image.open(image)
|
|
|
3 |
from diffusers import StableVideoDiffusionPipeline
|
4 |
from PIL import Image
|
5 |
import numpy as np
|
6 |
+
from moviepy import ImageSequenceClip
|
7 |
+
import spaces
|
8 |
|
9 |
# Load the pipeline
|
10 |
pipeline = StableVideoDiffusionPipeline.from_pretrained(
|
|
|
12 |
)
|
13 |
pipeline.enable_model_cpu_offload()
|
14 |
|
15 |
+
@spaces.GPU
|
16 |
def generate_video(image, seed):
|
17 |
# Preprocess the image
|
18 |
image = Image.open(image)
|