Abstract
Traditional generative object compositing methods are often restricted by strict user-provided masks or bounding boxes, which limits the model's ability to generate realistic environmental effects like shadows and reflections. This paper introduces a diffusion-based framework for unconstrained generative object compositing. By treating input masks as suggestions rather than hard constraints, the model can automatically place objects in natural locations and generate realistic environmental interactions that extend far beyond the initial placement area.
Introduction
Image compositing—the process of inserting a foreground object into a new background—requires seamless alignment, scaling, and harmonization. While diffusion-based models have advanced this field, they typically suffer from a "mask bottleneck." Because these models are trained to generate content only within a user-provided boundary, they often produce "floating" objects lacking natural shadows or reflections that should extend into the background. Furthermore, the manual effort required to create precise masks is a significant barrier for users.
Methodology
Data Generation Pipeline
To enable the model to generate effects beyond a mask, the authors developed a novel training pipeline. They identify objects and their associated environmental effects in natural images, then use a combination of GAN-based and diffusion-based inpainting to remove the object entirely. This creates a "clean" background paired with the original foreground object, allowing the model to learn how to reconstruct the object and its environmental context simultaneously.
Model Architecture
The framework is built upon a Stable Diffusion 1.5 backbone with two primary innovations:
- Multiscale Object Encoding: The foreground object is processed at four scales (1.0, 0.75, 0.5, and 0.25) using a shared CLIP ViT-L/14 encoder. Averaging these multiscale embeddings allows the model to capture both fine-grained details and high-level structural information, ensuring the object is scaled correctly within the scene.
- Flexible Positioning: The model accepts an optional position mask. If a mask is provided, it serves as a rough guide; if an "empty" mask is provided, the model automatically predicts a semantically sensible location and scale for the object.
Training Strategy
The authors employed a six-stage training strategy, balancing diversity and identity preservation. By perturbing bounding boxes during training, the model learns to prioritize scene geometry over strict mask adherence, allowing for minor adjustments in object positioning to better fit the background.
Evaluation and Results
The model was evaluated against state-of-the-art (SotA) baselines like AnyDoor and ObjectStitch using datasets including DreamBooth, Pixabay-Comp, and the Object Placement Assessment (OPA) dataset.
- Composition Quality: User studies revealed an 89.3% preference rate for the proposed model's composition quality and 87.4% for identity faithfulness compared to baselines.
- Placement Rationality: On the OPA dataset, the model achieved a 65.4% IoU > 0.5, nearly doubling the performance of specialized placement models.
- Visual Realism: The model demonstrates a unique capability to generate long shadows on complex surfaces and reflections on water, which are typically truncated by mask-bounded models.
Conclusion and Future Work
While the model represents a significant step forward in unconstrained compositing, challenges remain in global relighting—where the model may unintentionally alter the entire background to match the object's lighting—and complex lateral reflections. Future research will focus on incorporating lighting perturbations during training and utilizing symmetric object masks to improve mirror-plane reflections.
Summary updated