Abstract
Compositional text-to-image (T2I) generation remains a significant challenge for diffusion models, which often struggle with missing entities, attribute binding errors, and incorrect spatial relationships. This paper presents a training-free framework that introduces a novel Entity-Attribute-Relation (EAR) loss and a fine-grained noise refinement system. By manipulating internal cross-attention maps during inference, the proposed method achieves a 25% improvement in spatial accuracy and a 24% boost in human preference without requiring model retraining.
Introduction
Despite the impressive capabilities of models like Stable Diffusion, they frequently fail at complex compositional logic. For instance, a prompt like "a yellow banana and a red monkey" might result in a red banana or the omission of the monkey entirely. These failures typically fall into three categories: missing entities, attribute binding errors (where colors or textures "bleed" between objects), and incorrect spatial relationships (ignoring cues like "left of" or "underneath").
Existing solutions often rely on rigid layout-to-image boxes or complex LLM-based decomposition. This research seeks a more flexible, training-free approach to steer the generation process toward the intended composition by refining the model's internal attention mechanisms.
Methods
The proposed system operates in two distinct phases during the generation process:
1. EAR Loss (Entity-Attribute-Relation)
During the initial 25 steps of the diffusion process, the system calculates four specific losses based on the model's internal cross-attention maps:
- Object Missing Loss: Ensures the model allocates sufficient "attention energy" to every entity mentioned in the prompt.
- Object Mixing Loss: Prevents different objects from occupying the same pixel space, reducing overlapping "mushy" entities.
- Attribute-Binding Loss: Uses an Intersection-over-Union (IoU) metric to ensure an attribute's attention map (e.g., "yellow") aligns perfectly with its corresponding entity's map (e.g., "banana").
- Spatial Relation Loss: Calculates the "center of mass" for objects and applies a mathematical shift to move them into correct relative positions.
2. Fine-Grained Initial Noise Refinement (FR)
If the initial generation fails, the system employs a verifier to identify the specific "broken" entity. Rather than restarting with a new random seed, it back-propagates through the initial noise to "nudge" the starting latent variables. This fine-grained approach fixes faulty regions while preserving the successful portions of the image.
Results and Key Insights
The method was evaluated using benchmarks such as T2I-CompBench, HRS, and VISOR. The results demonstrate significant improvements across multiple dimensions:
- Spatial Mastery: The method achieved a 25% improvement in spatial relationship accuracy compared to base models.
- Human Preference: In user studies, participants preferred the proposed method's images 24% more often than those from state-of-the-art baselines like CONFORM or InitNO.
- Efficiency: The EAR generation process takes approximately 11 seconds, while the full refinement process takes about 22 seconds—significantly faster than other iterative feedback methods.
Discussion and Future Work
A key insight of this work is that a model's internal attention maps function as "proto-segmentation masks" that can be manipulated to control layout without external bounding boxes. Furthermore, the training-free nature of the loss function allows it to be used as a "plug-and-play" module for various models, including Stable Diffusion v1.4, v2, and SD-XL.
Future work will address limitations regarding extremely long prompts and the scalability of the refinement process for scenes with more than four entities. Additionally, fine-tuning the balance between different loss terms could further optimize performance.
Summary updated