Abstract
This paper introduces BIFRÖST, a novel 3D-aware framework built upon diffusion models to perform instruction-based image composition. Previous methods concentrate on image compositing at the 2D level, which fall short in handling complex spatial relationships (e.g., occlusion). BIFRÖST addresses these issues by training a Multi-modal Large Language Model (MLLM) as a 2.5D location predictor and integrating depth maps as an extra condition during the generation process. This bridges the gap between 2D and 3D, enhancing spatial comprehension and supporting sophisticated spatial interactions. Our method begins by fine-tuning an MLLM with a custom counterfactual dataset to predict 2.5D object locations in complex backgrounds from language instructions. Then, the image-compositing model is uniquely designed to process multiple types of input features, enabling it to perform high-fidelity image compositions that consider occlusion, depth blur, and image harmonization. Extensive qualitative and quantitative evaluations demonstrate that BIFRÖST significantly outperforms existing methods, providing a robust solution for generating realistically composited images in scenarios demanding intricate spatial understanding.
Introduction
In the field of image editing, "compositing"—the act of taking an object from one image and seamlessly blending it into another—has long been a primary objective. While recent diffusion models have made significant strides in generating realistic images, they often treat compositing as a 2D task, struggling with the third dimension. For instance, placing an object behind another or ensuring correct perspective remains a challenge for models that lack a fundamental understanding of 3D geometry. This lack of spatial awareness often leads to "floaty" objects or physically impossible overlaps.
BIFRÖST addresses these limitations by bridging the gap between 2D image generation and 3D spatial awareness using natural language instructions. By replacing manual masking with simple language commands (e.g., "place the cat behind the chair"), BIFRÖST simplifies the user experience while improving the physical realism of the output.
Methodology
The BIFRÖST framework employs a two-stage pipeline designed to integrate spatial reasoning into the generative process:
- 2.5D Location Prediction: The researchers fine-tuned an MLLM (specifically LLaVA) to act as a spatial reasoning engine. Given a background image and a text instruction, the MLLM predicts a 2.5D coordinate consisting of a 2D bounding box and a relative depth value. This depth value is critical for determining the object's position within the 3D stack of the scene.
- 3D-Aware Generation: A diffusion model (Stable Diffusion V2.1) then performs the composition. To ensure high fidelity, the model utilizes three distinct inputs: an ID Extractor (DINO-v2) to preserve the reference object's identity, a Detail Extractor for fine textures, and a Depth Extractor. By integrating depth maps as a condition, the model can naturally render occlusions and maintain correct perspective.
Data and Training
To train the model in spatial reasoning, the authors developed a 2.5D Counterfactual Dataset. They utilized images from MS COCO, identified objects, recorded their depth and location, and then "erased" them using inpainting. GPT-3 was then used to generate instructions to "put the object back" based on its original spatial relationship. This resulted in over 30,000 image-instruction pairs. For the final compositing stage, the model was trained on a variety of high-quality datasets including YouTubeVOS, MOSE, and SAM.
Results and Discussion
BIFRÖST significantly outperforms existing state-of-the-art (SOTA) models in both quantitative and qualitative evaluations. Quantitatively, it achieved a DINO-score of 77.7 and a lower FID of 15.0, indicating superior identity preservation and image realism. In user studies, BIFRÖST was rated significantly higher in "3D Awareness" (4.21/5.0) compared to competing models.
Qualitatively, the model excels at tasks such as "Identity Transfer" and "Identity Preserved Inpainting," maintaining the object's unique characteristics while adapting its pose and orientation to match the target scene's geometry.
Conclusion
BIFRÖST introduces a robust solution for 3D-aware image compositing by effectively utilizing 2.5D depth information and MLLMs. While the model shows exceptional performance, future work will address challenges in extremely complex, cluttered environments and explore more flexible depth control mechanisms to further enhance generative diversity.
Summary updated