🚀 Wan 14B Laezel
A LoRA for video generation based on the Wan2.1 14b model
Metadata
Property |
Details |
License |
Apache-2.0 |
Supported Languages |
English, Chinese |
Tags |
image-to-video, lora, replicate, text-to-video, video, video-generation |
Base Model |
Wan-AI/Wan2.1-T2V-14B-Diffusers |
Pipeline Tag |
text-to-video |
🚀 Quick Start
This is a LoRA designed for the Wan2.1 14b video generation model. It can be used with diffusers or ComfyUI, and is compatible with both the text-to-video and image-to-video Wan2.1 models. It was trained on Replicate using the AI toolkit: https://replicate.com/ostris/wan-lora-trainer/train
✨ Features
Trigger words
You should use LAEZEL
to trigger the video generation.
Available Models on Replicate
Replicate has a collection of Wan2.1 models that are optimised for speed and cost. They can also be used with this LoRA:
- https://replicate.com/collections/wan-video
- https://replicate.com/fofr/wan2.1-with-lora
💻 Usage Examples
Basic Usage
Run this LoRA with an API using Replicate
import replicate
input = {
"prompt": "LAEZEL",
"lora_url": "https://huggingface.co/fofr/wan-14b-laezel/resolve/main/wan2.1-14b-laezel-lora.safetensors"
}
output = replicate.run(
"fofr/wan2.1-with-lora:f83b84064136a38415a3aff66c326f94c66859b8ad7a2cb432e2822774f07b08",
model="14b",
input=input
)
for index, item in enumerate(output):
with open(f"output_{index}.mp4", "wb") as file:
file.write(item.read())
Advanced Usage
Using with Diffusers
pip install git+https://github.com/huggingface/diffusers.git
import torch
from diffusers.utils import export_to_video
from diffusers import AutoencoderKLWan, WanPipeline
from diffusers.schedulers.scheduling_unipc_multistep import UniPCMultistepScheduler
model_id = "Wan-AI/Wan2.1-T2V-14B-Diffusers"
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16)
flow_shift = 3.0
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=flow_shift)
pipe.to("cuda")
pipe.load_lora_weights("fofr/wan-14b-laezel")
pipe.enable_model_cpu_offload()
prompt = "LAEZEL"
negative_prompt = "Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"
output = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
height=480,
width=832,
num_frames=81,
guidance_scale=5.0,
).frames[0]
export_to_video(output, "output.mp4", fps=16)
🔧 Technical Details
- Steps: 2000
- Learning rate: 0.0001
- LoRA rank: 32
🤝 Contribute your own examples
You can use the community tab to add videos that show off what you’ve made with this LoRA.
📄 License
This project is licensed under the Apache-2.0 license.