NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

BrushEdit: All-In-One Image Inpainting and Editing

Yaowei Li, Yuxuan Bian, Xuan Ju, Zhaoyang Zhang, Ying Shan, Yuexian Zou, Qiang Xu · DOI

Abstract

Image editing currently faces a persistent trade-off between the high fidelity of inversion-based methods and the intuitive flexibility of instruction-based models. We present BrushEdit, a novel framework that treats image editing as an intelligent, instruction-guided inpainting task. By integrating Multimodal Large Language Models (MLLMs) with a dual-branch inpainting architecture, BrushEdit enables precise, interactive editing—including object addition, removal, and modification—while maintaining high background fidelity and achieving significantly faster inference times than traditional diffusion-based inversion methods.

Introduction

The field of AI-driven image editing is traditionally divided between two primary approaches: inversion-based methods and instruction-following models. Inversion-based methods excel at detail preservation but often struggle with significant structural changes, such as adding or removing objects, due to the accumulation of structural noise during the inversion process. Conversely, instruction-based models offer intuitive natural language control but often lack spatial precision, acting as "black boxes" that may modify unintended regions of the image.

BrushEdit addresses these challenges by framing image editing as a cooperative task between an intelligent agent and a high-precision conductor. This approach leverages the reasoning capabilities of MLLMs to interpret user intent and the spatial control of advanced inpainting models to execute pixel-level changes.

Methodology

BrushEdit is designed as a two-step agent-based framework:

  1. Editing Instructor (The Brain): A pre-trained MLLM (e.g., GPT-4 or Qwen) interprets natural language instructions. It classifies the edit type (Addition, Removal, or Modification), identifies the target object, and utilizes a detection model like Grounded-SAM to generate a precise spatial mask. It also formulates a descriptive "target caption" to guide the subsequent generation phase.
  2. Editing Conductor (The Muscles): Based on the BrushNet architecture, this dual-branch inpainting model processes the background and mask features separately from the main generation branch. By "plugging" these features into a frozen, pre-trained diffusion model, BrushEdit ensures that the unmasked regions remain untouched while the masked area is filled with contextually appropriate content.
Overview of the BrushEdit framework and qualitative editing results.

Unlike previous iterations that required specialized models for different mask types, BrushEdit is trained on a unified dataset (BrushData-v2), allowing a single model to handle diverse mask shapes, from precise segmentations to loose hand-drawn brushes.

Key Insights and Results

The core innovation of BrushEdit lies in its realization that most editing tasks—such as changing a garment, removing an unwanted object, or altering a background—are fundamentally inpainting problems. By decoupling the mask and background information from the base diffusion model, the system avoids "catastrophic forgetting" and maintains the original image's structural integrity.

Examples of instruction-based editing, including object removal, background replacement, and object transformation.

Performance Metrics

BrushEdit demonstrates significant improvements in both fidelity and efficiency:

  • High Fidelity: On the PnPBench benchmark, BrushEdit achieved a PSNR of 32.16, significantly outperforming inversion-based baselines which typically hover around 22 PSNR. This indicates that the non-edited portions of the image are preserved with near-perfect accuracy.
  • Inference Speed: The framework completes an edit in approximately 3.57 seconds. This is a massive improvement over high-quality inversion methods like Null-Text Inversion (148s) or Style Diffusion (380s+).
  • Interactive Refinement: The intermediate outputs (masks and captions) allow for multi-round interaction, where users can refine the AI's "plan" before the final pixels are rendered.

Conclusion

BrushEdit provides a robust solution for interactive, high-fidelity image editing by bridging the gap between natural language instructions and pixel-perfect execution. While currently limited by the knowledge of its base diffusion model (Stable Diffusion v1.5), its modular architecture allows for future upgrades to more powerful generative backbones. Future research will focus on improving the alignment between generated masks and complex textual descriptions to handle increasingly irregular editing requests.

Summary updated

BibTeX
@misc{li2024brushedit,
  author = {Yaowei Li and Yuxuan Bian and Xuan Ju and Zhaoyang Zhang and Ying Shan and Yuexian Zou and Qiang Xu},
  title = {{BrushEdit: All-In-One Image Inpainting and Editing}},
  year = {2024},
  eprint = {2412.10316},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.10316},
}
Figure