Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
-
from diffusers import AnimateDiffPipeline, DDIMScheduler
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
pipe = AnimateDiffPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
|
| 8 |
-
pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
|
| 9 |
|
| 10 |
-
def
|
| 11 |
-
|
| 12 |
-
return
|
| 13 |
|
| 14 |
-
gr.Interface(fn=
|
| 15 |
-
inputs=gr.Textbox(label="Enter your prompt"),
|
| 16 |
-
outputs=gr.Video(label="Generated Video")).launch()
|
|
|
|
| 1 |
+
from diffusers import DiffusionPipeline
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
|
|
|
| 4 |
|
| 5 |
+
pipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w", torch_dtype=torch.float16)
|
| 6 |
+
pipe.to("cuda")
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
def generate(prompt):
|
| 9 |
+
video_frames = pipe(prompt, num_inference_steps=25).frames
|
| 10 |
+
return video_frames[0] # return first frame or full video logic
|
| 11 |
|
| 12 |
+
gr.Interface(fn=generate, inputs="text", outputs="image").launch()
|
|
|
|
|
|