TenPoisk
commited on
Commit
·
f7b53f5
1
Parent(s):
3610316
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
3 |
+
from diffusers.utils import export_to_video
|
4 |
+
|
5 |
+
pipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w", torch_dtype=torch.float16)
|
6 |
+
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
7 |
+
pipe.enable_model_cpu_offload()
|
8 |
+
|
9 |
+
prompt = "Darth Vader is surfing on waves"
|
10 |
+
video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=24).frames
|
11 |
+
video_path = export_to_video(video_frames)
|