Introduction
State-of-the-art diffusion models, such as Stable Diffusion, demonstrate remarkable capabilities in generating high-quality images from text prompts. However, they frequently struggle with complex compositional prompts involving multiple objects and specific attributes. These failures typically manifest in three ways: attribute leakage (colors bleeding between objects), entity leakage (objects merging incorrectly), and missing entities (failure to generate a requested subject).
The primary cause of these issues is inaccurate attention regions within the cross-attention mechanism, where text tokens influence unintended pixel areas. This paper introduces a novel framework to address these challenges by controlling the attention maps during the denoising process.
Methodology
The proposed approach introduces a "ready-to-use plugin" for existing diffusion models, consisting of two main components: BoxNet and Attention Map Control.
BoxNet: Dynamic Layout Prediction
BoxNet is a transformer-based module designed to predict bounding boxes for every entity mentioned in a prompt. Unlike static layout-to-image models that require manual input, BoxNet predicts these boxes dynamically at each step of the denoising process. This allows the generation to adapt to the evolving image structure while maintaining semantic boundaries.
Attention Map Control
To ensure precise attribute binding and entity separation, the method implements two types of control:
- Cross-Attention Control: This constrains specific text tokens (e.g., "cat") to activate only within their predicted bounding boxes, preventing attribute leakage.
- Self-Attention Control: This manages interactions between image patches to prevent objects from merging or "tearing." Unique masks based on 2D Gaussian distributions are employed to handle overlapping entities without interference.
Experimental Results
The method was evaluated using the COCO 2014 dataset for training and a custom benchmark specifically designed for attribute binding (e.g., "a [colorA][entityA] and a [colorB][entityB]").
Quantitative Performance
Using the "Minimum Object Score" (via Grounding DINO) to verify entity presence, the proposed method achieved a score of 0.6028, significantly outperforming standard Stable Diffusion (0.3973) and Attend-and-Excite (0.4438). Furthermore, the model maintained high image quality with a Frechet Inception Distance (FID) of 17.47, which is slightly better than the base Stable Diffusion model (17.79).
Qualitative Analysis
User studies confirmed a substantial improvement in "Subjective Fidelity." Participants found the generated images much more faithful to complex prompts, particularly in successfully avoiding color bleeding between distinct objects. The method also demonstrated strong generalization to non-COCO categories, proving its utility in open-domain generation.
Conclusion
By integrating dynamic bounding box prediction with fine-grained attention control, this research effectively addresses the compositional limitations of current diffusion models. The "plugin" nature of the approach allows it to enhance various base models without requiring expensive fine-tuning. Future work will focus on improving background integration and handling more complex spatial relationships.
Summary updated