ReplaceAnything3D: Text-Guided 3D Scene Editing with Compositional Neural Radiance Fields

Edward Bartrum, Thu Nguyen-Phuoc, Chris Xie, Zhengqin Li, Numair Khan, Armen Avetisyan, Douglas Lanman, Lei XiaoarXiv 2024

Abstract

We introduce ReplaceAnything3D model (RAM3D), a novel text-guided 3D scene editing method that enables the replacement of specific objects within a scene. Given multi-view images of a scene, a text prompt describing the object to replace, and a text prompt describing the new object, our Erase-and-Replace approach can effectively swap objects in the scene with newly generated content while maintaining 3D consistency across multiple viewpoints. We demonstrate the versatility of ReplaceAnything3D by applying it to various realistic 3D scenes, showcasing results of modified foreground objects that are well-integrated with the rest of the scene without affecting its overall integrity.

Introduction

While 2D image editing has been transformed by diffusion models, editing 3D scenes remains a significant challenge. Most existing 3D editing methods focus on modifying the geometry or texture of an existing object (e.g., changing a chair's color). However, these methods often fail when the desired edit requires a completely different shape.

The primary obstacle is multi-view consistency. Editing individual frames of a 3D scene using 2D tools often leads to "flickering" or shape-shifting as the camera moves. Furthermore, removing an object leaves a "hole" that must be filled with a plausible, 3D-consistent background. ReplaceAnything3D (RAM3D) addresses these issues by combining compositional Neural Radiance Fields (NeRFs) with 2D diffusion priors to achieve high-resolution, multi-view consistent object replacement.

Methodology: The Erase-and-Replace Framework

RAM3D utilizes a multi-stage approach to ensure that new objects are seamlessly integrated into existing 3D environments.

  1. Segmentation: The system identifies and masks the target object across all input views using LangSAM, a text-guided segmentation tool.
  2. 3D Inpainting (The Erase Stage): To avoid simple blurring, RAM3D performs 3D-consistent inpainting. It optimizes a "Bubble-NeRF"—a local neural field focused on the edited area. A Latent Diffusion Model (LDM) predicts the background behind the object, using a "halo" of surrounding pixels to ensure color and texture continuity.
  3. Object Generation (The Replace Stage): The new object is generated using an adapted version of HiFA, a text-to-3D distillation technique. To prevent the model from baking background details into the new object's geometry, the authors employ "random background augmentation" during training.
  4. Final NeRF Training: After generating consistent multi-view images of the edited scene, a final high-quality NeRF (using the Instant-NGP architecture) is trained for smooth novel-view synthesis.
Original scene featuring a bronze statue on a pedestal.

Key Insights

  • Compositionality: Treating foreground and background as separate entities avoids "ghosting" artifacts.
  • The "Halo" Effect: Supervising the pixels immediately surrounding the mask provides the spatial context necessary for the diffusion model to hallucinate a matching background.
  • Erase-then-Replace: By completely erasing the old object, the system is not constrained by the original geometry, allowing for radical transformations.
  • Personalization: The diffusion backbone allows for integration with techniques like DreamBooth, enabling users to replace objects with specific personalized assets (e.g., a specific pet).
The original statue replaced with a 3D-consistent octopus using a text prompt.

Evaluation and Results

The researchers evaluated RAM3D on established benchmarks including STATUE, RED-NET, FERN, and GARDEN, representing a variety of indoor and outdoor environments.

Quantitatively, RAM3D outperformed state-of-the-art methods like Instruct-NeRF2NeRF and Blended-NeRF in CLIP-based metrics, specifically achieving higher CLIP Text-Image Direction Similarity. Qualitatively, the method produces sharper results with fewer geometric artifacts ("floaters") and successfully handles complex lighting, including realistic shadow casting from new objects onto the original ground.

Limitations and Future Work

Despite its success, RAM3D has limitations. Because it erases the original object entirely, it is less suited for fine-grained edits that require preserving the original shape. It can also occasionally suffer from the "Janus problem" (multi-face artifacts). Future improvements could include adopting faster representations like 3D Gaussian Splatting to reduce the current 12-hour training time and better disentangling geometry from appearance for more precise control.

Summary updated

BibTeX
@misc{bartrum2024replaceanything,
  author = {Edward Bartrum and Thu Nguyen-Phuoc and Chris Xie and Zhengqin Li and Numair Khan and Armen Avetisyan and Douglas Lanman and Lei Xiao},
  title = {{ReplaceAnything3D: Text-Guided 3D Scene Editing with Compositional Neural Radiance Fields}},
  year = {2024},
  eprint = {2401.17895},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.17895},
}
Figure