lightx2v/Wan2.2-NVFP4-Sparse

Model

50

stars

18

commits

1

linked in READMEs

Jul 27, 2026

updated

diffusers
NVFP4
Sparse_Attention
video_generation
Wan

README

🎬 LightWan2.2-A14B

An extremely efficient Wan 2.2 14B variant: NVFP4 Quantization-Aware Step Distillation with Sparse Attention for Blackwell Architecture

GitHub HuggingFace Blog

πŸ“‹ Table of Contents

✨ Features

  • ⚑ 4-Step Inference: Two high-noise expert steps followed by two low-noise expert steps, enabling extremely fast Wan2.2 MoE generation on a single Blackwell GPU.
  • 🎯 NVFP4 Quantization: Quantization-aware step distillation reduces memory traffic and compute cost while targeting Blackwell architecture.
  • 🧩 Sparse Attention: Accelerates the costly O(nΒ²) self-attention workload with sparse attention, reducing end-to-end latency for high-resolution video generation.
  • πŸ”§ LightX2V Integration: Recommended runtime stack for stable deployment and best performance.
  • πŸš€ High-Quality Generation: Preserves the visual quality of Wan2.2-T2V/I2V-14B while dramatically improving inference speed.

πŸš€ Quick Start

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 single-GPU inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme.sh

# 3. Run multi-GPU sequence-parallel inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme_sp_parallel.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme_sp_parallel.sh

Option B: Manual Installation

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 single-GPU inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme.sh

# 4. Run multi-GPU sequence-parallel inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme_sp_parallel.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme_sp_parallel.sh

Single-GPU Scripts:

Multi-GPU Scripts:

🎬 Generation Results

"Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage"

ResolutionWan2.2-T2V-14BLightWan2.2-A14B
480p
720p

⚑ Performance Comparison

Test Environment: RTX 5090 Single GPU | LightX2V Framework | End-to-End Latency

MethodTaskGPU NumberResolutionNFEE2E LatencySpeedup
Wan2.2-T2V-14BT2V1480p40734.0s1.0x
LightWan2.2-A14BT2V1480p49.1s80.7x
Wan2.2-T2V-14BT2V1720p402668.0s1.0x
LightWan2.2-A14BT2V1720p422.5s118.7x
Wan2.2-I2V-14BI2V1480p40787.0s1.0x
LightWan2.2-A14BI2V1480p410.7s73.9x
Wan2.2-I2V-14BI2V1720p402685.0s1.0x
LightWan2.2-A14BI2V1720p426.7s100.5x

⚠️ Notes

System Requirements

  • Required Hardware: NVIDIA RTX 50-series GPUs or other Blackwell architecture GPUs.
  • Recommended Runtime: lightx2v/lightx2v:26052801-cu130-5090.

Dependencies

  • Prepare Wan2.2 T5 / VAE components following the standard LightX2V Wan2.2 model structure.
  • For I2V, also prepare the required image encoder components and input image according to the LightX2V Wan2.2 I2V script.
  • Use Blackwell + NVFP4 kernels for optimal speed and memory efficiency.

Performance Tips

  • Use the provided extreme inference script for the 4-step high-noise / low-noise expert schedule.
  • Sparse attention is most beneficial at higher resolutions where self-attention dominates latency.
  • Enable CPU offload only when GPU memory is limited, since offload can reduce throughput.

🀝 Community


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.

Contributors

lightx2v

17 commits

mack-williams

1 commits

lightx2v/Wan2.2-NVFP4-Sparse

Model

50

stars

18

commits

1

linked in READMEs

Jul 27, 2026

updated

diffusers
NVFP4
Sparse_Attention
video_generation
Wan

README

🎬 LightWan2.2-A14B

An extremely efficient Wan 2.2 14B variant: NVFP4 Quantization-Aware Step Distillation with Sparse Attention for Blackwell Architecture

GitHub HuggingFace Blog

πŸ“‹ Table of Contents

✨ Features

  • ⚑ 4-Step Inference: Two high-noise expert steps followed by two low-noise expert steps, enabling extremely fast Wan2.2 MoE generation on a single Blackwell GPU.
  • 🎯 NVFP4 Quantization: Quantization-aware step distillation reduces memory traffic and compute cost while targeting Blackwell architecture.
  • 🧩 Sparse Attention: Accelerates the costly O(nΒ²) self-attention workload with sparse attention, reducing end-to-end latency for high-resolution video generation.
  • πŸ”§ LightX2V Integration: Recommended runtime stack for stable deployment and best performance.
  • πŸš€ High-Quality Generation: Preserves the visual quality of Wan2.2-T2V/I2V-14B while dramatically improving inference speed.

πŸš€ Quick Start

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 single-GPU inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme.sh

# 3. Run multi-GPU sequence-parallel inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme_sp_parallel.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme_sp_parallel.sh

Option B: Manual Installation

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 single-GPU inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme.sh

# 4. Run multi-GPU sequence-parallel inference
# Text-to-video
bash scripts/wan22/extreme/run_wan22_moe_t2v_extreme_sp_parallel.sh
# Image-to-video
bash scripts/wan22/extreme/run_wan22_moe_i2v_extreme_sp_parallel.sh

Single-GPU Scripts:

Multi-GPU Scripts:

🎬 Generation Results

"Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage"

ResolutionWan2.2-T2V-14BLightWan2.2-A14B
480p
720p

⚑ Performance Comparison

Test Environment: RTX 5090 Single GPU | LightX2V Framework | End-to-End Latency

MethodTaskGPU NumberResolutionNFEE2E LatencySpeedup
Wan2.2-T2V-14BT2V1480p40734.0s1.0x
LightWan2.2-A14BT2V1480p49.1s80.7x
Wan2.2-T2V-14BT2V1720p402668.0s1.0x
LightWan2.2-A14BT2V1720p422.5s118.7x
Wan2.2-I2V-14BI2V1480p40787.0s1.0x
LightWan2.2-A14BI2V1480p410.7s73.9x
Wan2.2-I2V-14BI2V1720p402685.0s1.0x
LightWan2.2-A14BI2V1720p426.7s100.5x

⚠️ Notes

System Requirements

  • Required Hardware: NVIDIA RTX 50-series GPUs or other Blackwell architecture GPUs.
  • Recommended Runtime: lightx2v/lightx2v:26052801-cu130-5090.

Dependencies

  • Prepare Wan2.2 T5 / VAE components following the standard LightX2V Wan2.2 model structure.
  • For I2V, also prepare the required image encoder components and input image according to the LightX2V Wan2.2 I2V script.
  • Use Blackwell + NVFP4 kernels for optimal speed and memory efficiency.

Performance Tips

  • Use the provided extreme inference script for the 4-step high-noise / low-noise expert schedule.
  • Sparse attention is most beneficial at higher resolutions where self-attention dominates latency.
  • Enable CPU offload only when GPU memory is limited, since offload can reduce throughput.

🀝 Community


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.

Contributors

lightx2v

17 commits

mack-williams

1 commits