Spaces:
Runtime error
Runtime error
update.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import tempfile
|
|
|
4 |
from diffusers import StableVideoDiffusionPipeline
|
5 |
from diffusers.utils import export_to_video
|
6 |
|
@@ -12,6 +13,7 @@ pipe = StableVideoDiffusionPipeline.from_pretrained(
|
|
12 |
MODEL, torch_dtype=torch.float16
|
13 |
).to("cuda")
|
14 |
|
|
|
15 |
def infer(first_image, last_image, prompt, guidance=7.5, frames=25):
|
16 |
# Generate the in-between frames
|
17 |
video = pipe(
|
@@ -41,4 +43,4 @@ demo = gr.Interface(
|
|
41 |
)
|
42 |
|
43 |
# Enable the REST API
|
44 |
-
demo.queue(concurrency_count=1).launch(show_api=True)
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import tempfile
|
4 |
+
import spaces
|
5 |
from diffusers import StableVideoDiffusionPipeline
|
6 |
from diffusers.utils import export_to_video
|
7 |
|
|
|
13 |
MODEL, torch_dtype=torch.float16
|
14 |
).to("cuda")
|
15 |
|
16 |
+
@spaces.GPU(duration=300)
|
17 |
def infer(first_image, last_image, prompt, guidance=7.5, frames=25):
|
18 |
# Generate the in-between frames
|
19 |
video = pipe(
|
|
|
43 |
)
|
44 |
|
45 |
# Enable the REST API
|
46 |
+
demo.queue(concurrency_count=1).launch(show_api=True, ssr_mode=False)
|