EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing

Wei Chow, Linfeng Li, Lingdong Kong, Zefeng Li, Qi Xu, Hang Song, Tian Ye, Xian Wang, Jinbin Bai, Shilin Xu, Xiangtai Li, Junting Pan, Shaoteng Liu, Ran Zhou, Tianshu Yang, Songhua Liu

TL;DR

EditMGT is the first image editing framework built on Masked Generative Transformers (MGTs), offering a highly efficient and precise alternative to traditional diffusion models. By leveraging MGTs' inherent token-flipping nature and a novel attention consolidation mechanism, it eliminates "editing leakage" to perfectly preserve non-target regions. Despite having under 1 billion parameters, EditMGT delivers state-of-the-art image similarity performance while editing high-resolution images 6× faster than comparable models.

What Problem Does This Paper Address?

Diffusion models (DMs) are currently the dominant paradigm for interactive image editing, but their global denoising dynamics present a major flaw: editing leakage. When you ask a DM to modify a specific object, the holistic nature of the denoising process often causes unintended changes to bleed into the background or other unrelated areas.

Existing solutions—such as using manually predefined masks or complex inversion techniques—are either inflexible, slow, or fail to guarantee that background regions stay completely untouched. The authors pivot away from DMs entirely, turning to Masked Generative Transformers (MGTs) to solve this problem fundamentally. Because MGTs generate images by predicting discrete masked tokens rather than performing continuous global refinement, they possess an inherent, localized decoding property ideal for keeping non-target regions intact.

Methods

EditMGT adapts a pre-trained text-to-image MGT (specifically, Meissonic) into an editing model without adding any new parameters. The framework introduces three core components:

  1. Attention Injection: To guide the generation process using the original image, the authors inject original image tokens as an additional condition. They introduce a bias matrix ($\mathcal{E}$) into the cross-attention mechanism to scale the attention weights between the iterative image and the source image tokens, preventing visual drift.
  2. Multi-layer Attention Consolidation: Raw attention weights from individual transformer blocks can be noisy and unfocused. EditMGT aggregates cross-attention maps across specific intermediate layers (blocks 28 to 36) and applies an Adaptive Filtering technique to turn these maps into clean, fine-grained localization signals.
  3. Region-Hold Sampling: Using the consolidated attention maps, the system establishes a threshold ($\lambda$). During inference, any tokens falling into low-attention areas (below $\lambda$) are explicitly flipped back to their original source values. This guarantees that edit-irrelevant regions remain completely unmodified.
Overview of the attention mechanism and filtering pipeline in EditMGT.

Datasets

The authors utilize a diverse training mixture totaling 4 million samples, anchored by a major new dataset contribution:

  • CrispEdit-2M: A newly introduced high-resolution dataset containing 2 million rigorously filtered samples (with short edges $\ge 1024$ pixels). It spans 7 distinct editing categories: add, replace, remove, color alteration, background change, style transformation, and motion modification.
  • Existing Datasets: The training data also incorporates samples from MagicBrush, Human-Edit, ImgEdit, OmniEdit, and AnyEdit.
  • Evaluation Benchmarks: The model was evaluated across four prominent benchmarks: Emu Edit, MagicBrush, AnyBench, and the GPT-4o-based GEdit-EN-full.

Key Insights and Ideas

  • Token Flipping as a Natural Mask: Unlike diffusion models that modify every pixel globally at every step, MGTs swap out discrete tokens. This discrete formulation allows the model to perform zero-shot local modifications simply by freezing the tokens in low-attention areas.
  • Attention Maps Hold the Key: Pre-trained MGT cross-attention maps inherently contain highly accurate semantic boundaries aligned with text instructions (e.g., tracing the contour of a "birthday hat" in early iterations). By consolidating these maps across multiple layers, the model can automatically discover where to edit without requiring user-provided masks.

Key Results

  • 6× Speedup: At just 960M parameters, EditMGT is 2× to 8× smaller than existing baselines. It processes $1024 \times 1024$ images in just 2 seconds, delivering a 6× speedup over models of comparable performance while maintaining a light memory footprint of 13.8 GB.
  • State-of-the-Art Similarity: EditMGT achieves top-tier image similarity performance on the Emu Edit and MagicBrush benchmarks, demonstrating its ability to alter target objects while leaving the rest of the image untouched.
  • Superior Style Transfer: On the challenging GEdit-EN-full benchmark, EditMGT outperforms the massive 12B parameter FluxKontext.dev model by 17.6% on style transfer tasks and 3.6% on style change tasks.

Limitations and Future Work

  • Limited Training Scale: Due to computational constraints, the model was trained on a relatively modest dataset mixture of 5 million samples. This may limit its generalization capabilities compared to models trained on much larger web-scale datasets.
  • Inherited Base Model Deficiencies: Because EditMGT is built on top of Meissonic, it occasionally inherits base model artifacts, such as a slight bias toward generating cartoon-like textures or minor visual distortions.

The authors suggest that future research directions will involve applying these MGT-based editing principles to more robust, next-generation foundational text-to-image MGT architectures.

Summary updated

BibTeX
@inproceedings{chow2026editmgt,
  author = {Wei Chow and Linfeng Li and Lingdong Kong and Zefeng Li and Qi Xu and Hang Song and Tian Ye and Xian Wang and Jinbin Bai and Shilin Xu and Xiangtai Li and Junting Pan and Shaoteng Liu and Ran Zhou and Tianshu Yang and Songhua Liu},
  title = {{EditMGT: Unleashing Potentials of Masked Generative Transformers in Image Editing}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=aQMAJgT9vA},
}
Figure