Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

DeepCache: Accelerating Diffusion Models for Free

About

Diffusion models have recently gained unprecedented attention in the field of image synthesis due to their remarkable generative capabilities. Notwithstanding their prowess, these models often incur substantial computational costs, primarily attributed to the sequential denoising process and cumbersome model size. Traditional methods for compressing diffusion models typically involve extensive retraining, presenting cost and feasibility challenges. In this paper, we introduce DeepCache, a novel training-free paradigm that accelerates diffusion models from the perspective of model architecture. DeepCache capitalizes on the inherent temporal redundancy observed in the sequential denoising steps of diffusion models, which caches and retrieves features across adjacent denoising stages, thereby curtailing redundant computations. Utilizing the property of the U-Net, we reuse the high-level features while updating the low-level features in a very cheap way. This innovative strategy, in turn, enables a speedup factor of 2.3$\times$ for Stable Diffusion v1.5 with only a 0.05 decline in CLIP Score, and 4.1$\times$ for LDM-4-G with a slight decrease of 0.22 in FID on ImageNet. Our experiments also demonstrate DeepCache's superiority over existing pruning and distillation methods that necessitate retraining and its compatibility with current sampling techniques. Furthermore, we find that under the same throughput, DeepCache effectively achieves comparable or even marginally improved results with DDIM or PLMS. The code is available at https://github.com/horseee/DeepCache

Xinyin Ma, Gongfan Fang, Xinchao Wang• 2023

Related benchmarks

TaskDatasetResultRank
Class-conditional Image GenerationImageNet 256x256 (train)
IS204.1
305
Text-to-Image GenerationMS-COCO 2014 (val)
FID19.44
128
Text-to-Image GenerationMS-COCO 2017 (val)
FID21.53
80
Text-to-Image GenerationMS-COCO
FID23.45
75
Image GenerationCIFAR-10 32x32
FID4.35
44
Text-to-Image GenerationPartiPrompts
CLIP Score29.46
26
Text-to-Image GenerationFLUX.1-schnell 1.0 (dev)
Latency (s)16.88
23
Image GenerationLSUN Churches 256x256
FID11.31
21
Text-to-Image GenerationMS-COCO 10K prompts 2014 (val)
FID30.38
19
Image GenerationLSUN Bedroom 256x256
FID6.69
11
Showing 10 of 12 rows

Other info

Code

Follow for update