Diffusion Transformer Block
A transformer-style block that updates noisy image or latent patch tokens during diffusion denoising, steered by timestep and optional conditioning signals.
A Diffusion Transformer block is one transformer-style layer inside a Diffusion Transformer denoiser. It reads noisy image or latent patch tokens, mixes them with self-attention, refines them with a feed-forward path, and uses timestep and optional conditioning signals to steer each update toward a cleaner sample.
At a glance
Released
December 2022
Authors
William Peebles, Saining Xie
Optimizes
- Global Patch Interaction
- Timestep Conditioned Denoising
- Latent Patch Modeling
What It Is
A Diffusion Transformer block is a single transformer-style layer used inside a Diffusion Transformer denoiser. The block treats noisy image patches or latent patches as token-like states. Each block reads those patch states, lets them interact through self-attention, refines them through a feed-forward path, and returns updated states that the surrounding denoiser can use on the next diffusion step.Why It Exists
Convolutional denoisers mix information through local neighborhoods, which can make long-range patch relationships expensive to model. A Diffusion Transformer block uses self-attention so any patch can directly influence any other patch in the same layer. That global mixing helps a denoiser coordinate structure, layout, and fine detail across the whole image or latent field without stacking very deep local receptive fields.How It Works
Noisy patch or latent tokens enter the block together with a timestep signal that says how noisy the sample still is. The timestep is embedded and used to modulate normalization or scaling inside the block so the same weights can behave differently at early versus late denoising steps. Optional class or text conditioning can enter through a separate embedding that is added or fused into the same modulation path. Self-attention then mixes information across all patch tokens, and a feed-forward network refines each token state. Residual connections carry the previous token values forward, and the block outputs updated patch states for the denoising head or the next repeated block in the stack.Diffusion Transformer block compute flow
Noisy patch or latent tokensNormalization modulated by c_t and cSelf-attention over patchesFeed-forward refinementUpdated patch states for denoisingTimestep embedding c_tOptional class or text conditioning cTimestep and conditioning steer the block; they are not ordinary image tokensNoisy patch or latent tokens to Normalization modulated by c_t and cTimestep embedding c_t to Normalization modulated by c_t and cOptional class or text conditioning c to Normalization modulated by c_t and cNormalization modulated by c_t and c to Self-attention over patchesSelf-attention over patches to Feed-forward refinementFeed-forward refinement to Updated patch states for denoisingNoisy patch or latent tokens to Self-attention over patchesSelf-attention over patches to Updated patch states for denoising
Patch token computation path
Timestep and conditioning steering
Residual connection
Conditioning input
Conditioning role note
Math Or Compute Schema
A generic transformer block updates token states from the previous layer output alone. A Diffusion Transformer block keeps that attention and feed-forward shape but injects timestep and optional conditioning into the modulation path before each sublayer runs.- Input token states for the block.
- Output token states after attention, feed-forward, and residuals.
- Normalization applied before each sublayer.
- Self-attention sublayer over tokens.
- Feed-forward sublayer applied per token.
- Noisy patch or latent token states at the current diffusion step.
- Timestep embedding for the current noise level.
- Optional class, text, or other conditioning embedding.
- Normalization applied before each sublayer.
- Modulation path that combines normalization with timestep and conditioning.
- Self-attention sublayer over patch tokens.
- Feed-forward sublayer applied after attention in the full block.
Compared To Nearby Modules
A generic transformer block updates token states for language, vision, or other tasks without a diffusion timestep. A Diffusion Transformer block is the denoising-specific variant: it runs on noisy patch tokens and uses timestep and optional conditioning to steer each update. A complete diffusion model stacks many such blocks, adds patch embedding, timestep embedding, and a denoising output head, and repeats the stack across iterative denoising steps. The diffusion training objective is separate: it defines how the full model learns from noisy targets, while this page focuses on what one block does inside that denoiser during inference or training forward passes.| Comparison dimension | Generic transformer block | Diffusion Transformer block | Complete diffusion denoiser |
|---|---|---|---|
| What enters the block | Ordinary token or patch embeddings from the previous layer | Noisy image or latent patch tokens at the current diffusion step | Patch embedding, timestep embedding, and optional conditioning for the whole stack |
| Timestep and conditioning role | No diffusion timestep; task context comes from embeddings or cross-attention elsewhere | Timestep embedding modulates normalization or scaling; optional class or text conditioning steers the same path | Global diffusion state and conditioning shared across all blocks and denoising iterations |
| What the block output supports | Updated hidden states for the next layer or task head | Updated patch states for the denoising head or the next repeated block | Noise or velocity prediction used by the sampler to produce a cleaner sample over many steps |