Abstract
Subject-driven image generation aims at generating images containing customized subjects, which has recently drawn enormous attention from the research community. Nevertheless, the previous works cannot precisely control the background and position of the target subject. In this work, we aspire to fill the void of the existing subject-driven generation tasks. To this end, we propose two novel subject-driven editing sub-tasks, i.e., Subject Replacement and Subject Addition. The new tasks are challenging in multiple aspects: replacing a subject with a customized one can totally change its shape, texture, and color, while adding a target subject to a designated position in a provided scene necessitates a rational context-aware posture of the subject. To conquer these two novel tasks, we first manually curate a new dataset called DreamEditBench containing 22 different types of subjects, and 440 source images, which cover diverse scenarios with different difficulty levels. We also devise an innovative method DreamEditor to resolve these tasks by performing iterative generation, which enables a smooth adaptation to the customized subject. Our evaluations show that DreamEditor significantly outperforms existing models on the challenging DreamEditBench.
Introduction
While AI can now generate stunning images from text, fine-grained control remains a significant hurdle. Current research typically falls into two categories: subject-driven generation (like DreamBooth), which recreates specific objects but lacks spatial control or background preservation, and text-guided editing (like DiffEdit), which modifies scenes but fails to insert specific, user-owned 3D objects.
DreamEdit addresses this gap by defining Subject-driven Image Editing. This encompasses two primary sub-tasks:
- Subject Replacement: Swapping an existing object in a photo for a specific customized subject (e.g., replacing a generic dog with your own pet).
- Subject Addition: Placing a customized subject into a specific location within an empty scene.
The DreamEditor Framework
To solve these tasks, the authors propose DreamEditor, an iterative "infill-then-generate" framework. The process involves four key stages:
- Personalization: Fine-tuning a text-to-image model (Stable Diffusion) using DreamBooth on a few images of the target subject to associate it with a unique identifier (e.g., "[V] dog").
- Initialization: For Subject Addition, the model uses GLIGEN to create a rough placeholder of the subject within a user-defined bounding box, providing a geometric hint.
- Iterative In-painting: This is the core innovation. Instead of a single pass, DreamEditor performs multiple rounds of editing. It uses Segment-Anything (SAM) for precise masking and DDIM inversion to map the image back into the latent space before re-painting with the personalized token.
- Refinement: By repeating this process 2–3 times, the model gradually eliminates "ghosting" artifacts from the original object and harmonizes the new subject's pose and lighting with the background.
DreamEditBench
The researchers introduced DreamEditBench, a standardized benchmark featuring 22 subject types and 440 source images. Images are categorized by difficulty ("Easy" vs. "Hard") based on the discrepancy in color, shape, and perspective between the source and target.
Results and Insights
DreamEditor significantly outperformed baselines in human evaluations. In Subject Replacement, it achieved a human score of 0.664, vastly exceeding standard DreamBooth (0.072). For Subject Addition, it scored 0.626, nearly doubling the performance of the next best baseline, PhotoSwap (0.33).
Key findings include:
- The "Ghosting" Problem: Single-pass edits often leave remnants of the original subject. Iteration acts as a corrective loop for boundaries and textures.
- Realism vs. Consistency: While "Copy-Paste" methods maintain high subject identity, they fail on realism. DreamEditor ensures subjects interact naturally with their environment (e.g., shadows and physical contact).
- Initialization is Critical: Starting from a rough geometric hint (like a GLIGEN placeholder) is essential for generating grounded, context-aware poses.
Limitations
Despite its success, DreamEditor faces challenges. Iterative processing can accumulate errors from segmentation or inversion, occasionally leading to background blurring. Additionally, the computational cost is higher than single-pass methods, and extreme differences in aspect ratios between source and target subjects remain difficult to reconcile perfectly.
Summary updated