Fine-Grained Caching for Diffusion Transformers with Few Calibration Conditions
Organizations: Peking University
Abstract
Diffusion transformers require repeated denoiser evaluations, making image and video generation computationally expensive. We propose a training-free framework that uses a few calibration conditions to construct a fixed, fine-grained module-reuse schedule without schedule search. The design is motivated by an empirical effect along deterministic sampling trajectories: with initial noise fixed, condition-dependent deviations in several module outputs evolve similarly across adjacent steps, so temporal differencing attenuates much of their variation. We term this effect Conditional Common-Mode Rejection (CCMR). Motivated by this observation, we rank timestep--layer--module locations using normalized ratios of consecutive feature displacements and construct a Cache Book through two-stage calibration. The second stage updates a scorer-only reference with each provisional bit after recording its indexed score, while retaining full-compute trajectories. At inference, the fixed schedule requires no per-input policy estimation and can be nested within fixed step-wise cache policies. Module caching alone achieves -- speedup on the evaluated image models and -- on the video models. Combining it with MagCache or SeaCache provides further acceleration at a model-dependent cost in paired fidelity.
Figures & tables
| Method (configuration) | Time (s) | Speed | TFLOPs | FID | IS | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|---|---|
| Full | 1.325 | 1.00 | 104.90 | 18.70 | 449.12 | – | – | – |
| ToCa ( ; 512 adaptation) | 1.006 | 1.32 | 51.43 | 14.46 | 382.53 | 15.50 | 0.522 | 0.510 |
| ToCa ( ; 512 adaptation) | 0.977 | 1.36 | 47.08 | 15.80 | 240.05 | 14.41 | 0.418 | 0.616 |
| Ours ( ) | 0.771 | 1.72 | 51.61 | 14.16 | 351.24 | 19.10 | 0.658 | 0.323 |
| Method (configuration) | Efficiency | VBench (%) | Paired fidelity | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Time (s) | Speed | PFLOPs | Subj | Back | Mot | Dyn | Aes | Img | PSNR | SSIM | LPIPS | |
| Wan2.1-T2V-1.3B ( , 81 frames, 50 steps) | ||||||||||||
| Full | 114.91 | 1.00 | 28.320 | 97.3 | 97.7 | 98.8 | 31.2 | 64.0 | 71.3 | – | – | – |
| Ours ( ) | 68.39 | 1.68 | 17.030 | 96.1 | 96.3 | 98.8 | 15.6 | 57.9 | 66.5 | 15.66 | 0.539 | 0.416 |
| MagCache ( ) | 83.79 | 1.37 | 12.463 | 97.3 | 97.8 | 98.8 | 28.1 | 64.2 | 71.6 | 25.64 | 0.875 | 0.073 |
| MagCache + Ours ( ) | 57.30 | 2.01 | 11.484 | 96.9 | 97.7 | 98.8 | 31.2 | 63.8 | 71.0 | 19.90 | 0.720 | 0.183 |
| Priority score | Reuse (%) | Time (s) | PFLOPs | CLIP | IR | LPIPS |
|---|---|---|---|---|---|---|
| Full | 0 | 7.018 | 2.083 | 0.728 | 1.136 | – |
| Ours | 26.21 | 4.905 | 1.582 | 0.712 | 1.182 | 0.412 |
| Adjacent MSE | 28.36 | 4.774 | 1.547 | 0.720 | 0.567 | 0.536 |
| Adjacent cosine distance | 28.46 | 4.742 | 1.543 | 0.703 | 0.839 | 0.499 |
Appendix figures & tables43 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Time (s) | Speed | FLOPs (T) | FLOPs | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|---|
| Full | 0.662 | 52.452 | – | – | – | ||
| ToCa ( ) | 0.521 | 22.474 | 18.204 | 0.622 | 0.390 | ||
| Ours | 0.399 | 27.942 | 14.529 | 0.385 | 0.615 |
| Model / method | Time (s) | Speed | FLOPs (P) | Subj | Back | Mot | Dyn | Aes | Img | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Wan2.1 / Full | 68.960 | 16.994 | 97.6 | 97.8 | 99.2 | 25.0 | 61.9 | 70.0 | – | – | – | |
| Wan2.1 / Ours | 49.912 | 10.626 | 92.8 | 94.0 | 99.0 | 12.5 | 53.9 | 58.4 | 15.888 | 0.549 | 0.507 | |
| HunyuanVideo / Full | 1145.015 | 379.482 | 92.6 | 92.7 | 99.1 | 100.0 | 54.4 | 70.9 | – | – | – | |
| HunyuanVideo / Ours | 772.067 | 241.085 | 93.1 | 93.0 | 99.3 | 75.0 | 43.2 | 53.8 | 14.817 | 0.398 | 0.555 |
| Model | Steps | |||
|---|---|---|---|---|
| DiT-XL/2 | 50 | 2 | 1 | |
| FLUX.1-dev | 28 | 2 | 2 | |
| Wan2.1 | 50 | 2 | 1 | |
| HunyuanVideo-1.5 | 50 | 2 | 1 |
| Model | Reported speedup | ||
|---|---|---|---|
| DiT-XL/2 ( ) | 5 | ||
| DiT-XL/2 ( ) | 8 | ||
| FLUX.1-dev ( ) | 6 |
| Model | MagCache | SeaCache |
|---|---|---|
| FLUX.1-dev | ||
| Wan2.1 | ||
| HunyuanVideo-1.5 |
| Model | Step-wise policy | Hybrid |
|---|---|---|
| FLUX.1-dev | MagCache | |
| FLUX.1-dev | SeaCache | |
| Wan2.1 | MagCache | |
| Wan2.1 | SeaCache | |
| HunyuanVideo-1.5 | MagCache | |
| HunyuanVideo-1.5 | SeaCache |
| Model | Module family | Median | Central 90% interval | |
|---|---|---|---|---|
| DiT-XL/2 | Self-attention | 107,520 | 1.021 | |
| MLP | 107,520 | 1.030 | ||
| FLUX.1-dev | Double-stream image attention | 17,784 | 1.010 | |
| Double-stream context attention | 17,784 | 1.020 | ||
| Double-stream image FFN | 17,784 | 1.020 | ||
| Double-stream context FFN | 17,784 | 1.031 |
| Method | Time (s) | Speedup | FLOPs (P) | Attn. reuse |
|---|---|---|---|---|
| Distilled Full | 2.097 | 0.595 | 0% | |
| Distilled Full + Ours | 1.835 | 0.539 | 22.81% |
| Method | CLIPScore | ImageReward | LPIPS |
|---|---|---|---|
| Distilled Full | 0.67519 | 1.18344 | — |
| Distilled Full + Ours | 0.67549 | 1.18203 | 0.1475 |
| Method | Time (s) | Speedup | FLOPs (P) | Joint attn. reuse |
|---|---|---|---|---|
| Distilled Full | 66.58 | 17.491 | 0/648 | |
| Distilled Full + Ours | 52.17 | 13.655 | 163/648 |
| Method | Subject | Background | Motion | Dynamic | Aesthetic | Imaging |
|---|---|---|---|---|---|---|
| Distilled Full | 0.9725 | 0.9742 | 0.9953 | 0.0000 | 0.6811 | 0.6993 |
| Distilled Full + Ours | 0.9721 | 0.9735 | 0.9952 | 0.0000 | 0.6811 | 0.6982 |
| Method | Time (s) | Speedup | FLOPs | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|
| DiT-XL/2 (64 images, , 50 steps) | ||||||
| Full | 1.344 | 104.904 T | — | — | — | |
| Direct reuse | 0.794 | 51.611 T | 19.644 | 0.7208 | 0.3124 | |
| Two-point extrapolation | 1.002 | 51.611 T | 17.333 | 0.6152 | 0.4368 | |
| FLUX.1-dev (64 images, , 28 steps) | ||||||
| Full | 7.076 | 2.083 P | — | — | — | |
| Model | PSNR (dB) [95% CI] | LPIPS [95% CI] |
|---|---|---|
| DiT-XL/2 | ||
| FLUX.1-dev | ||
| Wan2.1-T2V-1.3B | ||
| HunyuanVideo-1.5 |
| Model | Extrapolation sites | Element-wise ops (T) | Peak history (GiB) |
|---|---|---|---|
| DiT-XL/2 | 1,423 | 0.010072 | 0.984 |
| FLUX.1-dev | 1,254 | 0.039547 | 12.023 |
| Wan2.1-T2V-1.3B | 2,850 | 0.430231 | 33.742 |
| HunyuanVideo-1.5 | 2,617 | 1.673437 | 181.559 |
| FLUX.1-dev | Wan2.1-T2V-1.3B | |||||||
|---|---|---|---|---|---|---|---|---|
| Selection rule | Reuse | FLOPs | PSNR | LPIPS | Reuse | FLOPs | PSNR | LPIPS |
| Original score, family quantiles | 26.83% | 1.568 | 15.51 | 0.4079 | 31.69% | 17.007 | 14.34 | 0.5464 |
| Random selection | 26.83% | 1.568 | 15.81 | 0.5589 | 31.69% | 17.007 | 13.03 | 0.7510 |
| Relative displacement | 26.83% | 1.568 | 11.77 | 0.8641 | 31.69% | 17.007 | 15.80 | 0.4746 |
| Backward ratio | 26.83% | 1.568 | 15.07 | 0.4347 | 31.69% | 17.007 | 14.06 | 0.5512 |
| Original score, global quantile | 26.83% | 1.655 | 18.04 | 0.2854 | 31.69% | 19.936 | 15.08 | 0.4530 |
| (a) Batch size 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
| Method | Time (s) | Speedup | TFLOPs | FID-5K | IS | PSNR | SSIM | LPIPS |
| Full | 1.2916 | 104.90 | 18.70 | 449.12 | — | — | — | |
| Ours | 0.7681 | 51.61 | 14.16 | 351.24 | 19.64 | 0.7208 | 0.3124 | |
| DiTFastAttn | 1.2861 | 98.29 | 17.22 | 441.64 | 22.00 | 0.8123 | 0.2007 | |
| Efficiency | Distribution and prompt metrics | Paired fidelity | |||||||||
| Method (configuration) | Full | Time | Speedup | FLOPs | FID | IS | CLIP | IR | PSNR | SSIM | LPIPS |
| Full | 7.076 | 7.076 | 2.083 | 20.02 | 26.59 | 0.7161 | 1.0536 | — | — | — | |
| Ours ( , ) | 7.076 | 4.943 | 1.582 | 22.52 | 25.79 | 0.7086 | 1.0522 | 16.44 | 0.6752 | 0.4169 | |
| TeaCache-Fast ( ) | 7.101 | 2.664 | 0.744 | 19.88 | 25.99 | 0.7188 | 1.0840 | 18.26 | 0.7243 | 0.3246 | |
| TeaCache-Faster ( ) | 6.781 | 2.158 | 0.626 | 20.77 | 25.64 | 0.7214 | 0.9185 | 17.49 | 0.6960 | 0.3798 | |
| SeaCache ( ) | 7.108 | 4.183 | 1.202 | 20.28 | 27.05 | 0.7196 | 1.0713 | 28.89 | 0.9279 | 0.0607 | |
| Method | Full (s) | Time (s) | Speedup | PFLOPs | PSNR | SSIM | LPIPS |
|---|---|---|---|---|---|---|---|
| Full | 111.569 | 111.569 | 28.323 | — | — | — | |
| Ours | 111.569 | 76.651 | 17.032 | 15.66 | 0.5386 | 0.4158 | |
| TeaCache-Fast | 108.079 | 60.848 | 14.162 | 21.65 | 0.7762 | 0.1350 | |
| TeaCache-Faster | 107.725 | 52.462 | 11.897 | 21.11 | 0.7624 | 0.1513 | |
| SeaCache | 107.120 | 56.962 | 13.596 | 30.02 | 0.9307 | 0.0387 | |
| SeaCache + Ours | 107.120 | 56.493 | 12.438 | 19.90 | 0.7228 | 0.1799 |
| Method | Subject | Background | Motion | Dynamic | Aesthetic | Imaging |
|---|---|---|---|---|---|---|
| Full | 97.28 | 97.70 | 98.83 | 31.25 | 63.97 | 71.34 |
| Ours | 96.09 | 96.33 | 98.76 | 15.62 | 57.89 | 66.50 |
| TeaCache-Fast | 97.19 | 97.73 | 98.84 | 31.25 | 64.67 | 71.22 |
| TeaCache-Faster | 97.10 | 97.82 | 98.83 | 28.12 | 63.95 | 71.17 |
| SeaCache | 97.33 | 97.76 | 98.82 | 28.12 | 63.80 | 71.51 |
| SeaCache + Ours | 97.05 | 97.74 | 98.81 | 31.25 | 64.54 | 71.39 |
| Method | Time (s) | Speedup | FLOPs (P) | PSNR | SSIM | LPIPS | Temp. |
|---|---|---|---|---|---|---|---|
| Native | |||||||
| Full | 109.024 | 28.323 | — | — | — | — | |
| Ours | 69.609 | 17.032 | 15.663 | 0.5388 | 0.4163 | 0.0208 | |
| MagCache | |||||||
| MagCache | 51.544 | 11.897 | 25.522 | 0.8703 | 0.0768 | 0.0034 | |
| MagCache + Ours | 48.425 | 10.937 | 19.679 | 0.7099 | 0.1968 | 0.0057 | |
| Method | Subject | Background | Motion | Dynamic | Aesthetic | Imaging |
|---|---|---|---|---|---|---|
| Native | ||||||
| Full | 97.28 | 97.78 | 98.86 | 31.25 | 64.38 | 71.15 |
| Ours | 95.96 | 96.24 | 98.77 | 15.62 | 57.97 | 65.99 |
| MagCache | ||||||
| MagCache | 97.31 | 97.89 | 98.84 | 31.25 | 64.09 | 71.21 |
| MagCache + Ours | 97.01 | 97.76 | 98.82 | 31.25 | 63.44 | 71.08 |
| Stage / contrast | LPIPS | PSNR | SSIM | Temp. |
|---|---|---|---|---|
| DiT-XL/2 | ||||
| Stage I vs. Full | 0.3187 | 18.76 | 0.6553 | — |
| Stage II vs. Full | 0.3212 | 19.12 | 0.6586 | — |
| — | ||||
| 95% CI | — | |||
| FLUX.1-dev | ||||
| Model | Book | Reuse (%) | FLOPs |
|---|---|---|---|
| DiT-XL/2 | Stage I | 50.86 | 51.579 T |
| Stage II | 50.82 | 51.611 T | |
| FLUX.1-dev | Stage I | 26.83 | 1.568 P |
| Stage II | 26.21 | 1.582 P | |
| Wan2.1-T2V-1.3B | Stage I | 31.73 | 16.999 P |
| Stage II | 31.67 | 17.032 P |
| Model | Condition | FID-5K | LPIPS | Reuse |
|---|---|---|---|---|
| DiT-XL/2 | 14.23 | 0.2928 | 50.82% | |
| 15.78 | 0.2393 | 50.86% | ||
| 15.93 | 0.2599 | 50.82% | ||
| 15.81 | 0.2767 | 50.82% | ||
| 13.65 | 0.3998 | 50.82% | ||
| FLUX.1-dev | 20.53 | 0.3674 | 26.45% |
| Model | LPIPS (mean [min, max]) | FID-5K (mean [min, max]) |
|---|---|---|
| DiT-XL/2 | 0.2937 [0.2393, 0.3998] | 15.08 [13.65, 15.93] |
| FLUX.1-dev | 0.3856 [0.3601, 0.4159] | 20.49 [19.35, 21.18] |
| Wan2.1-T2V-1.3B | 0.5490 [0.4238, 0.7030] | — |
| Model | Conditions | FID-5K | LPIPS | Reuse | |
|---|---|---|---|---|---|
| DiT-XL/2 | 1 | 14.23 | 0.2928 | 50.82% | |
| 2 | – | 15.09 | 0.2673 | 50.82% | |
| 4 | – | 15.27 | 0.2558 | 50.82% | |
| 8 | – | 15.77 | 0.2503 | 50.82% | |
| FLUX.1-dev | 1 | 20.53 | 0.3674 | 26.45% | |
| 2 | – | 22.51 | 0.4072 | 26.21% |
| Conditions | Subject | Background | Motion | Dynamic | Aesthetic | Imaging | |
|---|---|---|---|---|---|---|---|
| 1 | 94.12 | 95.84 | 98.75 | 25.00 | 53.83 | 68.69 | |
| 1 | 94.88 | 95.11 | 98.64 | 12.50 | 52.41 | 62.49 | |
| 1 | 89.16 | 92.51 | 98.63 | 25.00 | 42.78 | 51.37 | |
| 1 | 91.69 | 93.00 | 98.50 | 25.00 | 52.02 | 62.97 | |
| 1 | 93.10 | 94.19 | 98.85 | 12.50 | 48.11 | 65.15 | |
| 2 | – | 95.44 | 95.89 | 98.72 | 25.00 | 52.11 | 66.89 |
| Method | Wan2.1 | HunyuanVideo-1.5 |
|---|---|---|
| Ours | 0.0210 | 0.0240 |
| MagCache ( ) | 0.0032 | 0.0049 |
| MagCache + Ours ( ) | 0.0054 | 0.0133 |
| SeaCache ( ) | 0.0029 | 0.0070 |
| SeaCache + Ours ( ) | 0.0055 | 0.0127 |
| Model | Metric | Stage I | Stage II | [95% CI] |
|---|---|---|---|---|
| FLUX.1-dev | CLIPScore | 0.7092 | 0.7122 | [ , ] |
| FLUX.1-dev | ImageReward | 1.0815 | 1.1824 | [ , ] |
| DiT-XL/2 | Class CLIPScore | 0.6307 | 0.6332 | [ , ] |
Diffusion Model Caching
Diffusion model caching reuses features, activations, or attention states across denoising steps to reduce inference cost while preserving output quality.
See all 135 papers