Abstract
We introduce ObjectAdd, a training-free diffusion modification method designed to add user-specified objects into defined areas of an image while maintaining global consistency. Existing generative models often struggle with iterative editing, where adding a single element can inadvertently alter the entire scene. ObjectAdd addresses this through three key innovations: embedding-level concatenation for text processing, object-driven layout control via latent and attention injection, and a novel prompted image inpainting technique using attention refocusing. Our method ensures that the added object blends flawlessly into the specified region while the rest of the image remains unchanged.
Introduction
The "final boss" of generative AI is iterative image editing. While state-of-the-art models like Stable Diffusion can generate high-quality images from scratch, they often fail at localized modifications. For instance, asking a model to "add a hat" to a generated portrait frequently results in a completely different person or background. This global inconsistency occurs because the self-attention mechanism in diffusion models re-evaluates every pixel when the prompt changes.
ObjectAdd provides a "Photoshop-like" control using only text prompts and a bounding box. Unlike methods that require fine-tuning or pre-defined layouts, ObjectAdd is training-free and operates by modifying the diffusion process itself to stitch new objects into existing images with surgical precision.
Methodology
ObjectAdd introduces three technical pillars to achieve seamless object insertion:
- Embedding-level Concatenation: To prevent the "new object" description from corrupting the original scene's representation, the system encodes the original and new prompts separately before concatenating their high-dimensional embeddings.
- Object-Driven Layout Control: The method ensures the object appears in the correct location through Latent Injection (pasting object representations into the latent space early in the process) and Attention Injection (boosting attention scores for the object's keywords within the bounding box).
- Prompted Image Inpainting (Attention Refocusing): Rather than relying on a rigid user-drawn box, ObjectAdd analyzes internal attention maps to identify where the model naturally places the object.
This "attention refocusing" technique, illustrated above, allows for the creation of a perfect "fusion zone" where the new object meets the original background, avoiding the harsh edges typical of traditional inpainting.
Key Insights
A critical finding of the research is that timing is essential. Layout control is most effective when applied only during the initial stages of generation—specifically, the first 20% of steps for latent injection and 30% for attention injection. This sets the "DNA" of the image without degrading overall quality. Furthermore, by avoiding training-heavy techniques like LoRA, ObjectAdd remains a lightweight solution compatible with standard diffusion pipelines.
Results and Evaluation
The researchers evaluated ObjectAdd against models like DALL-E 3 and InstructPix2Pix using a custom dataset of 320 prompts and 229 specific editing tasks.
ObjectAdd demonstrated superior performance in both quantitative and qualitative metrics:
- Background Preservation: It achieved a lower "By Pixels" change score (10.219) compared to InstructPix2Pix (11.393), proving better background stability.
- Text Alignment: It reached the highest CLIP Score (19.424), indicating the added objects closely matched user descriptions.
- Identity Consistency: As shown in the figure above, ObjectAdd can add complex accessories like hats or glasses while keeping the subject's facial features and the background exactly the same.
Conclusion
ObjectAdd represents a significant step toward precise, iterative AI image editing. While it is currently limited by the knowledge of its base model (Stable Diffusion v1-4) and can struggle with extremely complex spatial logic, its training-free nature makes it highly accessible. Future work may involve integrating vision-language models like BLIP to automate prompt generation, further simplifying the user experience.
Summary updated