Energy-Based Cross Attention for Bayesian Context Update in Text-to-Image Diffusion Models

Geon Yeong Park, Jeongsol Kim, Beomsu Kim, Sang Wan Lee, Jong Chul Ye
6/16/2023
39 citations
cs.CVcs.AIcs.CL
diffusion-flowtransformer-attentionbayesian

Official code: EnergyAttention/Energy-Based-CrossAttention (51 stars, Python, PyTorch, last commit 2024-04-01).

Abstract

Despite the remarkable performance of text-to-image diffusion models in image generation tasks, recent studies have raised the issue that generated images sometimes cannot capture the intended semantic contents of the text prompts, which phenomenon is often called semantic misalignment. To address this, here we present a novel energy-based model (EBM) framework for adaptive context control by modeling the posterior of context vectors.

Show full abstract

Specifically, we first formulate EBMs of latent image representations and text embeddings in each cross-attention layer of the denoising autoencoder. Then, we obtain the gradient of the log posterior of context vectors, which can be updated and transferred to the subsequent cross-attention layer, thereby implicitly minimizing a nested hierarchy of energy functions. Our latent EBMs further allow zero-shot compositional generation as a linear combination of cross-attention outputs from different contexts. Using extensive experiments, we demonstrate that the proposed method is highly effective in handling various image generation tasks, including multi-concept generation, text-guided image inpainting, and real and synthetic image editing. Code: https://github.com/EnergyAttention/Energy-Based-CrossAttention.

View on arXivView PDF

Code Implementations(1)

PyTorch

The official repository of "Energy-Based Cross Attention for Bayesian Context Update in Text-to-Image Diffusion Models".

517PythonMay 24, 20232 years ago
cross-attentionebmenergy-based-modelpytorchstable-diffusion

Similar Papers

Cite this paper

@article{park2023energybased,
  title  = {Energy-Based Cross Attention for Bayesian Context Update in Text-to-Image Diffusion Models},
  author = {Geon Yeong Park and Jeongsol Kim and Beomsu Kim and Sang Wan Lee and Jong Chul Ye},
  year   = {2023},
  eprint = {2306.09869},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.09869v3},
  journal = {NEURIPS 2023 2023}
}

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

Discussion