How vaibhavpandeyvpz/trellis-image-to-3d works
TRELLIS is an image-to-3D generation application. Its main workflow accepts and preprocesses an image, samples a sparse structure and then structured latents, decodes representations, and presents or exports the resulting asset. The README also documents experimental multi-image input, GLB and Gaussian outputs, background removal, configurable sampling, and an interactive viewer. The graph distinguishes the two generation stages and representation-specific outputs; several internal links are omitted or left unverified because the relevant implementation excerpts are incomplete.
Main entry points: trellis_image_to_3d.py Image-to-3D pipeline · app.py Gradio interface · base.py Structured latent VAE · render_utils.py 3D rendering
Components 21
Application
- Gradio interface
app.py - Browser 3D viewer
app.py - Asset download
app.py
Generation
- Image preprocessing
trellis/pipelines/trellis_image_to_3d.py - Image-to-3D pipeline
trellis/pipelines/trellis_image_to_3d.py - Flow samplers
trellis/pipelines/samplers/flow_euler.py - Sparse structure flow
trellis/models/sparse_structure_flow.py - Sparse structure VAE
trellis/models/sparse_structure_vae.py - Structured latent flow
trellis/models/structured_latent_flow.py - Structured latent VAE
trellis/models/structured_latent_vae/base.py - Mesh decoder
trellis/models/structured_latent_vae/decoder_mesh.py - Gaussian decoder
trellis/models/structured_latent_vae/decoder_gs.py - Radiance-field decoder
trellis/models/structured_latent_vae/decoder_rf.py
Model internals
- Sparse tensor operations
trellis/modules/sparse/basic.py - Attention layers
trellis/modules/attention/full_attn.py
3D representations
- Mesh representation
trellis/representations/mesh/cube2mesh.py - Gaussian representation
trellis/representations/gaussian/gaussian_model.py - Octree representation
trellis/representations/octree/octree_dfs.py
Viewing and export
- GLB processing
trellis/utils/postprocessing_utils.py - 3D rendering
trellis/utils/render_utils.py
Other components
- Image uploader
Connections 26
- Image uploader → Gradio interface: uploads image
README.md - Gradio interface → Image-to-3D pipeline: runs generation
app.py - Image-to-3D pipeline → Image preprocessing: preprocesses input
trellis/pipelines/trellis_image_to_3d.py - Image-to-3D pipeline → Flow samplers: configures samplers
trellis/pipelines/trellis_image_to_3d.py - Image-to-3D pipeline → Sparse structure flow: samples structure
- Image-to-3D pipeline → Sparse structure VAE: encodes structure
- Image-to-3D pipeline → Structured latent flow: samples latents
trellis/pipelines/trellis_image_to_3d.py - Image-to-3D pipeline → Structured latent VAE: decodes latents
trellis/pipelines/trellis_image_to_3d.py - Structured latent VAE → Mesh decoder: uses decoder
trellis/models/structured_latent_vae/decoder_mesh.py - Structured latent VAE → Gaussian decoder: uses decoder
trellis/models/structured_latent_vae/decoder_gs.py - Structured latent VAE → Radiance-field decoder: uses decoder
- Sparse structure flow → Sparse tensor operations: uses sparse ops
trellis/models/sparse_structure_flow.py - Structured latent flow → Sparse tensor operations: uses sparse ops
trellis/models/structured_latent_flow.py - Structured latent flow → Attention layers: uses attention
- Mesh decoder → Mesh representation: produces mesh
trellis/models/structured_latent_vae/decoder_mesh.py - Gaussian decoder → Gaussian representation: produces Gaussians
trellis/models/structured_latent_vae/decoder_gs.py - Radiance-field decoder → Octree representation: produces field
- Gradio interface → GLB processing: creates GLB
app.py - Gradio interface → 3D rendering: renders preview
app.py - 3D rendering → Mesh representation: renders mesh
trellis/utils/render_utils.py - 3D rendering → Gaussian representation: renders Gaussians
trellis/utils/render_utils.py - 3D rendering → Octree representation: renders octree
trellis/utils/render_utils.py - Gradio interface → Browser 3D viewer: shows preview
README.md - Gradio interface → Asset download: offers downloads
README.md - GLB processing → Mesh representation: converts mesh
- GLB processing → Gaussian representation: uses representation