Improving Sample Quality of Diffusion Models Using Self-Attention Guidance

Susung Hong, Gyuseong Lee, Wooseok Jang, Seungryong Kim
10/3/2022
cs.CVcs.AIcs.LG

Official code: huggingface/diffusers (33,963 stars, Apache-2.0, PyTorch, last commit 2026-04-30). 1 more implementation below.

Abstract

Denoising diffusion models (DDMs) have attracted attention for their exceptional generation quality and diversity. This success is largely attributed to the use of class- or text-conditional diffusion guidance methods, such as classifier and classifier-free guidance. In this paper, we present a more comprehensive perspective that goes beyond the traditional guidance methods. From this generalized perspective, we introduce novel condition- and training-free strategies to enhance the quality of generated images. As a simple solution, blur guidance improves the suitability of intermediate samples for their fine-scale information and structures, enabling diffusion models to generate higher quality samples with a moderate guidance scale. Improving upon this, Self-Attention Guidance (SAG) uses the intermediate self-attention maps of diffusion models to enhance their stability and efficacy. Specifically, SAG adversarially blurs only the regions that diffusion models attend to at each iteration and guides them accordingly. Our experimental results show that our SAG improves the performance of various diffusion models, including ADM, IDDPM, Stable Diffusion, and DiT. Moreover, combining SAG with conventional guidance methods leads to further improvement.

View on arXivView PDF

Code Implementations(2)

PyTorchApache-2.0

🤗 Diffusers: State-of-the-art diffusion models for image, video, and audio generation in PyTorch.

33,9637,110Python, MakefileMay 30, 20225 months agoApache-2.0
deep-learningdiffusionfluximage-generationimage2image+10 more
PyTorchMIT

Official implementation of the paper "Improving Sample Quality of Diffusion Models Using Self-Attention Guidance" (ICCV 2023)

2467Python, Jupyter NotebookOct 3, 20223 years agoMIT
artificial-intelligencediffusion-modelsgenerative-modelspytorch

Similar Papers

Cite this paper

@article{hong2022improving,
  title  = {Improving Sample Quality of Diffusion Models Using Self-Attention Guidance},
  author = {Susung Hong and Gyuseong Lee and Wooseok Jang and Seungryong Kim},
  year   = {2022},
  eprint = {2210.00939},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.00939}
}

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/2210.00939.svg)](https://codeofpaper.com/paper/2210.00939)

Discussion