Smoothed Energy Guidance: Guiding Diffusion Models with Reduced Energy Curvature of Attention

Susung Hong
8/1/2024
cs.CVcs.AIcs.LG

Official code: SusungHong/SEG-SDXL (138 stars, last commit 2024-10-03).

Abstract

Conditional diffusion models have shown remarkable success in visual content generation, producing high-quality samples across various domains, largely due to classifier-free guidance (CFG). Recent attempts to extend guidance to unconditional models have relied on heuristic techniques, resulting in suboptimal generation quality and unintended effects. In this work, we propose Smoothed Energy Guidance (SEG), a novel training- and condition-free approach that leverages the energy-based perspective of the self-attention mechanism to enhance image generation. By defining the energy of self-attention, we introduce a method to reduce the curvature of the energy landscape of attention and use the output as the unconditional prediction. Practically, we control the curvature of the energy landscape by adjusting the Gaussian kernel parameter while keeping the guidance scale parameter fixed. Additionally, we present a query blurring method that is equivalent to blurring the entire attention weights without incurring quadratic complexity in the number of tokens. In our experiments, SEG achieves a Pareto improvement in both quality and the reduction of side effects. The code is available at https://github.com/SusungHong/SEG-SDXL.

View on arXivView PDF

Code Implementations(1)

Official implementation of the paper "Smoothed Energy Guidance: Guiding Diffusion Models with Reduced Energy Curvature of Attention" (NeurIPS`24)

1385Python, Jupyter NotebookAug 1, 20242 years ago

Similar Papers

Cite this paper

@article{hong2024smoothed,
  title  = {Smoothed Energy Guidance: Guiding Diffusion Models with Reduced Energy Curvature of Attention},
  author = {Susung Hong},
  year   = {2024},
  eprint = {2408.00760},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2408.00760},
  url    = {http://arxiv.org/abs/2408.00760v2},
  journal = {NEURIPS 2024 2024}
}

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

Discussion