TL;DR
Diffusion Transformers (DiTs) are highly capable but computationally expensive because they process images and videos using a fixed patch size throughout the entire denoising process. DDiT introduces a training-free, test-time dynamic patch scheduler that automatically adjusts patch sizes based on the denoising timestep and prompt complexity. This simple architectural tweak achieves up to a $3.52\times$ speedup on FLUX-1.Dev and a $3.2\times$ speedup on Wan 2.1 with virtually no loss in perceptual quality.
What Problem Does This Paper Address?
State-of-the-art generative models like FLUX-1.Dev and Wan 2.1 rely heavily on Diffusion Transformers (DiTs). To process an image or video, these models break the input down into a grid of fixed-size patches (tokens).
However, this rigid tokenization introduces a massive computational bottleneck. It treats every stage of generation and every prompt with the exact same level of granularity. In reality, early denoising steps only outline global structures (like layout and rough shapes) and don't require fine-grained tokens. Furthermore, a simple prompt like "a blue sky" shouldn't demand the same computational budget as a highly detailed scene like "a crowd of many zebras." Existing acceleration methods often permanently discard tokens or weights, which can severely degrade image quality.
Methods
DDiT solves this with two core components: a flexible patch-embedding architecture and a dynamic scheduler.
1. Dynamic Patching and Tokenization
Instead of retraining a DiT from scratch to handle multiple patch sizes, the authors add patch-specific embedding and de-embedding layers alongside a Low-Rank Adaptation (LoRA) branch into each transformer block.
During inference, the model can seamlessly switch between the base patch size $p$ and larger, coarser patch sizes ($2p, 4p$). This drastically reduces the total number of tokens ($N$) processed by the attention layers, where computational complexity scales quadratically ($\mathcal{O}(N^2)$).
2. Dynamic Patch Scheduler
To determine the optimal patch size at any given moment without manual tuning, DDiT measures the rate of change of the latent manifold over time. It uses a training-free scheduler based on a third-order finite difference approximation of the latent states:
$$\Delta^{(3)}\mathbf{z}_{t-1} = 2\left(\frac{\Delta\mathbf{z}_{t-1} + \Delta\mathbf{z}_{t+1}}{2} - \Delta\mathbf{z}_t\right)$$
This equation acts as a proxy for the "acceleration" of the generation process. By calculating the spatial variance of this acceleration across patches, the scheduler determines if the model is currently working on smooth, coarse structures (low variance $\rightarrow$ use larger patches) or intricate, fine-grained details (high variance $\rightarrow$ fall back to smaller patches).
Datasets
The authors fine-tuned and evaluated their approach across both image and video modalities:
- Training/Finetuning: The text-to-image (T2I) model was fine-tuned on the T2I-2M synthetic dataset. The text-to-video (T2V) model was trained on synthetic videos generated from the Vchitect-T2V-Dataverse prompt set.
- Evaluation Benchmarks:
- Text-to-Image: Evaluated using COCO (for FID and CLIP scores), DrawBench, and PartiPrompts (for ImageReward and structural similarity via SSIM/LPIPS).
- Text-to-Video: Evaluated using VBench, a comprehensive suite for video generative models.
Key Insights and Ideas
- The Third-Order Advantage: While first- and second-order differences capture short-term temporal noise fluctuations, the third-order finite difference successfully isolates structural shifts in the latent manifold. This allows the model to accurately pinpoint when it transitions from layout planning to detail rendering.
- Content-Aware Allocation: The scheduler naturally adapts to prompt complexity. For simple scenes, it aggressively utilizes larger patches ($4p$) for a majority of the timesteps. For complex scenes, it automatically preserves fine-grained patches ($p$) to protect texture fidelity.
Key Results
DDiT demonstrates excellent Pareto-efficiency, outperforming state-of-the-art caching methods like TeaCache and TaylorSeer at comparable speeds.
- Text-to-Image (FLUX-1.Dev): Standalone DDiT achieves a $2.18\times$ speedup with an FID drop of only 0.35 points. When combined complementarily with TeaCache, it reaches a $3.52\times$ speedup while maintaining high prompt adherence and visual quality.
- Text-to-Video (Wan 2.1): DDiT achieves up to a $3.2\times$ speedup when paired with TeaCache, preserving smooth motion consistency and fine frame details.
A human user study revealed that generations from DDiT were preferred or considered visually on par with the unaccelerated baseline 78% of the time (61% equal quality, 17% DDiT preferred).
Limitations and Future Work
Currently, DDiT applies a uniform patch size across the entire image/video frame at any single timestep. However, images often contain both highly detailed regions (like a person's face) and uniform backgrounds (like an empty sky) simultaneously.
The authors note that a natural and promising direction for future research is to investigate mixed-resolution tokenization within a single timestep, allowing the model to allocate fine patches to complex regions and coarse patches to simple regions simultaneously.
Summary updated