Downloads · 30 days
0
wangkanai/wan21-fp8-loras
wan21-fp8-loras is a text-to-video model from wangkanai. Use it when you need video from a text prompt. It is set up for diffusers. The card lists the license as other.
Memory-efficient FP8 camera motion control LoRA adapters for WAN (World Animation Network) video generation models. These rank-16 LoRAs enable precise control over camera movements including rotation, arc shots, and d…
Downloads · 30 days
0
Access
Public
Updated Oct 27, 2025
Repo size
1.1 GB
Likes
1
Public
Click a slice to open those files.
.safetensors1.1 GB · 100%
From the Hugging Face model README
Memory-efficient FP8 camera motion control LoRA adapters for WAN (World Animation Network) video generation models. These rank-16 LoRAs enable precise control over camera movements including rotation, arc shots, and drone-style cinematography with 50% reduced memory footprint compared to FP16.
This repository contains three specialized LoRA adapters stored in FP8 precision, designed to enhance video generation with professional camera movement patterns:
These LoRAs are trained at rank-16 for optimal balance between parameter efficiency and motion quality control. All models use FP8 (8-bit floating-point) precision, offering significantly reduced VRAM usage while maintaining high-quality camera motion control.
wan21-fp8-loras/
└── loras/
└── wan/
├── wan21-camera-rotation-rank16-v1.safetensors (342.72 MB)
├── wan21-camera-arcshot-rank16-v1.safetensors (342.72 MB)
└── wan21-camera-drone-rank16-v1.safetensors (342.72 MB)
Total Repository Size: 1.03 GB
import torch
from diffusers import DiffusionPipeline
from transformers import T5EncoderModel
# Load base WAN model with FP8 optimization
pipe = DiffusionPipeline.from_pretrained(
"HunyuanVideo/HunyuanVideo",
torch_dtype=torch.float8_e4m3fn, # FP8 precision
variant="fp8"
)
pipe.to("cuda")
# Load camera rotation LoRA (FP8)
pipe.load_lora_weights(
"E:\\huggingface\\wan21-fp8-loras\\loras\\wan",
weight_name="wan21-camera-rotation-rank16-v1.safetensors"
)
# Generate video with camera rotation
prompt = "A majestic lion sitting on a rock, cinematic lighting, 4k"
video = pipe(
prompt=prompt,
num_frames=48,
height=512,
width=512,
num_inference_steps=50,
guidance_scale=7.5,
cross_attention_kwargs={"scale": 0.8} # LoRA strength
).frames
# Save video
from diffusers.utils import export_to_video
export_to_video(video, "output_rotation.mp4", fps=8)
import torch
from diffusers import DiffusionPipeline
# Configure for maximum memory efficiency
pipe = DiffusionPipeline.from_pretrained(
"HunyuanVideo/HunyuanVideo",
torch_dtype=torch.float8_e4m3fn,
variant="fp8"
)
# Enable aggressive memory optimizations for FP8
pipe.enable_attention_slicing()
pipe.enable_vae_tiling()
pipe.enable_model_cpu_offload() # Offload to CPU when not in use
pipe.to("cuda")
# Load arc shot LoRA
pipe.load_lora_weights(
"E:\\huggingface\\wan21-fp8-loras\\loras\\wan",
weight_name="wan21-camera-arcshot-rank16-v1.safetensors"
)
# Generate high-resolution video on limited VRAM
video = pipe(
prompt="A bustling city street at sunset, cinematic arc shot",
num_frames=64,
height=768,
width=1344,
num_inference_steps=50,
cross_attention_kwargs={"scale": 0.7}
).frames
export_to_video(video, "city_arcshot.mp4", fps=12)
# Unload current LoRA
pipe.unload_lora_weights()
# Load drone shot LoRA
pipe.load_lora_weights(
"E:\\huggingface\\wan21-fp8-loras\\loras\\wan",
weight_name="wan21-camera-drone-rank16-v1.safetensors"
)
# Generate aerial footage
video = pipe(
prompt="Aerial view of a mountain valley, rising drone shot, golden hour",
num_frames=64,
height=768,
width=1344,
cross_attention_kwargs={"scale": 0.8}
).frames
export_to_video(video, "drone_aerial.mp4", fps=12)
# Subtle camera movement (scale: 0.3-0.5)
video = pipe(
prompt="Static scene with subtle camera drift",
cross_attention_kwargs={"scale": 0.4}
).frames
# Standard camera movement (scale: 0.6-0.8)
video = pipe(
prompt="Dynamic scene with smooth camera motion",
cross_attention_kwargs={"scale": 0.7}
).frames
# Dramatic camera movement (scale: 0.9-1.0)
video = pipe(
prompt="Action scene with aggressive camera work",
cross_attention_kwargs={"scale": 1.0}
).frames
# FP8's memory efficiency allows combining multiple LoRAs
pipe.load_lora_weights(
"E:\\huggingface\\wan21-fp8-loras\\loras\\wan\\wan21-camera-rotation-rank16-v1.safetensors",
adapter_name="rotation"
)
# Load additional style or quality LoRA
pipe.load_lora_weights(
"path/to/style_lora_fp8.safetensors",
adapter_name="style"
)
# Set adapter weights for combined effect
pipe.set_adapters(["rotation", "style"], adapter_weights=[0.7, 0.5])
video = pipe(
prompt="Cinematic scene with rotating camera and artistic style",
num_frames=48,
height=512,
width=512
).frames
Rotation LoRA:
Arc Shot LoRA:
Drone Shot LoRA:
Memory Efficiency:
# Maximum memory savings for FP8
pipe.enable_attention_slicing()
pipe.enable_vae_tiling()
pipe.enable_vae_slicing()
pipe.enable_model_cpu_offload() # For 8 GB VRAM GPUs
# Alternatively, use sequential CPU offload for extreme memory constraints
pipe.enable_sequential_cpu_offload()
Quality Preservation:
# Maintain quality with FP8 by using more inference steps
video = pipe(
prompt="Your prompt here",
num_inference_steps=60, # Increase from default 50
guidance_scale=8.0, # Slightly higher guidance
cross_attention_kwargs={"scale": 0.75}
).frames
scale=0.7 as baseline for most scenes0.4-0.6 for subtle, naturalistic camera work0.9-1.0 for dramatic, stylized movementsnum_inference_steps to 60-80 for better quality with FP8guidance_scale 7.5-9 for balanced prompt adherence| Configuration | FP16 | FP8 | Savings |
|---|---|---|---|
| 512x512, 48 frames | ~10 GB | ~6 GB | 40% |
| 768x1344, 64 frames | ~18 GB | ~10 GB | 44% |
| With VAE tiling | ~8 GB | ~5 GB | 38% |
| Multiple LoRAs | ~12 GB | ~7 GB | 42% |
# Process multiple prompts efficiently with FP8
prompts = [
"Mountain landscape, drone rising shot",
"City street, rotating camera view",
"Forest scene, cinematic arc shot"
]
# FP8 allows processing without clearing cache as often
for i, prompt in enumerate(prompts):
video = pipe(
prompt=prompt,
num_frames=48,
cross_attention_kwargs={"scale": 0.7}
).frames
export_to_video(video, f"output_{i}.mp4", fps=8)
# Optional: Clear cache every few iterations if needed
if i % 3 == 0:
torch.cuda.empty_cache()
✅ Limited VRAM (8-12 GB GPUs) ✅ Need to combine multiple LoRAs ✅ Higher resolution generation on mid-range hardware ✅ Faster iteration during experimentation ✅ Batch processing multiple videos
✅ Maximum quality is critical ✅ Ample VRAM available (16+ GB) ✅ Minimal quality trade-offs required ✅ Professional production work
These LoRA models are subject to the WAN license terms. Please review the license agreement before commercial use:
For commercial licensing inquiries, please contact the original model creators or refer to the base model repository.
If you use these FP8 LoRAs in your research or projects, please cite:
@misc{wan21-camera-loras-fp8,
title={WAN 2.1 Camera Control LoRAs (FP8)},
author={WAN Development Team},
year={2024},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/HunyuanVideo/WAN-LoRAs}},
note={FP8 quantized for memory efficiency}
}
Issue: "Out of memory" error during inference with FP8
enable_sequential_cpu_offload() for extreme memory constraintsIssue: Camera movement too subtle or not visible with FP8
scale parameter to 0.8-0.9 (slightly higher than FP16)Issue: Quality degradation compared to FP16
num_inference_steps to 70-80guidance_scale to 8-9Issue: FP8 not supported on my GPU
Issue: LoRA not loading correctly
E:\\huggingface\\...torch_dtype=torch.float8_e4m3fn is supportedtorch.cuda.empty_cache() between generations if experiencing memory issuesnum_inference_steps (quality) vs generation time based on needsFor technical issues, bug reports, or feature requests:
Model Version: v1.0 README Version: v1.3 Precision: FP8 E4M3 Last Updated: October 2024 Repository Maintained By: WAN Development Team