DiT
29 memberslucid.models.generative.ditDiT — the diffusion model that replaced the U-Net with a transformer.
Peebles and Xie, ICCV 2023 (arXiv:2212.09748). Latent patches through a plain Vision Transformer, conditioned by adaLN-Zero, and the finding that FID tracks the backbone's Gflops rather than its parameter count.
Peebles, William, and Saining Xie. "Scalable Diffusion Models with Transformers." Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023, pp. 4195-4205.
A diffusion model needs a network that maps a noised latent and a timestep to a prediction of the noise. Nothing about that job requires convolutions, and DiT tests the claim directly: patchify the latent into a sequence, run a standard Vision Transformer over it, and decode back.
The decoder emits twice the input channels because the model predicts a noise and a diagonal covariance, following ADM's parameterisation of .
Where the conditioning enters is the finding. The paper compares four ways of admitting the timestep and class label and they are not close. In-context conditioning appends them as tokens; cross attention gives them their own attention layer at about 15% more compute; adaptive layer norm regresses a per-channel shift and scale from their sum; and adaLN-Zero adds a third regressed vector, a gate applied immediately before each residual add:
Initialising the projection that produces at zero makes every block the identity at step zero. That single change roughly halves the FID of the in-context variant at 400K steps, and it is the cheapest of the four in Gflops.
Scale is the other finding. Across twelve models — four widths crossed with three patch sizes — FID correlates with the backbone's Gflops at , and parameter count is not the predictor: holding parameters fixed while shrinking the patch improves FID substantially, because more tokens mean more compute. Sampling compute does not substitute for it; a small model given eight times the sampling steps still loses to a large one.
Classes
Functions
dit_base_2→ DiTModelDiT-B/2 — the B backbone at patch 2.
dit_base_2_gen→ DiTForImageGenerationdit_base_2 posed as a diffusion sampler.
dit_base_4→ DiTModelDiT-B/4 — the B backbone at patch 4.
dit_base_4_gen→ DiTForImageGenerationdit_base_4 posed as a diffusion sampler.
dit_base_8→ DiTModelDiT-B/8 — the B backbone at patch 8.
dit_base_8_gen→ DiTForImageGenerationdit_base_8 posed as a diffusion sampler.
dit_large_2→ DiTModelDiT-L/2 — the L backbone at patch 2.
dit_large_2_gen→ DiTForImageGenerationdit_large_2 posed as a diffusion sampler.
dit_large_4→ DiTModelDiT-L/4 — the L backbone at patch 4.
dit_large_4_gen→ DiTForImageGenerationdit_large_4 posed as a diffusion sampler.
dit_large_8→ DiTModelDiT-L/8 — the L backbone at patch 8.
dit_large_8_gen→ DiTForImageGenerationdit_large_8 posed as a diffusion sampler.
dit_small_2→ DiTModelDiT-S/2 — the S backbone at patch 2.
dit_small_2_gen→ DiTForImageGenerationdit_small_2 posed as a diffusion sampler.
dit_small_4→ DiTModelDiT-S/4 — the S backbone at patch 4.
dit_small_4_gen→ DiTForImageGenerationdit_small_4 posed as a diffusion sampler.
dit_small_8→ DiTModelDiT-S/8 — the S backbone at patch 8.
dit_small_8_gen→ DiTForImageGenerationdit_small_8 posed as a diffusion sampler.
dit_xlarge_2→ DiTModelDiT-XL/2 — the XL backbone at patch 2.
dit_xlarge_2_gen→ DiTForImageGenerationdit_xlarge_2 posed as a diffusion sampler.
dit_xlarge_4→ DiTModelDiT-XL/4 — the XL backbone at patch 4.
dit_xlarge_4_gen→ DiTForImageGenerationdit_xlarge_4 posed as a diffusion sampler.
dit_xlarge_8→ DiTModelDiT-XL/8 — the XL backbone at patch 8.
dit_xlarge_8_gen→ DiTForImageGenerationdit_xlarge_8 posed as a diffusion sampler.