guardiancc commited on
Commit
4b2e644
·
verified ·
1 Parent(s): 3c0731e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import torch
2
  import gradio as gr
3
  import time
@@ -13,11 +14,14 @@ pipe.enable_sequential_cpu_offload()
13
  pipe.vae.enable_tiling()
14
  pipe.vae.enable_slicing()
15
 
 
16
  def generate_video(image, prompt):
17
  if image is None:
18
  raise gr.Error("Please upload an input image")
19
  if not prompt:
20
  raise gr.Error("Please enter a text prompt")
 
 
21
 
22
  # Load uploaded image
23
  input_image = load_image(image)
 
1
+ import spaces
2
  import torch
3
  import gradio as gr
4
  import time
 
14
  pipe.vae.enable_tiling()
15
  pipe.vae.enable_slicing()
16
 
17
+ @spaces.GPU(duration=120)
18
  def generate_video(image, prompt):
19
  if image is None:
20
  raise gr.Error("Please upload an input image")
21
  if not prompt:
22
  raise gr.Error("Please enter a text prompt")
23
+
24
+ pipe.to('cuda')
25
 
26
  # Load uploaded image
27
  input_image = load_image(image)