Zerocomp: Zero-shot object compositing from image intrinsics via diffusion

Zitian Zhang, Frédéric Fortier-Chouinard, Mathieu Garon, Anand Bhattad, Jean-Francois Lalonde · DOI · OpenReview

Abstract

We present ZeroComp, an effective zero-shot 3D object compositing approach that does not require paired composite-scene images during training. Our method leverages ControlNet to condition from intrinsic images and combines it with a Stable Diffusion model to utilize its scene priors, together operating as an effective rendering engine. During training, ZeroComp uses intrinsic images based on geometry, albedo, and masked shading, all without the need for paired images of scenes with and without composite objects. Once trained, it seamlessly integrates virtual 3D objects into scenes, adjusting shading to create realistic composites. We developed a high-quality evaluation dataset and demonstrate that ZeroComp outperforms methods using explicit lighting estimations and generative techniques in quantitative and human perception benchmarks. Additionally, ZeroComp extends to real and outdoor image compositing, even when trained solely on synthetic indoor data, showcasing its effectiveness in image compositing.

Introduction

Object compositing—the seamless integration of a virtual object into a real-world photograph—is a fundamental task in visual effects, augmented reality, and e-commerce. Achieving realism requires the virtual object to exhibit consistent lighting, shadows, and reflections with its environment. Traditionally, this process relies on Image-Based Lighting (IBL) pipelines, which involve complex steps such as HDR light probe estimation, geometry reconstruction, and manual rendering.

While recent generative models like Stable Diffusion (SD) have shown promise in image editing, they often fail to maintain "object permanence." These models prioritize global image coherence, frequently altering the geometry, pose, or texture of the inserted object to make it "fit" the scene. The core challenge lies in achieving environmental "fit" (lighting and shadows) while strictly preserving the object’s identity and geometry.

Methodology: Diffusion as a Neural Renderer

ZeroComp addresses these challenges by treating a diffusion model as a "neural renderer." Instead of training on scarce paired data (scenes with and without objects), the model is trained on a proxy task: reconstructing a scene from its intrinsic components.

Overview of the ZeroComp pipeline showing the target image, the extracted intrinsic maps for the object, and the final predicted composite.

1. Intrinsic Map Conditioning

The model utilizes ControlNet to condition Stable Diffusion 2.1 on four key intrinsic layers:

  • Depth: Captures the spatial layout and distance from the camera.
  • Surface Normals: Defines the orientation of surfaces, crucial for calculating light interaction.
  • Albedo: Represents the base color and texture of surfaces, independent of lighting.
  • Shading: Encapsulates how light interacts with the geometry.
The relationship between the 3D object mesh and its corresponding intrinsic maps (depth, normals, albedo).

2. The Shading Inpainting Task

During training, portions of the shading map are randomly masked. The model must learn to "reason" about the scene's lighting and geometry (provided by the other intrinsic maps) to fill in the missing shadows and highlights. This training strategy allows the model to learn the physics of light without ever seeing a "before-and-after" compositing example.

3. Inference and Differential Compositing

To composite a new object, the background's intrinsics are extracted using off-the-shelf estimators (e.g., ZoeDepth), while the object's intrinsics are rendered in the desired pose using a standard graphics engine like Blender. The shading for the object's region is marked as "Unknown."

To prevent the diffusion model from altering the original background pixels, ZeroComp employs differential compositing. By comparing the model's output with and without the object, a "shadow opacity ratio" is calculated and applied back to the original background photograph, ensuring background fidelity while adding realistic shadows.

Experiments and Results

The model was trained exclusively on the OpenRooms synthetic dataset. Evaluation was conducted on a new benchmark combining Laval Indoor HDR backgrounds with ABO (Amazon Berkeley Objects) models, providing 213 high-quality composites with physically-based ground truths.

Key Findings

  • Human Perception: In a Two-Alternative Forced Choice (2AFC) study, ZeroComp achieved a 45% confusion rate against ground-truth physical renders (where 50% is indistinguishable). This significantly outperformed existing methods like EMLight (41.5%).
  • Quantitative Performance: ZeroComp consistently outperformed state-of-the-art lighting estimation and generative compositing methods across PSNR, SSIM, and LPIPS metrics.
  • Generalization: Despite being trained on synthetic indoor data, the model generalizes to real-world and outdoor scenes, indicating it has learned universal principles of light transport.

Conclusion

ZeroComp demonstrates that diffusion models, when properly constrained by intrinsic geometric and photometric maps, can serve as powerful neural renderers for object compositing. By bypassing explicit lighting estimation and focusing on shading inpainting, it achieves a new state-of-the-art in zero-shot realistic compositing while maintaining strict object identity.

Summary updated

BibTeX
@misc{zhang2024zerocomp,
  author = {Zitian Zhang and Frédéric Fortier-Chouinard and Mathieu Garon and Anand Bhattad and Jean-Francois Lalonde},
  title = {{Zerocomp: Zero-shot object compositing from image intrinsics via diffusion}},
  year = {2024},
  eprint = {2410.08168},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.08168},
}
Figure