Compositional Text-to-Image Synthesis with Attention Map Control of Diffusion Models

Ruichen Wang, Zekang Chen, Chen Chen, Jian Ma, Haonan Lu +1 more
5/23/2023
cs.CV

No official code found. Best implementation: OPPO-Mente-Lab/attention-mask-control (46 stars, MIT, last commit 2023-09-21).

Abstract

Recent text-to-image (T2I) diffusion models show outstanding performance in generating high-quality images conditioned on textual prompts. However, they fail to semantically align the generated images with the prompts due to their limited compositional capabilities, leading to attribute leakage, entity leakage, and missing entities. In this paper, we propose a novel attention mask control strategy based on predicted object boxes to address these issues. In particular, we first train a BoxNet to predict a box for each entity that possesses the attribute specified in the prompt. Then, depending on the predicted boxes, a unique mask control is applied to the cross- and self-attention maps. Our approach produces a more semantically accurate synthesis by constraining the attention regions of each token in the prompt to the image. In addition, the proposed method is straightforward and effective and can be readily integrated into existing cross-attention-based T2I generators. We compare our approach to competing methods and demonstrate that it can faithfully convey the semantics of the original text to the generated content and achieve high availability as a ready-to-use plugin. Please refer to https://github.com/OPPOMente-Lab/attention-mask-control.

View on arXivView PDF

Code Implementations(1)

MIT

code for paper "Compositional Text-to-Image Synthesis with Attention Map Control of Diffusion Models"

467Shell, PythonJun 2, 20233 years agoMIT

Similar Papers

Cite this paper

@article{wang2023compositional,
  title  = {Compositional Text-to-Image Synthesis with Attention Map Control of Diffusion Models},
  author = {Ruichen Wang and Zekang Chen and Chen Chen and Jian Ma and Haonan Lu and Xiaodong Lin},
  year   = {2023},
  eprint = {2305.13921},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.13921v2}
}

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

Discussion