Back to wiki Architecture

Diffusion Transformer

Wan’s generator is a Diffusion Transformer over compressed video latents, trained with flow matching — not a U-Net. Tokens are space–time patches; text arrives through UMT5 cross-attention; the timestep modulates AdaLN.

DiTflow matchingUMT5
On this page 5
DiT video stack: noisy latents, patchify, transformer blocks, unpatch, velocity
Wan2.2 DiT loop. Sequence length is frames × spatial patches, which is why VAE compression dominates VRAM.

Why DiT instead of U-Net

Classic image diffusion used convolutional U-Nets. DiT (Peebles & Xie) replaces the backbone with transformer blocks on patched latents. Video extends the patch grid into time. Wan follows that line (shared with many 2024–2025 video models) so attention can model long-range motion and camera moves.

Flow matching, not epsilon-prediction only

The official code uses flow-matching / rectified-flow style solvers (UniPC, Flow DPM). The network predicts a velocity field from noise to data rather than only ε. Sampling step counts in the README (and ComfyUI templates) assume that scheduler family.

Conditioning

  • Text: UMT5-XXL embeddings, cross-attention in each block.
  • Image (I2V/FLF2V): CLIP-vision + VAE tokens, extra MLP proj (FLF2V adds a first/last positional embedding of 257×2 tokens in Wan2.1).
  • Audio (S2V): a dedicated injection path (see the official S2V audio figure).
  • Timestep / SNR: AdaLN; on A14B this also selects which expert is live.

FAQ

Is Wan an autoregressive video LLM?
No. It is an iterative denoiser on a latent grid. Token time is diffusion time, not left-to-right words.
Where is the U-Net?
There isn’t one in Wan2.2. If a ComfyUI graph shows a UNetLoader, that is a loader name — the weights are still DiT blocks.

Primary sources

Checked against Wan-Video/Wan2.2 README · Aug 28, 2026

© 2026 wan2.video