MagicQuill V2: Precise and Interactive Image Editing with Layered Visual Cues

Zichen Liu, Yue Yu, Hao Ouyang, Qiuyu Wang, Shuailei Ma, Ka Leong Cheng, Wen Wang, Qingyan Bai, Yuxuan Zhang, Yanhong Zeng, Yixuan Li, Xing Zhu, Yujun Shen, Qifeng Chen

TL;DR

MagicQuill V2 introduces a layered composition framework for generative image editing, bridging the gap between the semantic power of diffusion models and the granular control of traditional graphics software. By deconstructing user intent into independent content, spatial, structural, and color layers, it allows creators to execute highly precise, context-aware image manipulations through intuitive visual cues.

What Problem Does This Paper Address?

While modern diffusion transformers (like FLUX, GPT-4o, and Gemini) excel at generating stunning images from holistic text prompts, they struggle with precise, localized editing. Text prompts are inherently monolithic and imprecise; a user cannot easily specify exactly where an object should go, how it should be shaped, or what exact colors it should use without risking unintended changes to the rest of the image.

Traditional graphics editors (like Photoshop or GIMP) solve this using layers, but they lack generative intelligence. MagicQuill V2 addresses this "intention gap" by bringing the familiar, robust workflow of layered composition into the generative AI era.

Methods

Built upon the FLUX Kontext backbone, MagicQuill V2 deconstructs creative intent into a stack of four independent, controllable visual layers:

  1. Content Layer ($L_{fg}$): Defines what to create using user-provided foreground pieces as anchors. To prevent simple "copy-paste" artifacts, the authors designed a specialized data pipeline featuring an object completion LoRA to restore occluded parts of objects, alongside augmentations for lighting (using ICLight), perspective, and resolution.
  2. Spatial Layer (Mask $M$): Controls where the edit appears, enabling targeted regional modifications or seamless object removal.
  3. Structural Layer (Edge Map $E$): Dictates how an element is shaped via user sketches or edge maps.
  4. Color Layer (Color Map $C$): Determines the palette through brushstrokes.
MagicQuill V2 Model Architecture

To process these diverse cues simultaneously without cross-layer interference, the system introduces a Unified Control Module utilizing a conditional branch adapted via LoRA. Crucially, a Causal Modulated Attention mechanism applies a custom bias matrix to the attention logits. This allows the system to isolate control signals and introduces a user-adjustable guidance scale ($\sigma_k$) to control how strictly the model adheres to each visual cue.

Datasets

The model was trained and evaluated using a mix of synthesized data and established benchmarks:

  • Synthesized Base Dataset: 5,000 high-resolution images depicting diverse object-scene interactions (generated via Qwen3-8B and Flux.1 Krea) to train the content layer.
  • Object Completion Dataset: 3,000 complete objects used to train the foreground restoration LoRA.
  • Pico-Banana-400K: A large-scale dataset for text-guided image editing, from which 1,000 cases were sampled to evaluate structural and color layer control.
  • RORD (Real-world Object Removal Dataset): 5,000 samples used to evaluate the model's specialized object removal capabilities.
  • Curated Content Test Set: A manually curated set of 200 challenging samples (100 interaction-based, 100 placement-based) for content layer evaluation.

Key Insights and Ideas

  • Text is an Inefficient Spatial Controller: Natural language cannot efficiently communicate exact coordinates or fine-grained geometry. Direct visual cues (like sketches or masks) eliminate the inferential gap between user intent and generative output.
  • The Necessity of Foreground Completion: Training models on raw, cropped foreground objects often results in flat, "pasted-on" edits. By using a dedicated model to complete occluded objects before compositing them back into training scenes, the model learns true contextual integration and realistic object-scene interactions.
  • Attention Biasing Prevents Cross-Talk: Explicitly setting the attention logits between different control signals to $-\infty$ prevents different visual layers from interfering with one another, ensuring clean, modular control.

Key Results

  • Superior Content Integration: MagicQuill V2 significantly outperforms state-of-the-art baselines like Insert Anything, Nano Banana, and Qwen-Image. Quantitatively, it achieves a remarkably low $L_1$ error of 0.061 (compared to 0.105 for Insert Anything) and a top DINO score of 0.930.
  • State-of-the-Art Object Removal: On the RORD benchmark, MagicQuill V2 beats specialized erasure models like SmartEraser and OmniEraser, achieving an $L_1$ error of 0.042 and an FID score of 16.42.
  • Precise Structural and Color Control: Combining the structural and color layers allows the model to perfectly reproduce complex user intents, outperforming text-only and single-modality baselines.
Qualitative comparison for structural and color layer control

Limitations and Future Work

The authors note that while the control strength parameter ($\sigma$) provides excellent flexibility, setting it too high enforces strict adherence to the user's visual cues. If a user provides an imperfect, messy sketch or an inaccurate color map, high guidance values can amplify these flaws, leading to visual artifacts in the final output. Future work could explore intelligent, automated refinement of rough user inputs before applying strict attention constraints.

Summary updated

BibTeX
@inproceedings{liu2026magicquill,
  author = {Zichen Liu and Yue Yu and Hao Ouyang and Qiuyu Wang and Shuailei Ma and Ka Leong Cheng and Wen Wang and Qingyan Bai and Yuxuan Zhang and Yanhong Zeng and Yixuan Li and Xing Zhu and Yujun Shen and Qifeng Chen},
  title = {{MagicQuill V2: Precise and Interactive Image Editing with Layered Visual Cues}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=VaIkIEPeXV},
}
Figure