# colezwhy/genamodal3d architecture

> Architecture diagram of the GitHub repository colezwhy/genamodal3d, 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/colezwhy/genamodal3d
- Repository: https://github.com/colezwhy/genamodal3d

## Overview

GENA3D turns 2D amodal-completed images and occlusion cues into coherent 3D objects, supporting single- and sparse-view inputs and multiple output representations. The inference entry point invokes a pipeline that samples sparse structure, then structured latents, decodes representations, and postprocesses exports. Separate training/data-preparation components are present, though the README says training instructions are forthcoming. Some pipeline internals and optional output formats are documented or indexed but were not sampled; those links are limited to documented or indexed evidence.

Main entry points: [`gena3d/pipelines/sparse_image_to_3d.py`](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/sparse_image_to_3d.py) (Sparse image pipeline), [`inference_gena3d.py`](https://github.com/colezwhy/genamodal3d/blob/main/inference_gena3d.py) (Inference entry), [`gena3d/models/sparse_structure_flow_doubleattn_weighted.py`](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/sparse_structure_flow_doubleattn_weighted.py) (Sparse structure flow), [`gena3d/models/structured_latent_flow_doubleattn_weighted.py`](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/structured_latent_flow_doubleattn_weighted.py) (Structured latent flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference workflow"]
  node_inference_entry["Inference entry"]
  node_pipeline["Sparse image pipeline"]
  node_conditioning["Image and mask conditioning"]
end

subgraph group_generation["3D generation"]
  node_ss_flow["Sparse structure flow"]
  node_ss_vae["Sparse structure encoder/decoder"]
  node_slat_flow["Structured latent flow"]
  node_slat_vae["Structured latent decoders"]
  node_sampler["Flow samplers<br/>[flow_euler.py]"]
  node_attention["Attention modules<br/>[modules.py]"]
  node_sparse_ops["Sparse tensor operations<br/>[basic.py]"]
end

subgraph group_representations["3D outputs"]
  node_octree["Octree representation<br/>[octree_dfs.py]"]
  node_mesh["Mesh representation"]
  node_gaussian["Gaussian representation<br/>[gaussian_model.py]"]
  node_renderers["3D renderers"]
  node_postprocess["Postprocessing and export"]
end

subgraph group_training["Training and data"]
  node_train["Training launcher<br/>[train_lightning.py]"]
  node_network_ss["Structure training network<br/>[network_ss.py]"]
  node_network_slat["Latent training network<br/>[network_slat.py]"]
  node_train_data["Training data loading<br/>[gena3d.py]"]
  node_dataset_tools["Dataset preparation tools"]
end

node_user(("User"))
node_completion["2D completion"]

node_user -->|"provides views"| node_completion
node_completion -->|"supplies completed views"| node_inference_entry
node_user -->|"runs inference"| node_inference_entry
node_inference_entry -->|"runs pipeline"| node_pipeline
node_pipeline -->|"builds conditions"| node_conditioning
node_pipeline -->|"uses samplers"| node_sampler
node_pipeline -->|"samples structure"| node_ss_flow
node_pipeline -->|"samples latents"| node_slat_flow
node_pipeline -->|"decodes latents"| node_slat_vae
node_ss_flow -->|"uses attention"| node_attention
node_slat_flow -->|"uses attention"| node_attention
node_ss_flow -->|"uses sparse tensors"| node_sparse_ops
node_slat_flow -->|"uses sparse tensors"| node_sparse_ops
node_slat_vae -->|"decodes mesh"| node_mesh
node_pipeline -->|"uses octree"| node_octree
node_pipeline -->|"uses renderers"| node_renderers
node_inference_entry -->|"exports model"| node_postprocess
node_postprocess -->|"uses renderers"| node_renderers
node_postprocess -->|"uses representations"| node_octree
node_train -->|"loads data"| node_train_data
node_train -.->|"configures system"| node_network_ss
node_network_ss -->|"trains structure model"| node_ss_flow
node_network_ss -->|"uses training data"| node_train_data
node_network_slat -.->|"trains latent model"| node_slat_flow
node_dataset_tools -.->|"prepares datasets"| node_train_data

click node_inference_entry "https://github.com/colezwhy/genamodal3d/blob/main/inference_gena3d.py"
click node_pipeline "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/sparse_image_to_3d.py"
click node_conditioning "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/sparse_image_to_3d.py"
click node_ss_flow "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/sparse_structure_flow_doubleattn_weighted.py"
click node_ss_vae "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/sparse_structure_vae.py"
click node_slat_flow "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/structured_latent_flow_doubleattn_weighted.py"
click node_slat_vae "https://github.com/colezwhy/genamodal3d/tree/main/gena3d/models/structured_latent_vae"
click node_sampler "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/samplers/flow_euler.py"
click node_attention "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/modules/attention/modules.py"
click node_sparse_ops "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/modules/sparse/basic.py"
click node_octree "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/representations/octree/octree_dfs.py"
click node_mesh "https://github.com/colezwhy/genamodal3d/tree/main/gena3d/representations/mesh"
click node_gaussian "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/representations/gaussian/gaussian_model.py"
click node_renderers "https://github.com/colezwhy/genamodal3d/tree/main/gena3d/renderers"
click node_postprocess "https://github.com/colezwhy/genamodal3d/blob/main/gena3d/utils/postprocessing_utils.py"
click node_train "https://github.com/colezwhy/genamodal3d/blob/main/train_lightning.py"
click node_network_ss "https://github.com/colezwhy/genamodal3d/blob/main/lightning/network_ss.py"
click node_network_slat "https://github.com/colezwhy/genamodal3d/blob/main/lightning/network_slat.py"
click node_train_data "https://github.com/colezwhy/genamodal3d/blob/main/dataLoader/gena3d.py"
click node_dataset_tools "https://github.com/colezwhy/genamodal3d/tree/main/dataset_toolkits"

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_inference_entry,node_pipeline,node_conditioning,node_user toneBlue
class node_ss_flow,node_ss_vae,node_slat_flow,node_slat_vae,node_sampler,node_attention,node_sparse_ops toneAmber
class node_octree,node_mesh,node_gaussian,node_renderers,node_postprocess toneMint
class node_train,node_network_ss,node_network_slat,node_train_data,node_dataset_tools toneRose
class node_completion toneIndigo
```

## Components

### Inference workflow

- [Inference entry](https://github.com/colezwhy/genamodal3d/blob/main/inference_gena3d.py): `inference_gena3d.py`
- [Sparse image pipeline](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/sparse_image_to_3d.py): `gena3d/pipelines/sparse_image_to_3d.py`
- [Image and mask conditioning](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/sparse_image_to_3d.py): `gena3d/pipelines/sparse_image_to_3d.py`

### 3D generation

- [Sparse structure flow](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/sparse_structure_flow_doubleattn_weighted.py): `gena3d/models/sparse_structure_flow_doubleattn_weighted.py`
- [Sparse structure encoder/decoder](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/sparse_structure_vae.py): `gena3d/models/sparse_structure_vae.py`
- [Structured latent flow](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/models/structured_latent_flow_doubleattn_weighted.py): `gena3d/models/structured_latent_flow_doubleattn_weighted.py`
- [Structured latent decoders](https://github.com/colezwhy/genamodal3d/tree/main/gena3d/models/structured_latent_vae): `gena3d/models/structured_latent_vae`
- [Flow samplers](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/pipelines/samplers/flow_euler.py): `gena3d/pipelines/samplers/flow_euler.py`
- [Attention modules](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/modules/attention/modules.py): `gena3d/modules/attention/modules.py`
- [Sparse tensor operations](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/modules/sparse/basic.py): `gena3d/modules/sparse/basic.py`

### 3D outputs

- [Octree representation](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/representations/octree/octree_dfs.py): `gena3d/representations/octree/octree_dfs.py`
- [Mesh representation](https://github.com/colezwhy/genamodal3d/tree/main/gena3d/representations/mesh): `gena3d/representations/mesh`
- [Gaussian representation](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/representations/gaussian/gaussian_model.py): `gena3d/representations/gaussian/gaussian_model.py`
- [3D renderers](https://github.com/colezwhy/genamodal3d/tree/main/gena3d/renderers): `gena3d/renderers`
- [Postprocessing and export](https://github.com/colezwhy/genamodal3d/blob/main/gena3d/utils/postprocessing_utils.py): `gena3d/utils/postprocessing_utils.py`

### Training and data

- [Training launcher](https://github.com/colezwhy/genamodal3d/blob/main/train_lightning.py): `train_lightning.py`
- [Structure training network](https://github.com/colezwhy/genamodal3d/blob/main/lightning/network_ss.py): `lightning/network_ss.py`
- [Latent training network](https://github.com/colezwhy/genamodal3d/blob/main/lightning/network_slat.py): `lightning/network_slat.py`
- [Training data loading](https://github.com/colezwhy/genamodal3d/blob/main/dataLoader/gena3d.py): `dataLoader/gena3d.py`
- [Dataset preparation tools](https://github.com/colezwhy/genamodal3d/tree/main/dataset_toolkits): `dataset_toolkits`

### Other components

- **User**
- **2D completion**

## Connections

- User → 2D completion: provides views (evidence: `README.md`)
- 2D completion → Inference entry: supplies completed views (evidence: `README.md`)
- User → Inference entry: runs inference (evidence: `README.md`)
- Inference entry → Sparse image pipeline: runs pipeline (evidence: `inference_gena3d.py`)
- Sparse image pipeline → Image and mask conditioning: builds conditions (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Sparse image pipeline → Flow samplers: uses samplers (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Sparse image pipeline → Sparse structure flow: samples structure (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Sparse image pipeline → Structured latent flow: samples latents (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Sparse image pipeline → Structured latent decoders: decodes latents (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Sparse structure flow → Attention modules: uses attention
- Structured latent flow → Attention modules: uses attention (evidence: `gena3d/models/structured_latent_flow_doubleattn_weighted.py`)
- Sparse structure flow → Sparse tensor operations: uses sparse tensors
- Structured latent flow → Sparse tensor operations: uses sparse tensors (evidence: `gena3d/models/structured_latent_flow_doubleattn_weighted.py`)
- Structured latent decoders → Mesh representation: decodes mesh (evidence: `gena3d/models/structured_latent_vae/decoder_mesh.py`)
- Sparse image pipeline → Octree representation: uses octree (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Sparse image pipeline → 3D renderers: uses renderers (evidence: `gena3d/pipelines/sparse_image_to_3d.py`)
- Inference entry → Postprocessing and export: exports model (evidence: `inference_gena3d.py`)
- Postprocessing and export → 3D renderers: uses renderers (evidence: `gena3d/utils/postprocessing_utils.py`)
- Postprocessing and export → Octree representation: uses representations (evidence: `gena3d/utils/postprocessing_utils.py`)
- Training launcher → Training data loading: loads data (evidence: `train_lightning.py`)
- Training launcher → Structure training network: configures system
- Structure training network → Sparse structure flow: trains structure model (evidence: `lightning/network_ss.py`)
- Structure training network → Training data loading: uses training data (evidence: `lightning/network_ss.py`)
- Latent training network → Structured latent flow: trains latent model
- Dataset preparation tools → Training data loading: prepares datasets
