TensorX
返回文献探索

Paper · arXiv 2404.02747

Cross-Attention Makes Inference Cumbersome in Text-to-Image Diffusion Models

Wentian Zhang, Haozhe Liu, Jinheng Xie, Francesco Faccio, Mike Zheng Shou, Jürgen Schmidhuber

12 upvotesApril 3, 2024arXiv 预印本
AI 摘要

Cross-attention in text-conditional diffusion models divides inference into semantics-planning and fidelity-improving stages, leading to an efficient generation method called TGATE.

cross-attentiondiffusion modelsinferencesemantics-planning stagefidelity-improving stageTGATEMS-COCO

Abstract

This study explores the role of cross-attention during inference in text-conditional diffusion models. We find that cross-attention outputs converge to a fixed point after few inference steps. Accordingly, the time point of convergence naturally divides the entire inference process into two stages: an initial semantics-planning stage, during which, the model relies on cross-attention to plan text-oriented visual semantics, and a subsequent fidelity-improving stage, during which the model tries to generate images from previously planned semantics. Surprisingly, ignoring text conditions in the fidelity-improving stage not only reduces computation complexity, but also maintains model performance. This yields a simple and training-free method called TGATE for efficient generation, which caches the cross-attention output once it converges and keeps it fixed during the remaining inference steps. Our empirical study on the MS-COCO validation set confirms its effectiveness. The source code of TGATE is available at https://github.com/HaozheLiu-ST/T-GATE.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
Cross-Attention Makes Inference Cumbersome in Text-to-Image Diffusion Models | TensorX