Model Format and Loading Guide#
π Overview#
LightX2V is a flexible video generation inference framework that supports multiple model sources and formats, providing users with rich options:
β Wan Official Models: Directly compatible with officially released complete models from Wan2.1 and Wan2.2
β Single-File Models: Supports single-file format models released by LightX2V (including quantized versions)
β LoRA Models: Supports loading distilled LoRAs released by LightX2V
This document provides detailed instructions on how to use various model formats, configuration parameters, and best practices.
ποΈ Format 1: Wan Official Models#
Model Repositories#
Model Features#
Official Guarantee: Complete models officially released by Wan-AI with highest quality
Complete Components: Includes all necessary components (DIT, T5, CLIP, VAE)
Original Precision: Uses BF16/FP32 precision with no quantization loss
Strong Compatibility: Fully compatible with Wan official toolchain
Wan2.1 Official Models#
Directory Structure#
Using Wan2.1-I2V-14B-720P as an example:
Wan2.1-I2V-14B-720P/
βββ diffusion_pytorch_model-00001-of-00007.safetensors # DIT model shard 1
βββ diffusion_pytorch_model-00002-of-00007.safetensors # DIT model shard 2
βββ diffusion_pytorch_model-00003-of-00007.safetensors # DIT model shard 3
βββ diffusion_pytorch_model-00004-of-00007.safetensors # DIT model shard 4
βββ diffusion_pytorch_model-00005-of-00007.safetensors # DIT model shard 5
βββ diffusion_pytorch_model-00006-of-00007.safetensors # DIT model shard 6
βββ diffusion_pytorch_model-00007-of-00007.safetensors # DIT model shard 7
βββ diffusion_pytorch_model.safetensors.index.json # Shard index file
βββ models_t5_umt5-xxl-enc-bf16.pth # T5 text encoder
βββ models_clip_open-clip-xlm-roberta-large-vit-huge-14.pth # CLIP encoder
βββ Wan2.1_VAE.pth # VAE encoder/decoder
βββ config.json # Model configuration
βββ xlm-roberta-large/ # CLIP tokenizer
βββ google/ # T5 tokenizer
βββ assets/
βββ examples/
Usage#
# Download model
huggingface-cli download Wan-AI/Wan2.1-I2V-14B-720P \
--local-dir ./models/Wan2.1-I2V-14B-720P
# Configure launch script
model_path=./models/Wan2.1-I2V-14B-720P
lightx2v_path=/path/to/LightX2V
# Run inference
cd LightX2V/scripts
bash wan/run_wan_i2v.sh
Wan2.2 Official Models#
Directory Structure#
Using Wan2.2-I2V-A14B as an example:
Wan2.2-I2V-A14B/
βββ high_noise_model/ # High-noise model directory
β βββ diffusion_pytorch_model-00001-of-00009.safetensors
β βββ diffusion_pytorch_model-00002-of-00009.safetensors
β βββ ...
β βββ diffusion_pytorch_model-00009-of-00009.safetensors
β βββ diffusion_pytorch_model.safetensors.index.json
βββ low_noise_model/ # Low-noise model directory
β βββ diffusion_pytorch_model-00001-of-00009.safetensors
β βββ diffusion_pytorch_model-00002-of-00009.safetensors
β βββ ...
β βββ diffusion_pytorch_model-00009-of-00009.safetensors
β βββ diffusion_pytorch_model.safetensors.index.json
βββ models_t5_umt5-xxl-enc-bf16.pth # T5 text encoder
βββ Wan2.1_VAE.pth # VAE encoder/decoder
βββ configuration.json # Model configuration
βββ google/ # T5 tokenizer
βββ assets/ # Example assets (optional)
βββ examples/ # Example files (optional)
Usage#
# Download model
huggingface-cli download Wan-AI/Wan2.2-I2V-A14B \
--local-dir ./models/Wan2.2-I2V-A14B
# Configure launch script
model_path=./models/Wan2.2-I2V-A14B
lightx2v_path=/path/to/LightX2V
# Run inference
cd LightX2V/scripts
bash wan22/run_wan22_moe_i2v.sh
Available Model List#
Wan2.1 Official Model List#
Wan2.2 Official Model List#
Usage Tips#
π‘ Quantized Model Usage: To use quantized models, refer to the Model Conversion Script for conversion, or directly use pre-converted quantized models in Format 2 below
π‘ Memory Optimization: For devices with RTX 4090 24GB or smaller memory, itβs recommended to combine quantization techniques with CPU offload features:
Quantization Configuration: Refer to Quantization Documentation
CPU Offload: Refer to Parameter Offload Documentation
Wan2.1 Configuration: Refer to offload config files
Wan2.2 Configuration: Refer to wan22 config files with
4090suffix
ποΈ Format 2: LightX2V Single-File Models (Recommended)#
Model Repositories#
Model Features#
Single-File Management: Single safetensors file, easy to manage and deploy
Multi-Precision Support: Provides original precision, FP8, INT8, and other precision versions
Distillation Acceleration: Supports 4-step fast inference
Tool Compatibility: Compatible with ComfyUI and other tools
Examples:
wan2.1_i2v_720p_lightx2v_4step.safetensors- 720P I2V original precisionwan2.1_i2v_720p_scaled_fp8_e4m3_lightx2v_4step.safetensors- 720P I2V FP8 quantizationwan2.1_i2v_480p_int8_lightx2v_4step.safetensors- 480P I2V INT8 quantizationβ¦
Wan2.1 Single-File Models#
Scenario A: Download Single Model File#
Step 1: Select and Download Model
# Create model directory
mkdir -p ./models/wan2.1_i2v_720p
# Download 720P I2V FP8 quantized model
huggingface-cli download lightx2v/Wan2.1-Distill-Models \
--local-dir ./models/wan2.1_i2v_720p \
--include "wan2.1_i2v_720p_lightx2v_4step.safetensors"
Step 2: Manually Organize Other Components
Directory structure as follows:
wan2.1_i2v_720p/
βββ wan2.1_i2v_720p_lightx2v_4step.safetensors # Original precision
βββ t5/clip/vae/config.json/xlm-roberta-large/google and other components # Need manual organization
Step 3: Configure Launch Script
# Set in launch script (point to directory containing model file)
model_path=./models/wan2.1_i2v_720p
lightx2v_path=/path/to/LightX2V
# Run script
cd LightX2V/scripts
bash wan/run_wan_i2v_distill_4step_cfg.sh
π‘ Tip: When thereβs only one model file in the directory, LightX2V will automatically load it.
Scenario B: Download Multiple Model Files#
When you download multiple models with different precisions to the same directory, you need to explicitly specify which model to use in the configuration file.
Step 1: Download Multiple Models
# Create model directory
mkdir -p ./models/wan2.1_i2v_720p_multi
# Download original precision model
huggingface-cli download lightx2v/Wan2.1-Distill-Models \
--local-dir ./models/wan2.1_i2v_720p_multi \
--include "wan2.1_i2v_720p_lightx2v_4step.safetensors"
# Download FP8 quantized model
huggingface-cli download lightx2v/Wan2.1-Distill-Models \
--local-dir ./models/wan2.1_i2v_720p_multi \
--include "wan2.1_i2v_720p_scaled_fp8_e4m3_lightx2v_4step.safetensors"
# Download INT8 quantized model
huggingface-cli download lightx2v/Wan2.1-Distill-Models \
--local-dir ./models/wan2.1_i2v_720p_multi \
--include "wan2.1_i2v_720p_int8_lightx2v_4step.safetensors"
Step 2: Manually Organize Other Components
Directory structure as follows:
wan2.1_i2v_720p_multi/
βββ wan2.1_i2v_720p_lightx2v_4step.safetensors # Original precision
βββ wan2.1_i2v_720p_scaled_fp8_e4m3_lightx2v_4step.safetensors # FP8 quantization
βββ wan2.1_i2v_720p_int8_lightx2v_4step.safetensors # INT8 quantization
βββ t5/clip/vae/config.json/xlm-roberta-large/google and other components # Need manual organization
Step 3: Specify Model in Configuration File
Edit configuration file (e.g., configs/distill/wan_i2v_distill_4step_cfg.json):
{
// Use original precision model
"dit_original_ckpt": "./models/wan2.1_i2v_720p_multi/wan2.1_i2v_720p_lightx2v_4step.safetensors",
// Or use FP8 quantized model
// "dit_quantized_ckpt": "./models/wan2.1_i2v_720p_multi/wan2.1_i2v_720p_scaled_fp8_e4m3_lightx2v_4step.safetensors",
// "dit_quantized": true,
// "dit_quant_scheme": "fp8-vllm",
// Or use INT8 quantized model
// "dit_quantized_ckpt": "./models/wan2.1_i2v_720p_multi/wan2.1_i2v_720p_int8_lightx2v_4step.safetensors",
// "dit_quantized": true,
// "dit_quant_scheme": "int8-vllm",
// Other configurations...
}
Usage Tips#
π‘ Configuration Parameter Description:
dit_original_ckpt: Used to specify the path to original precision models (BF16/FP32/FP16)
dit_quantized_ckpt: Used to specify the path to quantized models (FP8/INT8), must be used with
dit_quantizedanddit_quant_schemeparameters
Step 4: Start Inference
cd LightX2V/scripts
bash wan/run_wan_i2v_distill_4step_cfg.sh
π‘ Tip: Other components (T5, CLIP, VAE, tokenizer, etc.) need to be manually organized into the model directory
Wan2.2 Single-File Models#
Directory Structure Requirements#
When using Wan2.2 single-file models, you need to manually create a specific directory structure:
wan2.2_models/
βββ high_noise_model/ # High-noise model directory (required)
β βββ wan2.2_i2v_A14b_high_noise_lightx2v_4step.safetensors
βββ low_noise_model/ # Low-noise model directory (required)
β βββ wan2.2_i2v_A14b_low_noise_lightx2v_4step.safetensors
βββ t5/clip/vae/config.json/... # Other components (manually organized)
Scenario A: Only One Model File Per Directory#
# Create required subdirectories
mkdir -p ./models/wan2.2_models/high_noise_model
mkdir -p ./models/wan2.2_models/low_noise_model
# Download high-noise model to corresponding directory
huggingface-cli download lightx2v/Wan2.2-Distill-Models \
--local-dir ./models/wan2.2_models/high_noise_model \
--include "wan2.2_i2v_A14b_high_noise_scaled_fp8_e4m3_lightx2v_4step.safetensors"
# Download low-noise model to corresponding directory
huggingface-cli download lightx2v/Wan2.2-Distill-Models \
--local-dir ./models/wan2.2_models/low_noise_model \
--include "wan2.2_i2v_A14b_low_noise_scaled_fp8_e4m3_lightx2v_4step.safetensors"
# Configure launch script (point to parent directory)
model_path=./models/wan2.2_models
lightx2v_path=/path/to/LightX2V
# Run script
cd LightX2V/scripts
bash wan22/run_wan22_moe_i2v_distill.sh
π‘ Tip: When thereβs only one model file in each subdirectory, LightX2V will automatically load it.
Scenario B: Multiple Model Files Per Directory#
When you place multiple models with different precisions in both high_noise_model/ and low_noise_model/ directories, you need to explicitly specify them in the configuration file.
# Create directories
mkdir -p ./models/wan2.2_models_multi/high_noise_model
mkdir -p ./models/wan2.2_models_multi/low_noise_model
# Download multiple versions of high-noise model
huggingface-cli download lightx2v/Wan2.2-Distill-Models \
--local-dir ./models/wan2.2_models_multi/high_noise_model \
--include "wan2.2_i2v_A14b_high_noise_*.safetensors"
# Download multiple versions of low-noise model
huggingface-cli download lightx2v/Wan2.2-Distill-Models \
--local-dir ./models/wan2.2_models_multi/low_noise_model \
--include "wan2.2_i2v_A14b_low_noise_*.safetensors"
Directory Structure:
wan2.2_models_multi/
βββ high_noise_model/
β βββ wan2.2_i2v_A14b_high_noise_lightx2v_4step.safetensors # Original precision
β βββ wan2.2_i2v_A14b_high_noise_fp8_e4m3_lightx2v_4step.safetensors # FP8 quantization
β βββ wan2.2_i2v_A14b_high_noise_int8_lightx2v_4step.safetensors # INT8 quantization
βββ low_noise_model/
β βββ wan2.2_i2v_A14b_low_noise_lightx2v_4step.safetensors # Original precision
β βββ wan2.2_i2v_A14b_low_noise_fp8_e4m3_lightx2v_4step.safetensors # FP8 quantization
β βββ wan2.2_i2v_A14b_low_noise_int8_lightx2v_4step.safetensors # INT8 quantization
βββ t5/vae/config.json/xlm-roberta-large/google and other components # Need manual organization
Configuration File Settings:
{
// Use original precision model
"high_noise_original_ckpt": "./models/wan2.2_models_multi/high_noise_model/wan2.2_i2v_A14b_high_noise_lightx2v_4step.safetensors",
"low_noise_original_ckpt": "./models/wan2.2_models_multi/low_noise_model/wan2.2_i2v_A14b_low_noise_lightx2v_4step.safetensors",
// Or use FP8 quantized model
// "high_noise_quantized_ckpt": "./models/wan2.2_models_multi/high_noise_model/wan2.2_i2v_A14b_high_noise_fp8_e4m3_lightx2v_4step.safetensors",
// "low_noise_quantized_ckpt": "./models/wan2.2_models_multi/low_noise_model/wan2.2_i2v_A14b_low_noise_fp8_e4m3_lightx2v_4step.safetensors",
// "dit_quantized": true,
// "dit_quant_scheme": "fp8-vllm"
// Or use INT8 quantized model
// "high_noise_quantized_ckpt": "./models/wan2.2_models_multi/high_noise_model/wan2.2_i2v_A14b_high_noise_int8_lightx2v_4step.safetensors",
// "low_noise_quantized_ckpt": "./models/wan2.2_models_multi/low_noise_model/wan2.2_i2v_A14b_low_noise_int8_lightx2v_4step.safetensors",
// "dit_quantized": true,
// "dit_quant_scheme": "int8-vllm"
}
Usage Tips#
π‘ Configuration Parameter Description:
high_noise_original_ckpt / low_noise_original_ckpt: Used to specify the path to original precision models (BF16/FP32/FP16)
high_noise_quantized_ckpt / low_noise_quantized_ckpt: Used to specify the path to quantized models (FP8/INT8), must be used with
dit_quantizedanddit_quant_schemeparameters
Available Model List#
Wan2.1 Single-File Model List#
Image-to-Video Models (I2V)
Filename |
Precision |
Description |
|---|---|---|
|
BF16 |
4-step model original precision |
|
FP8 |
4-step model FP8 quantization |
|
INT8 |
4-step model INT8 quantization |
|
FP8 |
4-step model ComfyUI format |
|
BF16 |
4-step model original precision |
|
FP8 |
4-step model FP8 quantization |
|
INT8 |
4-step model INT8 quantization |
|
FP8 |
4-step model ComfyUI format |
Text-to-Video Models (T2V)
Filename |
Precision |
Description |
|---|---|---|
|
BF16 |
4-step model original precision |
|
FP8 |
4-step model FP8 quantization |
|
INT8 |
4-step model INT8 quantization |
|
FP8 |
4-step model ComfyUI format |
Wan2.2 Single-File Model List#
Image-to-Video Models (I2V) - A14B Series
Filename |
Precision |
Description |
|---|---|---|
|
BF16 |
High-noise model - 4-step original precision |
|
FP8 |
High-noise model - 4-step FP8 quantization |
|
INT8 |
High-noise model - 4-step INT8 quantization |
|
BF16 |
Low-noise model - 4-step original precision |
|
FP8 |
Low-noise model - 4-step FP8 quantization |
|
INT8 |
Low-noise model - 4-step INT8 quantization |
π‘ Usage Tips:
Wan2.2 models use a dual-noise architecture, requiring both high-noise and low-noise models to be downloaded
Refer to the βWan2.2 Single-File Modelsβ section above for detailed directory organization
ποΈ Format 3: LightX2V LoRA Models#
LoRA (Low-Rank Adaptation) models provide a lightweight model fine-tuning solution that enables customization for specific effects without modifying the base model.
Model Repositories#
Wan2.1 LoRA Models: lightx2v/Wan2.1-Distill-Loras
Wan2.2 LoRA Models: lightx2v/Wan2.2-Distill-Loras
Usage Methods#
Method 1: Offline Merging#
Merge LoRA weights offline into the base model to generate a new complete model file.
Steps:
Refer to the Model Conversion Documentation for offline merging.
Advantages:
β No need to load LoRA during inference
β Better performance
Disadvantages:
β Requires additional storage space
β Switching different LoRAs requires re-merging
Method 2: Online Loading#
Dynamically load LoRA weights during inference without modifying the base model.
LoRA Application Principle:
# LoRA weight application formula
# lora_scale = (alpha / rank)
# W' = W + lora_scale * B @ A
# Where: B = up_proj (out_features, rank)
# A = down_proj (rank, in_features)
if weights_dict["alpha"] is not None:
lora_scale = weights_dict["alpha"] / lora_down.shape[0]
elif alpha is not None:
lora_scale = alpha / lora_down.shape[0]
else:
lora_scale = 1.0
Configuration Method:
Wan2.1 LoRA Configuration:
{
"lora_configs": [
{
"path": "wan2.1_i2v_lora_rank64_lightx2v_4step.safetensors",
"strength": 1.0,
"alpha": null
}
]
}
Wan2.2 LoRA Configuration:
Since Wan2.2 uses a dual-model architecture (high-noise/low-noise), LoRA needs to be configured separately for both models:
{
"lora_configs": [
{
"name": "low_noise_model",
"path": "wan2.2_i2v_A14b_low_noise_lora_rank64_lightx2v_4step.safetensors",
"strength": 1.0,
"alpha": null
},
{
"name": "high_noise_model",
"path": "wan2.2_i2v_A14b_high_noise_lora_rank64_lightx2v_4step.safetensors",
"strength": 1.0,
"alpha": null
}
]
}
Parameter Description:
Parameter |
Description |
Default |
|---|---|---|
|
LoRA model file path |
Required |
|
LoRA strength coefficient, range [0.0, 1.0] |
1.0 |
|
LoRA scaling factor, uses modelβs built-in value when |
null |
|
(Wan2.2 only) Specifies which model to apply to |
Required |
Advantages:
β Flexible switching between different LoRAs
β Saves storage space
β Can dynamically adjust LoRA strength
Disadvantages:
β Additional loading time during inference
β Slightly increases memory usage