Lego-Edit: A General Image Editing Framework with Model-Level Bricks and MLLM Builder

Qiong Jia, Yu Liu, Yajie Chai, Xintong Yao, Qiming Lu, Yasen Zhang, R. S. Shi, Ying Huang, Guoquan Zhang · DOI

Abstract

Instruction-based image editing has garnered significant attention due to its direct interaction with users. However, real-world user instructions are immensely diverse, and existing methods often fail to generalize effectively to instructions outside their training domain, limiting their practical application. To address this, we propose Lego-Edit, which leverages the generalization capability of Multi-modal Large Language Model (MLLM) to organize a suite of model-level editing tools to tackle this challenge. Lego-Edit incorporates two key designs: (1) a model-level toolkit comprising diverse models efficiently trained on limited data and several image manipulation functions, enabling fine-grained composition of editing actions by the MLLM; and (2) a three-stage progressive reinforcement learning approach that uses feedback on unannotated, open-domain instructions to train the MLLM, equipping it with generalized reasoning capabilities for handling real-world instructions. Experiments demonstrate that Lego-Edit achieves state-of-the-art performance on GEdit-Bench and ImgBench.

Introduction

Instruction-based image editing aims to bridge the gap between human language and pixel-level manipulation. Current approaches typically fall into two categories: end-to-end models and agent-based schemes. End-to-end models often struggle with "task confusion" and fail to generalize to complex, multi-step instructions. Conversely, traditional agent-based schemes are frequently hampered by rigid workflows. Lego-Edit addresses this "generalization gap" by treating image editing as a modular construction process, where an MLLM "Builder" orchestrates specialized "Brick" models to fulfill diverse user requests.

The Lego-Edit Framework

The core of Lego-Edit is its modularity. The system is divided into two primary components:

  1. The Bricks (Model-Level Tools): Instead of a monolithic architecture, Lego-Edit utilizes a library of specialized "Bricks." These include Predictive Models (e.g., for segmentation or captioning) and Editing Models (e.g., inpainting or style transfer). Each editing brick is implemented as a specialized LoRA adapter, which minimizes interference between different types of tasks.
  2. The Builder (MLLM Agent): A fine-tuned MLLM acts as the central scheduler. Upon receiving an instruction, the Builder reasons through the necessary steps and generates a JSON-formatted workflow. This workflow is then executed by a dedicated module.
Lego-Edit demonstrates its ability to decompose complex instructions into sequential steps, such as changing a background and then modifying specific object colors.

Progressive Reinforcement Learning

To equip the Builder with robust reasoning, the authors employ a three-stage training strategy:

  • Supervised Fine-Tuning (SFT): Initial training on expert-generated reasoning traces.
  • GT-Based RL: Using Group Relative Policy Optimization (GRPO) to align workflows with ground-truth expert data.
  • GT-Free RL: Training on 50,000 unlabeled instructions. An MLLM critic (Qwen2.5-VL-72B) evaluates the Builder's output based on semantic alignment with the user's intent, allowing the model to learn from open-domain data without manual labels.

Experimental Results

Lego-Edit was evaluated on GEdit-Bench and ImgBench, achieving state-of-the-art performance on both. Notably, the RL-trained Builder achieved a 99% success rate on complex instructions, significantly outperforming vanilla GPT-4o-based agents (53.8%).

Lego-Edit handles global scene transformations, such as changing the time of day, while maintaining the structural integrity of the primary subject.

Qualitative analysis highlights the framework's precision. By utilizing specialized bricks for specific regions, Lego-Edit excels at preserving non-target areas of an image—such as a person's face or the background—while accurately modifying the requested elements.

Conclusion

Lego-Edit represents a significant step toward flexible, instruction-based image editing. By combining the reasoning power of MLLMs with a modular toolkit of specialized models, it achieves high generalization and zero-shot adaptability. Future work will focus on expanding the tool library and developing self-correcting feedback loops where the Builder can adjust its strategy based on intermediate visual results.

Summary updated

BibTeX
@misc{jia2025lego,
  author = {Qiong Jia and Yu Liu and Yajie Chai and Xintong Yao and Qiming Lu and Yasen Zhang and R. S. Shi and Ying Huang and Guoquan Zhang},
  title = {{Lego-Edit: A General Image Editing Framework with Model-Level Bricks and MLLM Builder}},
  year = {2025},
  eprint = {2509.12883},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.12883},
}
Figure