Skip to main content

1. Model Introduction

Wan2.2 extends the Wan family with timestep-specialized Mixture-of-Experts models and a unified 5B TI2V checkpoint. It targets cinematic composition, lighting, and complex motion while supporting text-to-video, image-to-video, and hybrid text/image conditioning. Choose the A14B MoE checkpoints for maximum T2V or I2V capacity and the 5B TI2V model for a smaller unified 720p-at-24-fps path. MoE reduces active compute relative to total capacity but does not remove the memory cost of loading expert weights, so hardware selection still matters.
The Wan2.2 TI2V 5B checkpoint currently has known quality issues when it is used for image-to-video generation. Use Wan-AI/Wan2.2-I2V-A14B-Diffusers when I2V quality is the priority.

2. SGLang-diffusion Installation

SGLang-diffusion offers multiple installation methods. You can choose the most suitable installation method based on your hardware platform and requirements. Please refer to the official SGLang-diffusion installation guide for installation instructions.

3. Model Deployment

This section provides deployment configurations optimized for different hardware platforms and use cases.

3.1 Basic Configuration

The Wan2.2 series offers models in various sizes, architectures and input types, optimized for different hardware platforms. The recommended launch configurations vary by hardware and model size. Interactive Command Generator: Use the configuration selector below to automatically generate the appropriate deployment command for your hardware platform, model size. SGLang supports serving Wan2.2 on NVIDIA B200, H200, AMD MI300X, MI325X, MI355X GPUs and Ascend A2/A3 Series NPUs.

3.2 Configuration Tips

See Performance Optimization for acceleration features and their runtime requirements.
  • --vae-path: Path to a custom VAE model or HuggingFace model ID (e.g., fal/FLUX.2-Tiny-AutoEncoder). If not specified, the VAE will be loaded from the main model path.
  • --num-gpus {NUM_GPUS}: Number of GPUs to use
  • --tp-size {TP_SIZE}: Tensor parallelism size (only for the encoder; should not be larger than 1 if text encoder offload is enabled, as layer-wise offload plus prefetch is faster)
  • --sp-degree {SP_SIZE}: Sequence parallelism size (typically should match the number of GPUs)
  • --ulysses-degree {ULYSSES_DEGREE}: The degree of DeepSpeed-Ulysses-style SP in USP
  • --ring-degree {RING_DEGREE}: The degree of ring attention-style SP in USP

4. Model Invocation

4.1 Basic Usage

For more API usage and request examples, please refer to: SGLang Diffusion OpenAI API

4.1.1 Launch a server and then send requests

Command

4.1.2 Generate a video without launching a server

Command

4.2 Advanced Usage

4.2.1 Cache-DiT Acceleration

SGLang integrates Cache-DiT, a caching acceleration engine for Diffusion Transformers (DiT), to achieve up to 7.4x inference speedup with minimal quality loss. You can set SGLANG_CACHE_DIT_ENABLED=True to enable it. For more details, please refer to the SGLang Cache-DiT documentation. Basic Usage
Command
Advanced Usage
  • DBCache Parameters: DBCache controls block-level caching behavior:
ParameterEnv VariableDefaultDescription
FnSGLANG_CACHE_DIT_FN1Number of first blocks to always compute
BnSGLANG_CACHE_DIT_BN0Number of last blocks to always compute
WSGLANG_CACHE_DIT_WARMUP4Warmup steps before caching starts
RSGLANG_CACHE_DIT_RDT0.24Residual difference threshold
MCSGLANG_CACHE_DIT_MC3Maximum continuous cached steps
  • TaylorSeer Configuration: TaylorSeer improves caching accuracy using Taylor expansion:
ParameterEnv VariableDefaultDescription
EnableSGLANG_CACHE_DIT_TAYLORSEERfalseEnable TaylorSeer calibrator
OrderSGLANG_CACHE_DIT_TS_ORDER1Taylor expansion order (1 or 2)
Combined Configuration Example:
Command

4.2.2 GPU Optimization

  • --dit-cpu-offload: Use CPU offload for DiT inference. Enable if run out of memory with FSDP.
  • --text-encoder-cpu-offload: Use CPU offload for text encoder inference. Enable if run out of memory with FSDP.
  • --image-encoder-cpu-offload: Use CPU offload for image encoder inference. Enable if run out of memory with FSDP.
  • --vae-cpu-offload: Use CPU offload for VAE. Enable if run out of memory.
  • --pin-cpu-memory: Pin memory for CPU offload. Only added as a temp workaround if it throws “CUDA error: invalid argument”.

4.2.3 Supported LoRA Registry

origin modelsupported LoRA
Wan-AI/Wan2.2-I2V-A14B-Diffuserslightx2v/Wan2.2-Distill-Loras
Wan-AI/Wan2.2-T2V-A14B-DiffusersCseti/wan2.2-14B-Arcane_Jinx-lora-v1
Example:
Command

5. Benchmark

Test Environment:
  • Hardware: NVIDIA B200 GPU (1x)
  • Model: Wan-AI/Wan2.2-T2V-A14B-Diffusers
  • sglang diffusion version: 0.5.6.post2

5.1 Speedup Benchmark

5.1.1 Generate a video

Server Command:
Command
Benchmark Command:
Command
Result:
Output

5.1.2 Generate videos with high concurrency

Server Command:
Command
Benchmark Command:
Command
Result:
Output