MasaCtrl: Tuning-Free Mutual Self-Attention Control for Consistent Image Synthesis and Editing

Ming Cao, Xintao Wang, Zhongang Qi, Ying Shan, Xiaohu Qie +1 more
2/14/2026

No official code found. Best implementation: TencentARC/MasaCtrl (841 stars, Apache-2.0, last commit 2024-08-19).

Abstract

Despite the success in large-scale text-to-image generation and text-conditioned image editing, existing methods still struggle to produce consistent generation and editing results. For example, generation approaches usually fail to synthesize multiple images of the same objects/characters but with different views or poses. Meanwhile, existing editing methods either fail to achieve effective complex nonrigid editing while maintaining the overall textures and identity, or require time-consuming fine-tuning to capture the image-specific appearance. In this paper, we develop MasaCtrl, a tuning-free method to achieve consistent image generation and complex non-rigid image editing simultaneously. Specifically, MasaCtrl converts existing self-attention in diffusion models into mutual self-attention, so that it can query correlated local contents and textures from source images for consistency. To further alleviate the query confusion between foreground and background, we propose a mask-guided mutual self-attention strategy, where the mask can be easily extracted from the cross-attention maps. Extensive experiments show that the proposed MasaCtrl can produce impressive results in both consistent image generation and complex non-rigid real image editing.

View on arXivView PDF

Code Implementations(1)

TencentARC/MasaCtrlCommunity100%
Apache-2.0

[ICCV 2023] Consistent Image Synthesis and Editing

84136CSS, PythonMar 24, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{cao2026masactrl,
  title  = {MasaCtrl: Tuning-Free Mutual Self-Attention Control for Consistent Image Synthesis and Editing},
  author = {Ming Cao and Xintao Wang and Zhongang Qi and Ying Shan and Xiaohu Qie and Yinqiang Zheng},
  year   = {2026},
  eprint = {2304.08465},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2304.08465},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.08465.svg)](https://codeofpaper.com/paper/2304.08465)

Discussion