TL;DR
This paper introduces HeadRouter, a novel training-free framework for text-guided image editing in Multimodal Diffusion Transformers (MM-DiTs). By adaptively routing text guidance to specific attention heads based on their semantic sensitivity and refining token representations, HeadRouter achieves more accurate and consistent image edits without requiring additional training.
What Problem Does This Paper Address?
Diffusion Transformers (DiTs) have revolutionized image generation, but editing these generated images based on text prompts remains a challenge, especially for multimodal variants (MM-DiTs). Unlike traditional UNet-based models that use explicit cross-attention for semantic control, MM-DiTs integrate text and image information through joint self-attention. This entanglement makes it difficult to precisely guide edits based on textual instructions, often leading to semantic misalignment between the edited image and the desired text. Existing methods either require extensive training or struggle to accurately capture nuanced semantic changes while preserving image consistency.
Methods
HeadRouter tackles this challenge with two key innovations:
- Instance-adaptive Attention Head Router (IARouter): The authors discovered that different attention heads within MM-DiTs are sensitive to different semantic attributes (e.g., color, texture, shape). IARouter analyzes this sensitivity for each specific editing task and adaptively routes text guidance to the most relevant attention heads. This is achieved by calculating a normalized dissimilarity score for each head and using a sigmoid function to smoothly activate heads that are highly sensitive to the desired semantic change, while downplaying less relevant ones. This ensures that the editing process focuses on the most impactful attention mechanisms.
- Dual-token Refinement Module (DTR): To further enhance semantic accuracy and region expression, DTR refines both text and image token representations. It leverages the attention weights between text and image tokens to focus edits on key image regions that are most influenced by the text prompt. Additionally, it employs a residual-based enhancement to ensure text guidance is consistently propagated through deeper attention blocks, mitigating the natural decay of text influence as the diffusion process progresses.
Datasets
The paper introduces a new dataset, D, specifically designed for analyzing attention head sensitivity to different editing semantics. This dataset consists of paired text prompts covering eight distinct semantic categories (e.g., shape, color, texture, style). For evaluation, they use existing benchmarks: TEDBench++ and PIE-Bench.
Key Insights and Ideas
- Attention Head Specialization: The core insight is that attention heads in MM-DiTs are not monolithic; they exhibit distinct sensitivities to various semantic attributes. This specialization can be exploited for more targeted and effective image editing.
- Text Influence Decay: Text guidance within MM-DiTs naturally diminishes as the diffusion process progresses through deeper attention blocks. This necessitates mechanisms to maintain consistent text influence.
- Training-Free Efficiency: By analyzing existing model structures and employing adaptive routing and refinement, HeadRouter achieves high-quality edits without requiring any fine-tuning or additional training, making it computationally efficient.
Key Results
HeadRouter demonstrates superior performance across various text-guided image editing tasks.
- Quantitative: The paper reports the best scores in cosine similarity for structure alignment (DINO features) and prompt alignment (CLIP features) compared to several state-of-the-art methods, indicating both high image consistency and accurate text adherence. Image quality (LPIPS) is also competitive.
- Qualitative: Visual comparisons show that HeadRouter effectively edits images according to text prompts while preserving the overall structure and details of the original image, outperforming baselines that often struggle with semantic accuracy or structural integrity.
- User Study: A user study confirmed that HeadRouter's outputs are preferred for their alignment with prompts and preservation of irrelevant image regions.
Limitations and Future Work
- Pre-trained Model Priors: The effectiveness of editing common elements (like the "Eiffel Tower") can be limited when prompts are too descriptive, as the pre-trained models already encode specific visual details for these elements.
- Inversion Accuracy: The alignment between the edited result and the original image is dependent on the accuracy of the image inversion process into the latent space.
- Future Work: The authors suggest leveraging images as guidance, which inherently provide richer information, by developing adapters for DiTs to capture image-based information more effectively for semantically coherent image editing.
Summary updated