Abstract
We introduce a novel, training-free approach for enhancing alignment in Transformer-based Text-Guided Diffusion Models (TGDMs). Existing TGDMs often struggle to generate semantically aligned images, particularly when dealing with complex text prompts or multi-concept attribute binding challenges. Previous U-Net-based methods primarily optimized the latent space, but their direct application to Transformer-based architectures has shown limited effectiveness. Our method addresses these challenges by directly optimizing cross-attention maps during the generation process. Specifically, we introduce Self-Coherence Guidance, a method that dynamically refines attention maps using masks derived from previous denoising steps, ensuring precise alignment without additional training. To validate our approach, we constructed more challenging benchmarks for evaluating coarse-grained attribute binding, fine-grained attribute binding, and style binding. Experimental results demonstrate the superior performance of our method, significantly surpassing other state-of-the-art methods across all evaluated tasks.
1. Introduction
Text-to-image diffusion models have achieved remarkable success, yet they frequently suffer from semantic misalignment. This is most evident in the "attribute binding" problem, where a model correctly identifies the objects and attributes in a prompt but fails to associate them correctly in the final output. While previous research addressed these issues in U-Net-based architectures, the recent architectural shift toward Transformers (e.g., PixArt-\alpha, Flux) presents new challenges. We propose Self-Coherence Guidance (SCG), a training-free inference-time optimization method designed to ensure precise attribute binding in Transformer-based TGDMs.
2. The Challenge of Transformer Architectures
Attribute binding failures generally fall into three categories:
- Coarse-grained binding: Mixing attributes between distinct objects (e.g., a "red bench" and a "yellow clock" appearing as a yellow bench).
- Fine-grained binding: Misplacing attributes on sub-components of a single object (e.g., the "flesh" vs. "stem" of an apple).
- Style binding: Failing to apply distinct artistic styles to specific elements in a scene (e.g., a watercolor countryside with a cyberpunk cabin).
Existing optimization techniques developed for U-Nets often rely on the "semantic core" found in low-resolution layers (e.g., $16 \times 16$). However, Transformers lack these downsampling/upsampling modules. In Transformer architectures, semantic information is distributed more uniformly across layers and steps, making it difficult to find a single "guide" map and rendering U-Net-specific latent space optimizations ineffective.
3. Self-Coherence Guidance (SCG)
SCG operates on the intuition that while a model may struggle with spatial placement, it typically identifies the "what" of a prompt early in the denoising process. Our method refines generation through a three-step pipeline:
3.1 Mask Extraction
At each denoising step, SCG extracts "concept masks" from features generated in the previous step. For coarse-grained and style binding, we employ K-means clustering on averaged cross-attention maps to segment distinct objects.
3.2 LLM-Based Spatial Planning
For fine-grained binding, where simple clustering often fails to distinguish small parts, we utilize a Large Language Model (LLM) as a spatial planner. The LLM estimates the relative proportions of object parts (e.g., the ratio of "flesh" to "stem" in an apple). We then select the top-K pixels in the attention map based on these ratios to create precise masks.
3.3 Attention Optimization
The extracted masks are used to directly "strengthen" the correct regions in the current step's cross-attention maps. This ensures that the attention mechanism focuses on the appropriate spatial regions for each concept, preventing attribute leakage without requiring additional training or fine-tuning.
4. Experimental Evaluation
We evaluated SCG using PixArt-\alpha and Flux.1. To rigorously test the method, we developed three new benchmarks:
- Coarse-grained: 54 complex prompts.
- Fine-grained: 56 multi-part object prompts.
- Style binding: 48 prompts requiring localized style application.
4.1 Quantitative and Qualitative Results
SCG significantly outperformed state-of-the-art U-Net-based methods (e.g., Divide & Bind, CONFORM) adapted for Transformers.
- User Preference: In a 50-participant study, SCG was preferred over the base PixArt-\alpha model by 81% for coarse-grained tasks, 90.6% for fine-grained tasks, and 92.6% for style binding.
- Metrics: SCG achieved superior CLIP similarity and BLIP-VQA scores. Notably, in style binding, BLIP-VQA scores improved from 0.676 (base model) to 0.799.
- Generalizability: The method proved robust across different Transformer designs, including the MMDiT architecture of Flux.1.
5. Discussion and Conclusion
SCG provides a robust, training-free solution for semantic alignment in modern Transformer-based diffusion models. While the method introduces some inference overhead (approximately 20 seconds on an RTX 3090 due to clustering and LLM queries), it avoids the quality degradation and "catastrophic forgetting" associated with fine-tuning. Future work will focus on optimizing mask extraction techniques and addressing the limitations of current captioning-based evaluation metrics, which often struggle to describe fine-grained styles accurately.
Summary updated