Add code snippet for Diffusers

#2

Hey @cerspense ,

Amazing work on adding such a cool model that is not polluted by watermarks! Just adding a quick code snippet here for diffusers :-)

Best,
Patrick

This worked for me with diffusers==0.17.1

from torchvision.io import write_video
from diffusers import DPMSolverMultistepScheduler
from diffusers import DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w")
pipeline.to("cuda")
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(pipeline.scheduler.config)
prompt = "Spiderman is surfing"
video_frames = pipeline(prompt, num_inference_steps=30, num_frames=20, height=320, width=576).frames
video = torch.stack([torch.tensor(frame) for frame in video_frames]).permute(0,3,1,2)
write_video("spiderman.mp4", video_frames, fps=10)

But I still don't get how to use the xl model to upscale the result :(

We need some more code for this, planning on adding this this week

cerspense changed pull request status to merged

@RafailFridman took the liberty of adding code highlighting to your comment above hope it's ok:)

Sign up or log in to comment