# deepseek-ai/dreamcraft3d architecture

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

- Interactive diagram: https://gitdiagram.com/deepseek-ai/dreamcraft3d
- Repository: https://github.com/deepseek-ai/dreamcraft3d

## Overview

DreamCraft3D turns a reference image and text prompt into a coherent textured 3D object through coarse geometry, geometry refinement, and texture refinement. The documented workflow preprocesses the image, trains successive scene representations with view-dependent diffusion guidance, then exports a mesh. The README also describes optional personalized diffusion training from generated multi-view images. Source excerpts establish key system, dataset, geometry, renderer, and guidance components; some subsystem links below reflect documented workflow rather than inspected call sites.

Main entry points: [`threestudio/systems/dreamcraft3d.py`](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/systems/dreamcraft3d.py) (DreamCraft system), [`threestudio/models/renderers/nerf_volume_renderer.py`](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/renderers/nerf_volume_renderer.py) (Volume renderer), [`launch.py`](https://github.com/deepseek-ai/dreamcraft3d/blob/main/launch.py) (Training launcher), [`threestudio/models/geometry/implicit_sdf.py`](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/geometry/implicit_sdf.py) (Scene geometry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Inputs and setup"]
  node_reference["Reference image"]
  node_preprocess["Image preprocessing"]
  node_config["Experiment config<br/>[config.py]"]
  node_trainer["Training launcher<br/>[launch.py]"]
  node_image_data["Image dataset<br/>[image.py]"]
  node_camera_data["Camera sampling<br/>[uncond.py]"]
end

subgraph group_generation["Scene generation"]
  node_system["DreamCraft system<br/>[dreamcraft3d.py]"]
  node_system_base["Training lifecycle<br/>[base.py]"]
  node_geometry["Scene geometry<br/>[implicit_sdf.py]"]
  node_networks["Neural networks<br/>[networks.py]"]
  node_renderer["Volume renderer"]
  node_materials["Scene materials"]
end

subgraph group_guidance["Diffusion guidance"]
  node_prompt["Prompt processing<br/>[base.py]"]
  node_diffusion_guidance["Diffusion guidance"]
  node_zero123["Zero123 prior"]
  node_diffusion_core["Latent diffusion core<br/>[ddpm.py]"]
end

subgraph group_output["Export and personalization"]
  node_personalized_model["Personalized diffusion"]
  node_mesh_export["Mesh exporter<br/>[mesh_exporter.py]"]
  node_artifacts["3D output"]
  node_multiview["Multi-view generation<br/>[img_to_mv.py]"]
end

node_user(("Creator"))

node_user -->|"provides"| node_reference
node_reference -->|"preprocesses"| node_preprocess
node_user -->|"starts training"| node_trainer
node_config -->|"configures"| node_trainer
node_image_data -.->|"supplies reference"| node_system
node_camera_data -.->|"samples views"| node_system
node_trainer -->|"trains stages"| node_system
node_system -->|"extends"| node_system_base
node_system -->|"optimizes scene"| node_geometry
node_system -->|"renders views"| node_renderer
node_system -->|"requests guidance"| node_diffusion_guidance
node_system -->|"uses 3D prior"| node_zero123
node_system -.->|"conditions on prompt"| node_prompt
node_geometry -->|"uses networks"| node_networks
node_renderer -->|"queries geometry"| node_geometry
node_renderer -->|"shades samples"| node_materials
node_diffusion_guidance -.->|"uses diffusion"| node_diffusion_core
node_zero123 -.->|"uses diffusion"| node_diffusion_core
node_system -->|"exports mesh"| node_mesh_export
node_mesh_export -->|"writes mesh"| node_artifacts
node_reference -->|"generates views"| node_multiview
node_multiview -->|"trains on renders"| node_personalized_model
node_personalized_model -->|"personalizes prior"| node_diffusion_guidance

click node_preprocess "https://github.com/deepseek-ai/dreamcraft3d/blob/main/preprocess_image.py"
click node_config "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/utils/config.py"
click node_trainer "https://github.com/deepseek-ai/dreamcraft3d/blob/main/launch.py"
click node_image_data "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/data/image.py"
click node_camera_data "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/data/uncond.py"
click node_system "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/systems/dreamcraft3d.py"
click node_system_base "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/systems/base.py"
click node_geometry "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/geometry/implicit_sdf.py"
click node_networks "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/networks.py"
click node_renderer "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/renderers/nerf_volume_renderer.py"
click node_materials "https://github.com/deepseek-ai/dreamcraft3d/tree/main/threestudio/models/materials"
click node_prompt "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/prompt_processors/base.py"
click node_diffusion_guidance "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/guidance/stable_diffusion_bsd_guidance.py"
click node_zero123 "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/guidance/zero123_guidance.py"
click node_diffusion_core "https://github.com/deepseek-ai/dreamcraft3d/blob/main/extern/ldm_zero123/models/diffusion/ddpm.py"
click node_personalized_model "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/scripts/train_dreambooth_lora.py"
click node_mesh_export "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/exporters/mesh_exporter.py"
click node_multiview "https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/scripts/img_to_mv.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_reference,node_preprocess,node_config,node_trainer,node_image_data,node_camera_data toneBlue
class node_system,node_system_base,node_geometry,node_networks,node_renderer,node_materials toneAmber
class node_prompt,node_diffusion_guidance,node_zero123,node_diffusion_core toneMint
class node_personalized_model,node_mesh_export,node_artifacts,node_multiview toneRose
class node_user toneIndigo
```

## Components

### Inputs and setup

- **Reference image**
- [Image preprocessing](https://github.com/deepseek-ai/dreamcraft3d/blob/main/preprocess_image.py): `preprocess_image.py`
- [Experiment config](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/utils/config.py): `threestudio/utils/config.py`
- [Training launcher](https://github.com/deepseek-ai/dreamcraft3d/blob/main/launch.py): `launch.py`
- [Image dataset](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/data/image.py): `threestudio/data/image.py`
- [Camera sampling](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/data/uncond.py): `threestudio/data/uncond.py`

### Scene generation

- [DreamCraft system](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/systems/dreamcraft3d.py): `threestudio/systems/dreamcraft3d.py`
- [Training lifecycle](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/systems/base.py): `threestudio/systems/base.py`
- [Scene geometry](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/geometry/implicit_sdf.py): `threestudio/models/geometry/implicit_sdf.py`
- [Neural networks](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/networks.py): `threestudio/models/networks.py`
- [Volume renderer](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/renderers/nerf_volume_renderer.py): `threestudio/models/renderers/nerf_volume_renderer.py`
- [Scene materials](https://github.com/deepseek-ai/dreamcraft3d/tree/main/threestudio/models/materials): `threestudio/models/materials`

### Diffusion guidance

- [Prompt processing](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/prompt_processors/base.py): `threestudio/models/prompt_processors/base.py`
- [Diffusion guidance](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/guidance/stable_diffusion_bsd_guidance.py): `threestudio/models/guidance/stable_diffusion_bsd_guidance.py`
- [Zero123 prior](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/guidance/zero123_guidance.py): `threestudio/models/guidance/zero123_guidance.py`
- [Latent diffusion core](https://github.com/deepseek-ai/dreamcraft3d/blob/main/extern/ldm_zero123/models/diffusion/ddpm.py): `extern/ldm_zero123/models/diffusion/ddpm.py`

### Export and personalization

- [Personalized diffusion](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/scripts/train_dreambooth_lora.py): `threestudio/scripts/train_dreambooth_lora.py`
- [Mesh exporter](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/models/exporters/mesh_exporter.py): `threestudio/models/exporters/mesh_exporter.py`
- **3D output**
- [Multi-view generation](https://github.com/deepseek-ai/dreamcraft3d/blob/main/threestudio/scripts/img_to_mv.py): `threestudio/scripts/img_to_mv.py`

### Other components

- **Creator**

## Connections

- Creator → Reference image: provides
- Reference image → Image preprocessing: preprocesses
- Creator → Training launcher: starts training
- Experiment config → Training launcher: configures
- Image dataset → DreamCraft system: supplies reference
- Camera sampling → DreamCraft system: samples views
- Training launcher → DreamCraft system: trains stages
- DreamCraft system → Training lifecycle: extends (evidence: `threestudio/systems/dreamcraft3d.py`)
- DreamCraft system → Scene geometry: optimizes scene
- DreamCraft system → Volume renderer: renders views
- DreamCraft system → Diffusion guidance: requests guidance (evidence: `threestudio/systems/dreamcraft3d.py`)
- DreamCraft system → Zero123 prior: uses 3D prior
- DreamCraft system → Prompt processing: conditions on prompt
- Scene geometry → Neural networks: uses networks (evidence: `threestudio/models/geometry/implicit_sdf.py`)
- Volume renderer → Scene geometry: queries geometry (evidence: `threestudio/models/renderers/nerf_volume_renderer.py`)
- Volume renderer → Scene materials: shades samples (evidence: `threestudio/models/renderers/nerf_volume_renderer.py`)
- Diffusion guidance → Latent diffusion core: uses diffusion
- Zero123 prior → Latent diffusion core: uses diffusion
- DreamCraft system → Mesh exporter: exports mesh
- Mesh exporter → 3D output: writes mesh
- Reference image → Multi-view generation: generates views
- Multi-view generation → Personalized diffusion: trains on renders
- Personalized diffusion → Diffusion guidance: personalizes prior
