Obtaining Favorable Layouts for Multiple Object Generation
Barak Battash, Amit Rozner, Lior Wolf, Ofir Lindenbaum
TL;DR
The paper tackles the challenge of generating images with multiple specified subjects using diffusion-based text-to-image models, where traditional methods often neglect or blend subjects. It introduces a three-phase framework that (i) excites and separates per-subject cross-attention maps in the initial diffusion steps, (ii) derives and rearranges per-subject masks in the latent space, and (iii) enforces alignment of attention maps to fixed masks during later steps. The method leverages novel losses on cross-attention maps and a latent-space reallocation strategy to produce more faithful layouts, validated by extensive quantitative and qualitative comparisons against strong baselines. The results show substantial improvements in multi-subject fidelity, with careful discussion of limitations such as increased latency and potential layout-induced tradeoffs.
Abstract
Large-scale text-to-image models that can generate high-quality and diverse images based on textual prompts have shown remarkable success. These models aim ultimately to create complex scenes, and addressing the challenge of multi-subject generation is a critical step towards this goal. However, the existing state-of-the-art diffusion models face difficulty when generating images that involve multiple subjects. When presented with a prompt containing more than one subject, these models may omit some subjects or merge them together. To address this challenge, we propose a novel approach based on a guiding principle. We allow the diffusion model to initially propose a layout, and then we rearrange the layout grid. This is achieved by enforcing cross-attention maps (XAMs) to adhere to proposed masks and by migrating pixels from latent maps to new locations determined by us. We introduce new loss terms aimed at reducing XAM entropy for clearer spatial definition of subjects, reduce the overlap between XAMs, and ensure that XAMs align with their respective masks. We contrast our approach with several alternative methods and show that it more faithfully captures the desired concepts across a variety of text prompts.
