Instructions to use Video-Reason/VBVR-Wan2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Video-Reason/VBVR-Wan2.1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Video-Reason/VBVR-Wan2.1", dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
File size: 309 Bytes
4620b21 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | import torch
from safetensors.torch import load_file
# 1. 载入 safetensors 权重文件
safetensor_path = "diffusion_pytorch_model.safetensors"
state_dict = load_file(safetensor_path)
# 2. 保存为 PyTorch 的 .pth 格式
torch.save(state_dict, "Wan2.1_VAE.pth")
print("转换完成:Wan2.1_VAE.pth")
|