Token Pruning for Caching Better: 9 Times Acceleration on Stable Diffusion for Free

Evelyn Zhang, Bang Xiao, Jiayi Tang, Qianli Ma, Chang Zou +3 more
12/31/2024
cs.CVcs.LG

No official code found. Best implementation: EvelynZhang-epiclab/DaTo (10 stars, last commit 2025-12-28).

Abstract

Stable Diffusion has achieved remarkable success in the field of text-to-image generation, with its powerful generative capabilities and diverse generation results making a lasting impact. However, its iterative denoising introduces high computational costs and slows generation speed, limiting broader adoption. The community has made numerous efforts to reduce this computational burden, with methods like feature caching attracting attention due to their effectiveness and simplicity. Nonetheless, simply reusing features computed at previous timesteps causes the features across adjacent timesteps to become similar, reducing the dynamics of features over time and ultimately compromising the quality of generated images. In this paper, we introduce a dynamics-aware token pruning (DaTo) approach that addresses the limitations of feature caching. DaTo selectively prunes tokens with lower dynamics, allowing only high-dynamic tokens to participate in self-attention layers, thereby extending feature dynamics across timesteps. DaTo combines feature caching with token pruning in a training-free manner, achieving both temporal and token-wise information reuse. Applied to Stable Diffusion on the ImageNet, our approach delivered a 9$\times$ speedup while reducing FID by 0.33, indicating enhanced image quality. On the COCO-30k, we observed a 7$\times$ acceleration coupled with a notable FID reduction of 2.17.

View on arXivView PDF

Code Implementations(1)

The offical code for DaTo

100Shell, PythonDec 31, 20249 months ago

Similar Papers

Cite this paper

@article{zhang2024token,
  title  = {Token Pruning for Caching Better: 9 Times Acceleration on Stable Diffusion for Free},
  author = {Evelyn Zhang and Bang Xiao and Jiayi Tang and Qianli Ma and Chang Zou and Xuefei Ning and Xuming Hu and Linfeng Zhang},
  year   = {2024},
  eprint = {2501.00375},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.00375v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.00375.svg)](https://codeofpaper.com/paper/2501.00375)

Discussion