mrcuddle commited on
Commit
2ca1d47
·
verified ·
1 Parent(s): 3ec68b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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.editor import ImageSequenceClip
 
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)