arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.09608cs.CV
收藏

更快的扩散:重新思考编码器在扩散模型推理中的作用

Faster Diffusion: Rethinking the Role of the Encoder for Diffusion Model Inference

Nankai University(南开大学);Computer Vision Center(计算机视觉中心);Universitat Autònoma de Barcelona(巴塞罗那自治大学);Mohamed bin Zayed University of AI(穆罕默德·本·扎耶德人工智能大学);Linkoping University(林雪平大学)

Senmao Li, Taihang Hu, Joost van de Weijer, Fahad Shahbaz Khan, Tao Liu, Linxuan Li, Shiqi Yang, Yaxing Wang, Ming-Ming Cheng, Jian Yang

AI总结:

本文通过分析UNet编码器特征在推理过程中的变化,提出在相邻时间步省略编码器计算并复用特征,使解码器并行计算,结合先验噪声注入方法,在不使用蒸馏技术下显著加速扩散模型采样并保持高质量生成。

摘要:

扩散模型的主要缺点之一是图像生成的推理时间缓慢。在解决这一问题最成功的方法中,蒸馏方法是其中之一。然而,这些方法需要大量的计算资源。在本文中,我们采取了另一种扩散模型加速方法。我们对UNet编码器进行了全面研究,并实证分析了编码器特征。这为理解它们在推理过程中的变化提供了见解。具体而言,我们发现编码器特征变化极小,而解码器特征在不同时间步上表现出显著变化。这一见解促使我们在某些相邻时间步上省略编码器计算,并在多个时间步中重用先前时间步的编码器特征作为解码器的输入。重要的是,这使得我们能够并行执行解码器计算,进一步加速去噪过程。此外,我们引入了一种先验噪声注入方法,以改善生成图像中的纹理细节。除了标准的文本到图像任务外,我们还在其他任务上验证了我们的方法:文本到视频、个性化生成和参考引导生成。在不使用任何知识蒸馏技术的情况下,我们的方法分别将Stable Diffusion (SD)和DeepFloyd-IF模型的采样速度提高了41%和24%,将DiT模型的采样速度提高了34%,同时保持了高质量的生成性能。

英文摘要:

One of the main drawback of diffusion models is the slow inference time for image generation. Among the most successful approaches to addressing this problem are distillation methods. However, these methods require considerable computational resources. In this paper, we take another approach to diffusion model acceleration. We conduct a comprehensive study of the UNet encoder and empirically analyze the encoder features. This provides insights regarding their changes during the inference process. In particular, we find that encoder features change minimally, whereas the decoder features exhibit substantial variations across different time-steps. This insight motivates us to omit encoder computation at certain adjacent time-steps and reuse encoder features of previous time-steps as input to the decoder in multiple time-steps. Importantly, this allows us to perform decoder computation in parallel, further accelerating the denoising process. Additionally, we introduce a prior noise injection method to improve the texture details in the generated image. Besides the standard text-to-image task, we also validate our approach on other tasks: text-to-video, personalized generation and reference-guided generation. Without utilizing any knowledge distillation technique, our approach accelerates both the Stable Diffusion (SD) and DeepFloyd-IF model sampling by 41$\%$ and 24$\%$ respectively, and DiT model sampling by 34$\%$, while maintaining high-quality generation performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑