Diffusion caching is a training-free way to speed up image and video generation by reusing intermediate features from one denoising step in the next. Adjacent steps of a diffusion model change little, so part of the network can be skipped at a small cost in fidelity.
Origins
DeepCache appeared in December 2023. It caches deep U-Net features and recomputes only shallow layers. The paper reports 2.3x on Stable Diffusion with a 0.05 CLIP drop.
FORA and Learning-to-Cache brought the idea to transformers in mid-2024. FORA reuses attention and MLP outputs. Learning-to-Cache trains a small router that picks layers to skip.
How the reuse works
Early methods ran the full model every N steps and reused the cached result in between. Later methods pick steps from a cheap signal.
TeaCache tracks the change in timestep-modulated inputs and recomputes once it passes a threshold, with up to 4.41x claimed. MagCache uses a magnitude law for successive residuals and needs one calibration sample. First Block Cache runs only the first transformer block and compares its residual. TaylorSeer forecasts skipped features with a polynomial instead of copying old ones, reaching 4.99x on FLUX with little loss.
Tools and measured speedups
The Diffusers caching guide puts several methods behind one enable_cache call, with a default threshold of 0.05. On FLUX, ParaAttention cuts wall time from 26.36 s to 13.78 s. That run used threshold 0.12.
ComfyUI-TeaCache and ComfyUI-MagCache add nodes to ComfyUI. Gains stack with quantization.
Trade-offs and the LLM contrast
Higher thresholds skip more steps and blur fine detail or motion. Thresholds are model specific, cached tensors cost memory, and few-step distilled models leave little to skip, as in Wan 2.2 Lightning.
A language model's KV cache is exact by contrast. Reused diffusion features are stale by design, so every skipped step trades a little fidelity for speed.
Sources
- DeepCache paper: origin of cross-step reuse, with its Stable Diffusion numbers.
- TeaCache repository: supported models, and ComfyUI ports.
- Diffusers caching docs: built-in cache configs and notes.