Run this model with HF Jobs
Run cerspense/zeroscope_v2_XL on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/cerspense/zeroscope_v2_XL. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/cerspense/zeroscope_v2_XL on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use cerspense/zeroscope_v2_XL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use cerspense/zeroscope_v2_XL with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_XL", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Commit ·
e9a7679
1
Parent(s): ef6a36a
Add diffusers example
Browse files15 unmodified lines16171819202115 unmodified lines2. Replace the respective files in the 'stable-diffusion-webui\models\ModelScope\t2v' directory.### Upscaling recommendationsFor upscaling, it's recommended to use the 1111 extension. It works best at 1024x576 with a denoise strength between 0.66 and 0.85. Remember to use the same prompt that was used to generate the original clip.### Known issuesRendering at lower resolutions or fewer than 24 frames could lead to suboptimal outputs. <br />15 unmodified lines1617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757615 unmodified lines2. Replace the respective files in the 'stable-diffusion-webui\models\ModelScope\t2v' directory.### Upscaling recommendationsFor upscaling, it's recommended to use the 1111 extension. It works best at 1024x576 with a denoise strength between 0.66 and 0.85. Remember to use the same prompt that was used to generate the original clip.### Usage in 🧨 DiffusersLet's first install the libraries required:```bash$ pip install git+https://github.com/huggingface/diffusers.git$ pip install transformers accelerate torch```Now, let's first generate a low resolution video using [cerspense/zeroscope_v2_576w](https://huggingface.co/cerspense/zeroscope_v2_576w).```pyimport torchfrom diffusers import DiffusionPipeline, DPMSolverMultistepSchedulerfrom diffusers.utils import export_to_videopipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_576w", torch_dtype=torch.float16)pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)pipe.enable_model_cpu_offload()pipe.enable_vae_slicing()prompt = "Darth Vader is surfing on waves"video_frames = pipe(prompt, num_inference_steps=40, height=320, width=576, num_frames=36).framesvideo_path = export_to_video(video_frames)```Next, we can upscale it using [cerspense/zeroscope_v2_XL](https://huggingface.co/cerspense/zeroscope_v2_XL).```pypipe = DiffusionPipeline.from_pretrained("cerspense/zeroscope_v2_XL", torch_dtype=torch.float16)pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)pipe.enable_model_cpu_offload()pipe.enable_vae_slicing()video = [Image.fromarray(frame).resize((1024, 576)) for frame in video_frames]video_frames = pipe(prompt, video=video, strength=0.6).framesvideo_path = export_to_video(video_frames, output_video_path="/home/patrick/videos/video_1024_darth_vader_36.mp4")```Here are some results:<table><tr>Darth vader is surfing on waves.<br><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/darth_vader_36_1024.gif"alt="Darth vader surfing in waves."style="width: 576;" /></center></td></tr></table>### Known issuesRendering at lower resolutions or fewer than 24 frames could lead to suboptimal outputs. <br />
README.md+55