NVFP4-Lightx2v
Collection
2 items β’ Updated β’ 10
How to use lightx2v/Wan2.2-NVFP4-Sparse with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("lightx2v/Wan2.2-NVFP4-Sparse", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("lightx2v/Wan2.2-NVFP4-Sparse", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]An extremely efficient Wan 2.2 14B variant: NVFP4 Quantization-Aware Step Distillation with Sparse Attention for Blackwell Architecture
We strongly recommend using the official LightX2V Docker image for the cleanest environment and best reproducibility.
# 1. Pull LightX2V Docker image
docker pull lightx2v/lightx2v:26052801-cu130-5090
# 2. Run text-to-video inference
bash scripts/wan22/distill/run_wan22_moe_t2v_extreme.sh
# 3. Run image-to-video inference
bash scripts/wan22/distill/run_wan22_moe_i2v_extreme.sh
If Docker is not available, install the environment manually:
# 1. Install LightX2V
git clone https://github.com/ModelTC/LightX2V.git
cd LightX2V
uv pip install -v .
# 2. Install NVFP4 Kernel
pip install scikit_build_core uv
git clone https://github.com/NVIDIA/cutlass.git
cd lightx2v_kernel
MAX_JOBS=$(nproc) CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
uv build --wheel \
-Cbuild-dir=build . \
-Ccmake.define.CUTLASS_PATH=/path/to/cutlass \
--verbose --color=always --no-build-isolation
pip install dist/*whl --force-reinstall --no-deps
# 3. Run text-to-video inference
bash scripts/wan22/distill/run_wan22_moe_t2v_extreme.sh
# 4. Run image-to-video inference
bash scripts/wan22/distill/run_wan22_moe_i2v_extreme.sh
Scripts:
"Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage"
| Resolution | Wan2.2-T2V-14B | Wan2.2-NVFP4-Sparse |
|---|---|---|
| 480p | ||
| 720p |
Test Environment: RTX 5090 Single GPU | LightX2V Framework | End-to-End Latency
| Resolution | Wan2.2-T2V-14B | Wan2.2-NVFP4-Sparse | Speedup |
|---|---|---|---|
| 480p | 734s | 14.15s | 51.9x |
| 720p | 2668s | 45s | 59.3x |
lightx2v/lightx2v:26052801-cu130-5090.If you find this project helpful, please give us a β on GitHub
For questions or issues, please open an issue on LightX2V or contact lvchengtao0319@gmail.com.
Base model
Wan-AI/Wan2.2-I2V-A14B