Exploring Multimodal Diffusion Transformers for Enhanced Prompt-based Image Editing

Joonghyuk Shin, Alchan Hwang, Yujin Kim, Daneul Kim, Jaesik Park

TL;DR

This paper introduces a novel prompt-based image editing method specifically designed for the emerging Multimodal Diffusion Transformer (MM-DiT) architectures, like Stable Diffusion 3 and Flux.1. By analyzing MM-DiT's unique attention mechanisms and proposing a targeted input projection modification strategy, the authors achieve high-quality, controllable edits across various scenarios, bridging the gap between older U-Net-based methods and newer transformer architectures.

What Problem Does This Paper Address?

Recent advancements in generative AI have seen a significant shift from U-Net architectures to transformer-based models for text-to-image generation. Multimodal Diffusion Transformers (MM-DiTs), such as those powering Stable Diffusion 3 and Flux.1, represent the state-of-the-art. These models utilize a unified attention mechanism that allows for bidirectional information flow between text and image modalities, a departure from the unidirectional cross-attention in U-Nets. This architectural change poses a significant challenge for existing image editing techniques, which often rely on manipulating attention maps in U-Net structures. The core problem this paper addresses is how to effectively adapt and develop image editing methods that can leverage the unique properties of MM-DiTs, enabling precise and controllable edits without losing the benefits of these advanced architectures.

Methods

The authors' approach is built on a deep analysis of MM-DiT's attention mechanism. They first decompose the attention matrices into four distinct blocks (I2I, T2T, T2I, I2T) and analyze their characteristics. A key finding is that I2I blocks preserve image identity (similar to self-attention in U-Nets), while T2I blocks are crucial for localizing text-image interactions (similar to cross-attention).

Based on this analysis, they propose two main editing strategies:

  1. Input Projection Modification: Instead of modifying the entire attention map, they selectively replace the query and key projections of the target branch with those from the source branch. This approach is computationally efficient and avoids text projection misalignment issues that can arise from full attention map replacement.
  2. Local Blending: To achieve fine-grained control and preserve untouched regions, they extract attention maps from the top-5 most effective transformer blocks (identified through analysis) and use them to create binary masks. These masks are then used to blend the edited image with the original, ensuring that only the desired regions are modified.

They also introduce strategies to mitigate noisy attention maps, which become more prevalent in larger MM-DiT models, by selecting optimal blocks and applying Gaussian smoothing.

Datasets

The paper does not explicitly mention training datasets. For evaluation and analysis, they utilize:

  • Prompt sets: They sample prompts from the PARTI dataset for systematic evaluation and use a set of 60 diverse prompts for editing experiments.
  • Grounded SAM2: Used to generate ground truth masks for evaluating the effectiveness of attention blocks in local editing tasks.

Key Insights and Ideas

  • MM-DiT Attention Roles: The paper provides a clear mapping of MM-DiT's attention blocks to their functional roles, drawing parallels to U-Net attention mechanisms (I2I for identity, T2I for cross-modal interaction). This is a crucial step in understanding how to manipulate these models.
  • Scaling and Noise: As MM-DiT models scale up, their attention maps become noisier. This is a significant challenge for editing, as noisy masks can lead to artifacts.
  • Block Selection is Key: Not all attention blocks are equally useful for editing. Identifying and utilizing the "top-5" most effective blocks significantly improves edit quality and reduces noise.
  • Input Projection vs. Full Attention: Modifying input projections (q, k) is a more robust and efficient way to edit MM-DiTs compared to replacing entire attention maps, especially when dealing with significantly different prompts.
  • T2I for Local Editing: The T2I attention blocks are particularly effective for generating masks for precise local editing, outperforming I2T blocks due to their less constrained attention distribution.

Key Results

  • High-Quality Edits: The proposed method demonstrates high-quality, controllable image editing across various scenarios, including global stylistic changes and local edits.
  • Efficiency: Modifying input projections (qi, ki) is computationally more efficient than replacing full attention maps, enabling the use of optimized SDPA kernels.
  • Robustness: The method handles arbitrarily different prompt pairs, a significant advantage over previous methods that required precise token mapping.
  • Quantitative Comparison: In Table 2, their method consistently outperforms baselines like "Fixed Seed" and "Prompt Change" across various MM-DiT models, balancing content preservation and prompt alignment. For example, on SD3-M, their method achieves a CLIP score of 0.359 compared to 0.344 for "Prompt Change."
  • Qualitative Results: Figures 1, 5, 8, 10, 11, 12, 14, and 15 showcase impressive qualitative results, demonstrating precise local edits and global transformations.

Limitations and Future Work

  • Inversion Dependency for Real Images: For editing real images, the performance is still heavily dependent on the quality of the image inversion technique. While their method mitigates this dependency to some extent, it remains a factor.
  • Hyperparameter Tuning: While they identify generally effective settings for masking threshold, attention replacement step, and local blending stop timestep, these might still require some tuning for optimal results in specific cases.
  • Future Directions: The paper suggests that further exploration of MM-DiT's attention mechanisms and their interaction with different sampling schedules could lead to even more advanced editing capabilities. The authors also mention that discussions on limitations and future directions can be found in Appendix F, which is not provided in the OCR text.

Summary updated

BibTeX
@inproceedings{shin2025exploring,
  author = {Joonghyuk Shin and Alchan Hwang and Yujin Kim and Daneul Kim and Jaesik Park},
  title = {{Exploring Multimodal Diffusion Transformers for Enhanced Prompt-based Image Editing}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure