Text-to-Video
Diffusers
Safetensors
English
Chinese
WanPipeline
image-to-video
video-generation
vbvr
Instructions to use Video-Reason/VBVR-Pro-Wan2.2-TI2V-5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Video-Reason/VBVR-Pro-Wan2.2-TI2V-5B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Video-Reason/VBVR-Pro-Wan2.2-TI2V-5B", 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
| """VBVR-Pro-Wan2.2-TI2V-5B text-to-video inference example. | |
| Usage: | |
| python example.py --model_path ./VBVR-Pro-Wan2.2-TI2V-5B \ | |
| --prompt "Your video instruction" | |
| """ | |
| import argparse | |
| import torch | |
| from diffusers import AutoencoderKLWan, WanPipeline | |
| from diffusers.utils import export_to_video | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--model_path", type=str, default="VBVR-Pro-Wan2.2-TI2V-5B") | |
| parser.add_argument("--prompt", type=str, required=True, help="Video instruction") | |
| parser.add_argument( | |
| "--negative_prompt", | |
| type=str, | |
| default="Bright tones, overexposed, static, blurred details, subtitles, low quality", | |
| ) | |
| parser.add_argument("--output", type=str, default="output.mp4") | |
| parser.add_argument("--width", type=int, default=832) | |
| parser.add_argument("--height", type=int, default=480) | |
| parser.add_argument("--num_frames", type=int, default=81) | |
| parser.add_argument("--steps", type=int, default=50) | |
| parser.add_argument("--guidance_scale", type=float, default=5.0) | |
| parser.add_argument("--fps", type=int, default=15) | |
| parser.add_argument("--seed", type=int, default=42) | |
| args = parser.parse_args() | |
| print(f"Loading model from: {args.model_path}") | |
| vae = AutoencoderKLWan.from_pretrained( | |
| args.model_path, subfolder="vae", torch_dtype=torch.float32 | |
| ) | |
| pipe = WanPipeline.from_pretrained( | |
| args.model_path, vae=vae, torch_dtype=torch.bfloat16 | |
| ) | |
| pipe.enable_model_cpu_offload() | |
| frames = pipe( | |
| prompt=args.prompt, | |
| negative_prompt=args.negative_prompt, | |
| height=args.height, | |
| width=args.width, | |
| num_frames=args.num_frames, | |
| num_inference_steps=args.steps, | |
| guidance_scale=args.guidance_scale, | |
| generator=torch.manual_seed(args.seed), | |
| ).frames[0] | |
| export_to_video(frames, args.output, fps=args.fps) | |
| print(f"Saved to: {args.output}") | |