Introduction
Realistic object insertion remains a significant challenge in computer vision. While text-to-image models can generate stunning scenes from scratch, modifying an existing image by adding a specific object—while maintaining physical consistency, lighting, and spatial awareness—is notoriously difficult. Standard models often produce "floating" objects or disrupt the original scene's style. The primary bottleneck is the lack of high-quality training data: pairs of images showing the exact same scene with and without a specific object.
EraseDraw addresses this by inverting the problem. Instead of searching for rare "before and after" pairs, it utilizes an autonomous pipeline to erase existing objects from real-world images. This creates a massive, high-fidelity dataset that teaches the model to perform the reverse operation: insertion.
The Inversion Pipeline
The core innovation of EraseDraw is its data generation strategy. By turning a generative task into a subtractive one, the authors leverage the "ground truth" of real-world photography. The pipeline consists of four main stages:
- Autonomous Labeling: A Vision-Language Model (GPT-4) identifies and describes objects within a natural image.
- Precise Localization: A grounding model (CogVLM) identifies bounding boxes, and the Segment Anything Model (SAM) generates pixel-perfect masks.
- Object Erasure: An inpainting model (LaMa) removes the identified object, filling the background realistically.
- Training: The resulting "empty" scene and the original "full" image form a training pair. A Stable Diffusion model is then fine-tuned to insert the original object back into the erased scene based on the text description.
Iterative Generation and Beam Search
Inserting multiple objects simultaneously often leads to "attribute bleeding," where characteristics of one object (e.g., color) leak into another. EraseDraw mitigates this through an iterative generation process. Rather than attempting a complex multi-object scene in one pass, the model adds objects sequentially.
To ensure the highest quality, the system employs a beam search strategy. At each step of the insertion process, the model generates multiple candidates. These candidates are ranked using CLIP scores for text alignment and visual realism. Only the top-performing version is passed to the next iteration, ensuring that errors do not compound across complex edits.
Experimental Results
The model was trained on two primary datasets: EraseDraw-15k (15,000 autonomously generated pairs) and GQA-Insert (50,000 pairs derived from scene graphs). Despite being trained on significantly less data than its competitors (65,000 images compared to 450,000 for InstructPix2Pix), EraseDraw demonstrated superior performance.
- Human Preference: In head-to-head trials, human participants preferred EraseDraw’s results 82.22% of the time compared to InstructPix2Pix.
- Affordance Learning: Because the model is trained on real photos, it learns the common-sense physics of where things belong. It understands that a fork belongs on a plate or in a hand, rather than floating in mid-air.
- Complex Physics: The model showed a surprising ability to handle difficult visual effects, such as inserting water flowing from a faucet or placing objects behind semi-transparent occluders.
Limitations and Future Directions
While EraseDraw represents a leap forward in realistic editing, it is currently constrained by its base model, Stable Diffusion 1.5. Consequently, it inherits known issues with rendering human anatomy, particularly hands and faces. Additionally, the model's spatial precision is limited; while it places objects naturally, it struggles with precise coordinate-based instructions (e.g., "place the cup exactly 2 inches from the edge").
Future research will focus on scaling the erasure pipeline to larger datasets and integrating it with more advanced architectures like SDXL or Flux to overcome current resolution and anatomical limitations.
Summary updated