Abstract
Text-to-image (T2I) generation models often struggle with multi-instance synthesis (MIS), where they must accurately depict multiple distinct instances in a single image based on complex prompts detailing individual features. Traditional MIS control methods for UNet architectures like SD v1.5/SDXL fail to adapt to DiT-based models like FLUX and SD v3.5, which rely on integrated attention between image and text tokens rather than text-image cross-attention. To enhance MIS in DiT, we first analyze the mixed attention mechanism in DiT. Our token-wise and layer-wise analysis of attention maps reveals a hierarchical response structure: instance tokens dominate early layers, background tokens in middle layers, and attribute tokens in later layers. Building on this observation, we propose a training-free approach for enhancing MIS in DiT-based models with hierarchical and step-layer-wise attention specialty tuning (AST). AST amplifies key regions while suppressing irrelevant areas in distinct attention maps across layers and steps, guided by the hierarchical structure. This optimizes multimodal interactions by hierarchically decoupling the complex prompts with instance-based sketches. We evaluate our approach using upgraded sketch-based layouts for the T2I-CompBench and customized complex scenes. Both quantitative and qualitative results confirm our method enhances complex layout generation, ensuring precise instance placement and attribute representation in MIS.
Introduction: The Challenge of Multi-Instance Synthesis in DiTs
Modern text-to-image models frequently encounter difficulties with Multi-Instance Synthesis (MIS). When prompted with complex scenes containing multiple objects—such as "a red car, a blue bike, and a green bench"—models often suffer from attribute leakage (mixing up colors) or instance omission.
While effective solutions existed for older UNet-based architectures (e.g., Stable Diffusion v1.5), the industry's transition to Diffusion Transformers (DiTs) like FLUX and SD3.5 has rendered these techniques obsolete. DiTs utilize a "unified attention" mechanism where text and image tokens are processed jointly in a single stream, making traditional cross-attention manipulation impossible. This research introduces Attention Specialty Tuning (AST), a training-free method designed to regain spatial and attribute control within these integrated architectures.
Methodology: Decoding the DiT Hierarchy
The core of this work lies in the discovery of a Hierarchical Response Structure within DiTs. By performing a detailed analysis of attention maps across different layers and diffusion steps, the authors identified a logical construction order:
- Early Layers (1-19): Focus on instance shapes and locations.
- Middle Layers (20-39): Focus on background elements.
- Later Layers (40-57): Focus on fine-grained attributes and details.
Attention Specialty Tuning (AST)
Building on this hierarchical insight, the proposed AST method acts as a training-free plug-in that modulates attention maps during generation. It employs three specific masks to guide the model:
- T2T (Text-to-Text): Strengthens intra-prompt relationships (e.g., binding "red" to "car").
- I2I (Image-to-Image): Ensures spatial consistency within an object's region.
- I2T (Image-to-Text): Aligns specific image regions with corresponding text tokens based on user-provided sketches.
The critical innovation is Hierarchical and Step-Layer-Wise (HSLW) modulation. Instead of applying masks uniformly, AST targets specific layers and time-steps where the model naturally processes certain information (e.g., tuning attributes only in later layers).
Evaluation and Results
The researchers evaluated AST using the T2I-CompBench, upgraded with GPT-4V generated sketches, and a set of Customized Complex Scenes featuring 6–8 distinct instances.
Key Findings:
- Quantitative Performance: AST significantly outperformed baselines like DenseDiff and BoxDiff in compositional metrics, including Color B-VQA and 2D Spatial UniDet.
- Qualitative Mastery: The method successfully rendered scenes with over 8 distinct objects, a complexity level where base FLUX and SD3.5 models typically fail.
- Aesthetic Preservation: High ImageReward scores indicate that AST improves layout accuracy without sacrificing the high-quality aesthetic output of the base models.
Conclusion
AST demonstrates that DiT models follow a structured, hierarchical generation process. By working with this natural flow through step-layer-wise modulation, AST provides a powerful, training-free solution for complex multi-instance synthesis. While currently dependent on input sketches, future work may focus on automating layout generation or independently tuning multiple text streams for even greater precision.
Summary updated