Training-Free Layout Control with Cross-Attention Guidance

Minghao Chen, Iro Laina, Andrea Vedaldi
4/6/2023
cs.CV

No official code found. Best implementation: silent-chen/layout-guidance (267 stars, last commit 2024-03-18). 1 more below.

Abstract

Recent diffusion-based generators can produce high-quality images from textual prompts. However, they often disregard textual instructions that specify the spatial layout of the composition. We propose a simple approach that achieves robust layout control without the need for training or fine-tuning of the image generator. Our technique manipulates the cross-attention layers that the model uses to interface textual and visual information and steers the generation in the desired direction given, e.g., a user-specified layout. To determine how to best guide attention, we study the role of attention maps and explore two alternative strategies, forward and backward guidance. We thoroughly evaluate our approach on three benchmarks and provide several qualitative examples and a comparative analysis of the two strategies that demonstrate the superiority of backward guidance compared to forward guidance, as well as prior work. We further demonstrate the versatility of layout guidance by extending it to applications such as editing the layout and context of real images.

View on arXivView PDF

Code Implementations(2)

[WACV 2024] Training-Free Layout Control with Cross-Attention Guidance

26718PythonMar 29, 20232 years ago

🤗 Unofficial huggingface/diffusers-based implementation of the paper "Training-Free Layout Control with Cross-Attention Guidance".

422Shell, PythonApr 14, 20233 years ago

Similar Papers

Cite this paper

@article{chen2023trainingfree,
  title  = {Training-Free Layout Control with Cross-Attention Guidance},
  author = {Minghao Chen and Iro Laina and Andrea Vedaldi},
  year   = {2023},
  eprint = {2304.03373},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.03373v2}
}

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

Discussion