LDM3D: Latent Diffusion Model for 3D

Gabriela Ben Melech Stan, Diana Wofk, Scottie Fox, Alex Redden, Will Saxton, Jean Yu, Estelle Aflalo, Shao-Yen Tseng, Fabio Nonato, Matthias Muller, Vasudev LalarXiv 2023

TL;DR

LDM3D introduces a latent diffusion model capable of generating both an RGB image and its corresponding depth map simultaneously from a single text prompt. By training the model to understand spatial depth alongside visual features, it enables the seamless creation of immersive 360-degree digital experiences from text alone.

What Problem Does This Paper Address?

Generative AI has mastered 2D image generation (e.g., Stable Diffusion), but translating text prompts directly into 3D environments remains a challenge. The standard workaround is a cascaded pipeline: generate a 2D image first, then pass it to an off-the-shelf monocular depth estimation model.

However, these independent depth estimators often struggle with generated images because they lack structural context during the generation process, leading to spatial inconsistencies. LDM3D solves this by co-generating RGB images and depth maps in a single model, ensuring structural harmony between the visual content and its spatial layout.

Methods

LDM3D builds on top of Stable Diffusion v1.4. To handle both image and depth data simultaneously, the authors modified the first and last convolutional layers of the KL-regularized autoencoder (KL-AE) to accommodate a 6-channel input/output (3 channels for RGB, 3 channels for the depth map). Grayscale 16-bit depth maps are unpacked into a 3-channel 8-bit format to match the RGB structure.

The U-Net diffusion model is then jointly fine-tuned in this shared low-dimensional latent space, adding a mere 9,600 parameters to the base model. Text conditioning is handled via a frozen CLIP-text encoder.

Figure 1. LDM3D overview. Illustrating the training pipeline: the 16-bit grayscale depth maps are packed into 3-channel RGB-like depth images, which are then concatenated with the RGB images along the channel dimension. This concatenated RGBD input is passed through the modified KL-AE and mapped to the latent space. Noise is added to the latent representation, which is then iteratively denoised by the U-Net model. The text prompt is encoded using a frozen CLIP-text encoder and mapped to various layers of the U-Net using cross- attention. The denoised output from the latent space is fed into the KL-decoder and mapped back to pixel space as a 6-channel RGBD output. Finally, the output is separated into an RGB image and a 16-bit grayscale depth map. Blue frame: text-to-image inference pipeline. Initiating from a Gaussian distributed noise sample in the 64x64x4-dimensional latent space. Given a text prompt, this pipeline generates an RGB image and its corresponding depth map.

To showcase the practical utility of these outputs, the authors also developed DepthFusion, an application built in TouchDesigner that projects the generated RGB image onto an equirectangular sphere and uses the depth map to dynamically displace vertices, creating interactive 360-degree stereoscopic views.

Datasets

The model was fine-tuned on a curated subset of the LAION-400M dataset consisting of approximately 9,600 tuples containing an RGB image, a text caption, and a corresponding depth map. Because LAION lacks ground-truth depth, the training depth maps were generated using the DPT-Large depth estimation model. For evaluation, the authors utilized the MS-COCO validation dataset to benchmark text-to-image quality and depth accuracy.

Key Insights and Ideas

  • Joint Latent Representation: By forcing the autoencoder and U-Net to process RGB and depth data together in the same latent space, the generation of depth becomes intrinsically tied to the image generation process. The model creates the geometry and the texture simultaneously rather than guessing depth after the fact.
  • Minimal Parameter Overhead: Adapting a massive 2D model for 3D generation usually requires heavy architectural changes. LDM3D achieves this with only 9,600 additional parameters, demonstrating that existing latent spaces can be efficiently re-purposed for multi-modal outputs.
  • Data Reparameterization Trick: Unpacking 16-bit depth maps into 3-channel 8-bit arrays allowed the authors to leverage pre-trained RGB weights without losing depth precision or altering the core network dimensions.

Key Results

  • Image Quality: LDM3D maintains image generation quality on par with standard Stable Diffusion models. On the MS-COCO dataset, LDM3D achieved a Frechet Inception Distance (FID) of 27.82, highly competitive with Stable Diffusion v1.4 (28.08) and v1.5 (27.39). Its CLIP similarity score (26.61) even slightly outperformed the baselines (26.13).
  • Depth Accuracy: Evaluated against ZoeDepth, LDM3D achieved an absolute relative error (AbsRel) of 0.0911 and a root mean squared error (RMSE) of 0.334m, closely matching its teacher model, DPT-Large (AbsRel: 0.0779, RMSE: 0.297m).
Figure 3. Qualitative comparison of images to Stable diffusion v1.4 [20] and depth maps to DPT-Large [18, 19], on 512 × 512 images from the COCO validation dataset. Captions from top to bottom:”a close up of a sheet of pizza on a table”, ”A picture of some lemons on a table”, ”A little girl with a pink bow in her hair eating broccoli”, ”A man is on a path riding a horse”,”A muffin in a black muffin wrap next to a fork”, ”a white polar bear drinking water from a water source next to some rocks”.

Limitations and Future Work

The authors noted a slight decline in the reconstruction quality of the autoencoder (relative FID increased from 0.763 to 1.966). This is due to the increased data compression ratio: the model compresses 6 channels (RGB + Depth) into the same latent space dimensions originally designed for just 3 channels. Future work will focus on optimizing the autoencoder architecture to better balance reconstruction fidelity and generative capabilities without bottlenecking the latent space.

Summary updated

BibTeX
@misc{stan2023ldm,
  author = {Gabriela Ben Melech Stan and Diana Wofk and Scottie Fox and Alex Redden and Will Saxton and Jean Yu and Estelle Aflalo and Shao-Yen Tseng and Fabio Nonato and Matthias Muller and Vasudev Lal},
  title = {{LDM3D: Latent Diffusion Model for 3D}},
  year = {2023},
  eprint = {2305.10853},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.10853},
}
Figure