OmniPaint: Mastering Object-Oriented Editing via Disentangled Insertion-Removal Inpainting

Yongsheng Yu, Ziyun Zeng, Haitian Zheng, Jiebo Luo

Abstract

OmniPaint is a unified diffusion-based framework that treats object removal and insertion as interdependent, "cycle-consistent" tasks. By leveraging a novel CycleFlow training mechanism and a new no-reference metric called CFD, it achieves state-of-the-art results in seamless image editing while significantly reducing the need for massive paired datasets.

The Challenges of Object-Oriented Editing

Object-oriented image editing—specifically removing an object or inserting a new one—is deceptively difficult for AI. Current models face three main hurdles:

  1. Physical Consistency: Simply filling pixels isn't enough; a "realistic" removal must also eliminate the object's shadows and reflections. Conversely, insertion requires generating new, scene-appropriate shadows.
  2. Data Scarcity: Training these models usually requires "paired" data (the exact same scene with and without the object), which is incredibly difficult to collect at scale.
  3. The "Ghost" Problem: Generative models often "hallucinate" new, unwanted objects in the area where something was removed. Existing metrics like FID or PSNR often fail to penalize these realistic-looking but incorrect hallucinations.

Methodology

OmniPaint is built on the FLUX-1.dev architecture, utilizing Flow Matching (FM) rather than standard epsilon-prediction diffusion. The authors introduce several key technical innovations:

  • CycleFlow Unpaired Post-Training: Since removal and insertion are inverse problems, the authors use a well-trained removal model to "clean" objects from large-scale unpaired datasets (like COCO-Stuff). This creates a synthetic training signal that allows the insertion model to learn how to place objects back into a scene without needing real-world "before" and "after" photos.
  • Prompt-Free Adaptive Control: Instead of relying on potentially ambiguous text prompts, the model uses learnable task-specific embeddings for removal and insertion, ensuring more precise control.
  • Context-Aware Feature Deviation (CFD) Metric: To solve the evaluation gap, the authors developed CFD. It uses the Segment Anything Model (SAM) to detect "nested" objects in the edited area. If the model generates a "ghost" object that doesn't match the surrounding background features (analyzed via DINOv2), the CFD score penalizes it.

Key Results and Insights

OmniPaint consistently outperformed industry baselines like AnyDoor, IMPRINT, and FreeCompose across both primary tasks.

Object Removal

On the RORD benchmark, OmniPaint achieved a FID of 19.17, nearly 2.5x better than the next best diffusion-based baseline. Qualitative results show the model successfully removing complex artifacts like glass reflections that typically plague inpainting models.

OmniPaint demonstrates superior physical consistency by removing both the subject and their corresponding reflection in a mirror.

Object Insertion

The model showed superior identity preservation and scene integration. In DINOv2 similarity tests, it scored 84.37, significantly higher than AnyDoor (76.95). The model generates complex shadows for inserted objects that match the scene's light source, avoiding the "copy-paste" look of previous methods.

The framework handles complex object insertion, maintaining object identity while generating context-aware shadows and reflections.

Conclusion and Future Work

OmniPaint represents a significant step forward by treating removal as a pre-processor for insertion training, forcing the model to master complex physical effects. While inference speed remains an area for improvement (requiring ~28 NFE), the framework's ability to handle unpaired data and penalize hallucinations via the CFD metric sets a new standard for high-fidelity image editing. Future directions include extending the framework to multi-object interactions and video editing.

Summary updated

BibTeX
@inproceedings{yu2025omnipaint,
  author = {Yongsheng Yu and Ziyun Zeng and Haitian Zheng and Jiebo Luo},
  title = {{OmniPaint: Mastering Object-Oriented Editing via Disentangled Insertion-Removal Inpainting}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
  url = {https://openreview.net/forum?id=kPKCTNhOcx},
}
Figure