# luciddreamer-cvlab/luciddreamer architecture

> Architecture diagram of the GitHub repository luciddreamer-cvlab/luciddreamer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/luciddreamer-cvlab/luciddreamer
- Repository: https://github.com/luciddreamer-cvlab/luciddreamer

## Overview

LucidDreamer is the primary product: it expands a conditioned image into a 3D Gaussian scene and renders RGB/depth video along a camera path. The repository also includes ZoeDepth as a separate metric-depth model with prediction and image-to-3D demo tabs, plus dataset/model/training components. Edges follow the README or shown imports and calls; unsampled CLI and ZoeDepth training internals are represented without speculative call chains.

Main entry points: [`luciddreamer.py`](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/luciddreamer.py) (LucidDreamer), [`ZoeDepth/ui/app.py`](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/app.py) (ZoeDepth demo), [`gaussian_renderer/__init__.py`](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/gaussian_renderer/__init__.py) (Gaussian renderer), [`ZoeDepth/zoedepth/models/builder.py`](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/builder.py) (Model builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dream["Scene generation"]
  node_cli["CLI entry<br/>[run.py]"]
  node_web["Gradio demo<br/>[app.py]"]
  node_dreamer["LucidDreamer<br/>[luciddreamer.py]"]
  node_inpaint["Image inpainting<br/>[lama.py]"]
  node_depthutils["Depth utilities<br/>[depth.py]"]
  node_trajectory["Camera paths<br/>[trajectory.py]"]
  node_results["RGB/depth video<br/>[luciddreamer.py]"]
end

subgraph group_splat["Gaussian scene"]
  node_dataset["Scene inputs<br/>[dataset_readers.py]"]
  node_cameras["Camera models<br/>[cameras.py]"]
  node_gaussians["Gaussian model<br/>[gaussian_model.py]"]
  node_renderer["Gaussian renderer<br/>[__init__.py]"]
  node_rasterizer["Depth rasterizer<br/>[__init__.py]"]
end

subgraph group_depth["ZoeDepth estimation"]
  node_zoeui["ZoeDepth demo<br/>[app.py]"]
  node_depthtab["Depth prediction"]
  node_im3d["Image to 3D<br/>[gradio_im_to_3d.py]"]
  node_pano3d["Panorama to 3D"]
  node_builder["Model builder<br/>[builder.py]"]
  node_depthmodel["Depth model<br/>[depth_model.py]"]
  node_zoemodel["ZoeDepth variants<br/>[zoedepth_nk_v1.py]"]
  node_modelio["Model I/O<br/>[model_io.py]"]
end

subgraph group_data["Depth model data and training"]
  node_config["Model configuration<br/>[config.py]"]
  node_monodata["Monocular datasets<br/>[data_mono.py]"]
  node_trainer["Training runtime<br/>[base_trainer.py]"]
end

node_user(("User"))

node_user -->|"runs"| node_cli
node_user -->|"opens"| node_web
node_cli -.->|"starts generation"| node_dreamer
node_web -->|"invokes"| node_dreamer
node_dreamer -->|"uses inpainting"| node_inpaint
node_dreamer -->|"uses depth"| node_depthutils
node_dreamer -->|"uses paths"| node_trajectory
node_dreamer -->|"loads scene data"| node_dataset
node_dreamer -->|"optimizes"| node_gaussians
node_dreamer -->|"renders views"| node_renderer
node_dreamer -->|"uses camera"| node_cameras
node_renderer -->|"reads attributes"| node_gaussians
node_renderer -->|"reads transforms"| node_cameras
node_renderer -->|"rasterizes"| node_rasterizer
node_dreamer -->|"returns videos"| node_results
node_user -->|"opens demo"| node_zoeui
node_zoeui -.->|"loads pretrained model"| node_builder
node_zoeui -->|"registers tab"| node_depthtab
node_zoeui -->|"registers tab"| node_im3d
node_zoeui -->|"registers tab"| node_pano3d
node_builder -->|"constructs"| node_depthmodel
node_zoemodel -->|"extends"| node_depthmodel
node_zoemodel -->|"loads weights"| node_modelio
node_builder -.->|"selects variant"| node_zoemodel
node_monodata -->|"reads settings"| node_config
node_trainer -->|"reads settings"| node_config
node_trainer -->|"saves model"| node_modelio

click node_cli "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/run.py"
click node_web "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/app.py"
click node_dreamer "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/luciddreamer.py"
click node_inpaint "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/utils/lama.py"
click node_depthutils "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/utils/depth.py"
click node_trajectory "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/utils/trajectory.py"
click node_dataset "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/scene/dataset_readers.py"
click node_cameras "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/scene/cameras.py"
click node_gaussians "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/scene/gaussian_model.py"
click node_renderer "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/gaussian_renderer/__init__.py"
click node_rasterizer "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/submodules/depth-diff-gaussian-rasterization-min/depth_diff_gaussian_rasterization_min/__init__.py"
click node_results "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/luciddreamer.py"
click node_zoeui "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/app.py"
click node_depthtab "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/gradio_depth_pred.py"
click node_im3d "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/gradio_im_to_3d.py"
click node_pano3d "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/gradio_pano_to_3d.py"
click node_builder "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/builder.py"
click node_depthmodel "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/depth_model.py"
click node_zoemodel "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py"
click node_modelio "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/model_io.py"
click node_config "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/utils/config.py"
click node_monodata "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/data/data_mono.py"
click node_trainer "https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/trainers/base_trainer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_web,node_dreamer,node_inpaint,node_depthutils,node_trajectory,node_results,node_user toneBlue
class node_dataset,node_cameras,node_gaussians,node_renderer,node_rasterizer toneAmber
class node_zoeui,node_depthtab,node_im3d,node_pano3d,node_builder,node_depthmodel,node_zoemodel,node_modelio toneMint
class node_config,node_monodata,node_trainer toneRose
```

## Components

### Scene generation

- [CLI entry](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/run.py): `run.py`
- [Gradio demo](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/app.py): `app.py`
- [LucidDreamer](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/luciddreamer.py): `luciddreamer.py`
- [Image inpainting](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/utils/lama.py): `utils/lama.py`
- [Depth utilities](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/utils/depth.py): `utils/depth.py`
- [Camera paths](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/utils/trajectory.py): `utils/trajectory.py`
- [RGB/depth video](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/luciddreamer.py): `luciddreamer.py`

### Gaussian scene

- [Scene inputs](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/scene/dataset_readers.py): `scene/dataset_readers.py`
- [Camera models](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/scene/cameras.py): `scene/cameras.py`
- [Gaussian model](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/scene/gaussian_model.py): `scene/gaussian_model.py`
- [Gaussian renderer](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/gaussian_renderer/__init__.py): `gaussian_renderer/__init__.py`
- [Depth rasterizer](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/submodules/depth-diff-gaussian-rasterization-min/depth_diff_gaussian_rasterization_min/__init__.py): `submodules/depth-diff-gaussian-rasterization-min/depth_diff_gaussian_rasterization_min/__init__.py`

### ZoeDepth estimation

- [ZoeDepth demo](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/app.py): `ZoeDepth/ui/app.py`
- [Depth prediction](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/gradio_depth_pred.py): `ZoeDepth/ui/gradio_depth_pred.py`
- [Image to 3D](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/gradio_im_to_3d.py): `ZoeDepth/ui/gradio_im_to_3d.py`
- [Panorama to 3D](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/ui/gradio_pano_to_3d.py): `ZoeDepth/ui/gradio_pano_to_3d.py`
- [Model builder](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/builder.py): `ZoeDepth/zoedepth/models/builder.py`
- [Depth model](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/depth_model.py): `ZoeDepth/zoedepth/models/depth_model.py`
- [ZoeDepth variants](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py): `ZoeDepth/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py`
- [Model I/O](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/models/model_io.py): `ZoeDepth/zoedepth/models/model_io.py`

### Depth model data and training

- [Model configuration](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/utils/config.py): `ZoeDepth/zoedepth/utils/config.py`
- [Monocular datasets](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/data/data_mono.py): `ZoeDepth/zoedepth/data/data_mono.py`
- [Training runtime](https://github.com/luciddreamer-cvlab/luciddreamer/blob/main/ZoeDepth/zoedepth/trainers/base_trainer.py): `ZoeDepth/zoedepth/trainers/base_trainer.py`

### Other components

- **User**

## Connections

- User → CLI entry: runs (evidence: `README.md`)
- User → Gradio demo: opens (evidence: `README.md`)
- CLI entry → LucidDreamer: starts generation
- Gradio demo → LucidDreamer: invokes (evidence: `app.py`)
- LucidDreamer → Image inpainting: uses inpainting (evidence: `luciddreamer.py`)
- LucidDreamer → Depth utilities: uses depth (evidence: `luciddreamer.py`)
- LucidDreamer → Camera paths: uses paths (evidence: `luciddreamer.py`)
- LucidDreamer → Scene inputs: loads scene data (evidence: `luciddreamer.py`)
- LucidDreamer → Gaussian model: optimizes (evidence: `luciddreamer.py`)
- LucidDreamer → Gaussian renderer: renders views (evidence: `luciddreamer.py`)
- LucidDreamer → Camera models: uses camera (evidence: `luciddreamer.py`)
- Gaussian renderer → Gaussian model: reads attributes (evidence: `gaussian_renderer/__init__.py`)
- Gaussian renderer → Camera models: reads transforms (evidence: `gaussian_renderer/__init__.py`)
- Gaussian renderer → Depth rasterizer: rasterizes (evidence: `gaussian_renderer/__init__.py`)
- LucidDreamer → RGB/depth video: returns videos (evidence: `luciddreamer.py`)
- User → ZoeDepth demo: opens demo (evidence: `ZoeDepth/ui/app.py`)
- ZoeDepth demo → Model builder: loads pretrained model
- ZoeDepth demo → Depth prediction: registers tab (evidence: `ZoeDepth/ui/app.py`)
- ZoeDepth demo → Image to 3D: registers tab (evidence: `ZoeDepth/ui/app.py`)
- ZoeDepth demo → Panorama to 3D: registers tab (evidence: `ZoeDepth/ui/app.py`)
- Model builder → Depth model: constructs (evidence: `ZoeDepth/zoedepth/models/builder.py`)
- ZoeDepth variants → Depth model: extends (evidence: `ZoeDepth/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py`)
- ZoeDepth variants → Model I/O: loads weights (evidence: `ZoeDepth/zoedepth/models/zoedepth_nk/zoedepth_nk_v1.py`)
- Model builder → ZoeDepth variants: selects variant
- Monocular datasets → Model configuration: reads settings (evidence: `ZoeDepth/zoedepth/data/data_mono.py`)
- Training runtime → Model configuration: reads settings (evidence: `ZoeDepth/zoedepth/trainers/base_trainer.py`)
- Training runtime → Model I/O: saves model (evidence: `ZoeDepth/zoedepth/trainers/base_trainer.py`)
