Search

Search papers and lessons

Structured 3D Latents for Scalable and Versatile 3D Generation

Jianfeng Xiang, Zelong Lv, Sicheng Xu et al. · 2024

TRELLIS encodes a 3D asset as sparse voxels that carry DINOv2 features, then generates that latent with two rectified flow transformers, up to 2 billion parameters.

On this page

  • Colour = topic mix
  • Probability
  • Discrete math
  • Linear algebra
  • Calculus
  • Neural network basics
  • Generative models
  • ReadReady to readNot yet

TL;DR

TRELLIS is a 3D generator built on one shared latent format, Structured LATents (SLat). Each object is stored as a sparse set of occupied voxels, and each occupied voxel carries a feature vector taken from many rendered views of the object. Two rectified flow transformers generate this latent from a text prompt or an image, and small decoders turn it into 3D Gaussians, radiance fields, or meshes. The largest model has 2 billion parameters and was trained on about 500K 3D assets.

Builds on: Rectified Flow, Diffusion Transformer (DiT), Variational Autoencoder, Voxel Grid, DINOv2: Learning Robust Visual Features without Supervision · Leads to: Latent Diffusion Model

Why it mattered

Before this work, 3D generators tended to fix one output format. Models that produced meshes had weak appearance, while models that produced 3D Gaussians or radiance fields looked good but often had poor geometry. TRELLIS gives one latent from which all of these formats can be decoded, so one generator can feed a game engine that wants meshes, a viewer that wants Gaussians, and a renderer that wants a radiance field.

It also showed that the recipe that worked for 2D images carries over to 3D. Latent generative models with rectified flow had become the backbone of large image and video systems. TRELLIS applies the same backbone to 3D assets in three sizes, B, L and XL, with the largest at 2 billion parameters, and in its size ablation quality rises with each step up.

The problem

To generate a 3D object, a model has to learn a distribution over shapes and appearances. Three obstacles stood in the way.

  1. Dense 3D data is large. A 64 by 64 by 64 grid has 262,144 cells, and most are empty for any real object.
  2. Different formats need different networks. A mesh is a graph of triangles, a Gaussian set is an unordered list of blobs, and a radiance field is a function of position and viewing direction. One network cannot read all three well.
  3. Appearance is hard to encode. A latent that keeps only shape loses colour and texture, and a latent fitted to each object in a costly pre-processing step does not scale.

TRELLIS addresses all three with one design: keep the 3D structure sparse, fill it with strong image features instead of hand-built 3D features, and generate the structure and the features in two separate stages.

How it works

Here is the pipeline on a toy scale, in pipeline order.

  1. Input. A 3D asset, for example a mug. Render it from many random camera positions on a sphere (the paper uses 150 views per asset).
  2. Find the occupied voxels. Lay a grid over the object and mark each cell that touches the surface as active. Suppose a 4 by 4 by 4 toy grid has 3 active cells out of 64. The active cells give the coarse shape, and the other 61 cells are never stored. Check: 3 out of 64 is about 4.7 percent.
  3. Attach a visual feature to each active cell. Project each active cell into every rendered view and read a DINOv2 feature at that spot. Average the vectors over the views. Each active cell now holds one feature vector that describes the local shape and colour. Check: 3 cells means 3 vectors, not the whole image.
  4. Encode. A transformer VAE takes the list of (feature, position) pairs and outputs one latent vector per active cell, a smaller code that still keeps enough to rebuild the asset.
  5. Decode. A decoder maps each latent to the output format. For Gaussians, one latent becomes several Gaussians placed near its cell. For meshes, one latent becomes values on a small set of cube corners, and a surface extraction step turns those into triangles.
  6. Generate stage 1: the structure. A rectified flow transformer starts from random noise on a small dense grid, denoises it into a feature grid conditioned on the prompt, and decodes that grid to the set of active cells.
  7. Generate stage 2: the latents. A second rectified flow transformer takes that set of active cells and generates one latent vector per cell, under the same prompt.
  8. Output. Pass the generated latents through the chosen decoder to get a 3D asset in the format you asked for.
flowchart LR
  A[3D asset] --> B[Render many views]
  B --> C[DINOv2 features projected onto active voxels]
  A --> D[Active voxels: coarse shape]
  C --> E[Sparse VAE encoder]
  D --> E
  E --> F[Structured latent z]
  F --> G1[Gaussian decoder]
  F --> G2[Radiance field decoder]
  F --> G3[Mesh decoder]
  H[Text or image prompt] --> I[Stage 1: rectified flow, sparse structure]
  I --> J[Stage 2: rectified flow, latents on that structure]
  J --> F

The math

Definition: Structured latent

A structured latent is a set of pairs z={(zi,pi)}i=1L\boldsymbol{z} = \{(\boldsymbol{z}_i, \boldsymbol{p}_i)\}_{i=1}^{L}. Each pi\boldsymbol{p}_i is the integer position of an active voxel in an N×N×NN \times N \times N grid, and each zi\boldsymbol{z}_i is a vector of length CC attached to that voxel. The paper uses N=64N = 64, and LL is on average about 20,00020{,}000.

Step 2 in symbols: sparsity

The grid has N3N^3 cells and only LL are active, with L≪N3L \ll N^3. For N=64N = 64, N3=262,144N^3 = 262{,}144, so an average object with L=20,000L = 20{,}000 fills about 20,000/262,144≈0.07620{,}000 / 262{,}144 \approx 0.076 of the grid. The stored latent has LL vectors, not N3N^3.

Step 3 in symbols: feature averaging

For active voxel ii, let fi,v\boldsymbol{f}_{i,v} be the DINOv2 feature read at its projection in view vv, out of VV views. The voxel feature is fi=1V∑v=1Vfi,v\boldsymbol{f}_i = \frac{1}{V}\sum_{v=1}^{V} \boldsymbol{f}_{i,v}. Averaging makes the feature less dependent on which views were sampled, as long as there are enough of them.

Step 4 in symbols: the VAE

The encoder E\mathcal{E} maps {(fi,pi)}\{(\boldsymbol{f}_i, \boldsymbol{p}_i)\} to {(zi,pi)}\{(\boldsymbol{z}_i, \boldsymbol{p}_i)\}, and the decoder D\mathcal{D} maps back to the output format. Training minimises a reconstruction loss between the decoded asset and the ground truth, plus a KL penalty that pulls each zi\boldsymbol{z}_i toward a standard normal distribution, as in the Variational Autoencoder.

Step 5 in symbols: the Gaussian decoder

Each latent zi\boldsymbol{z}_i decodes to KK Gaussians with offsets oik\boldsymbol{o}_i^k. Their positions are kept near the voxel: xik=pi+tanh⁡(oik)\boldsymbol{x}_i^k = \boldsymbol{p}_i + \tanh(\boldsymbol{o}_i^k). Since tanh⁡\tanh squashes its input into the range from −1-1 to 11, a latent cannot place its blobs far outside its own cell.

Step 6 in symbols: rectified flow

The forward path is a straight line between a data sample x0\boldsymbol{x}_0 and a noise sample ϵ\boldsymbol{\epsilon}:

x(t)=(1−t) x0+t ϵ,0≤t≤1.\boldsymbol{x}(t) = (1 - t)\,\boldsymbol{x}_0 + t\,\boldsymbol{\epsilon}, \qquad 0 \le t \le 1.

The network vθ(x,t)\boldsymbol{v}_\theta(\boldsymbol{x}, t) learns the velocity along that line, with training loss

LCFM(θ)=Et,x0,ϵ∥vθ(x(t),t)−(ϵ−x0)∥22.\mathcal{L}_{\mathrm{CFM}}(\theta) = \mathbb{E}_{t, \boldsymbol{x}_0, \boldsymbol{\epsilon}} \left\| \boldsymbol{v}_\theta(\boldsymbol{x}(t), t) - (\boldsymbol{\epsilon} - \boldsymbol{x}_0) \right\|_2^2.

Generation runs the learned velocity backward, from noise at t=1t = 1 to data at t=0t = 0, by integrating it numerically in small steps.

Traced on one pair: take x0=2x_0 = 2, ϵ=5\epsilon = 5 and t=0.25t = 0.25. The point on the line is x(t)=0.75⋅2+0.25⋅5=2.75x(t) = 0.75 \cdot 2 + 0.25 \cdot 5 = 2.75, and the regression target is ϵ−x0=3\epsilon - x_0 = 3. The velocity is the same at every point of one pair's line, which is what "rectified" means here.

Results

Reconstruction (Table 1). Measured on the decoded output, TRELLIS reaches appearance PSNR 32.74 with Gaussian decoding and 32.19 with radiance field decoding, against 26.44 for LN3Diff and 25.34 for 3DTopia-XL (which the paper scores on shaded renders of its PBR meshes). Geometry Chamfer distance is 0.0083, against 0.0124 for CLAY and 0.0128 for 3DTopia-XL, and the F-score is 0.9999, against 0.9976 for CLAY. Normal-map PSNR is 36.11, against 35.35 for CLAY.

Text-to-3D (Table 2, Toys4k). The XL model reaches CLIP score 26.70 and a DINOv2 Fréchet distance of 237.48. The best baseline on that distance, InstantMesh, reaches 478.92, and the best baseline on CLIP, InstantMesh again, reaches 25.56.

Image-to-3D (Table 2, Toys4k, L model). CLIP score 85.77 against 84.43 for InstantMesh, and DINOv2 Fréchet distance 67.21 against 264.36 for InstantMesh. The image-to-3D rows do not include the XL model.

Stage by stage (Table 4, Toys4k, DINOv2 Fréchet distance, lower is better). Stage 1 with diffusion gives 295.90, with rectified flow 269.56, a reduction of 295.90−269.56=26.34295.90 - 269.56 = 26.34, about 8.9 percent. Stage 2 with diffusion gives 244.08, with rectified flow 240.20, a reduction of 3.88, about 1.6 percent. The structure stage gains more from rectified flow than the latent stage does.

Latent size (Table 3). At a 32 by 32 by 32 latent resolution the PSNR plateaus near 31.6 to 31.9 as channels grow from 16 to 64. Moving to 64 by 64 by 64 with 8 channels gives 32.74. The paper keeps this setting.

Model size (Table 5). On the training distribution, the CLIP score rises from 25.41 (B) to 25.62 (L) to 25.71 (XL), and the distance falls from 121.45 to 99.92 to 93.96.

User study. Over 100 participants compared methods on 68 text prompts and 67 image prompts, and users strongly preferred TRELLIS. The paper gives its preference results in a figure and in its supplement.

Limits. The two-stage pipeline can be less efficient than a single-stage method. The image-to-3D model bakes lighting from the reference image into the asset, so shading and highlights do not come out as separate material properties, and the paper leaves that to future work.

Reading guide

Check yourself

QuestionRecall: what is an active voxel in TRELLIS, and why does the latent store only active voxels?Show answer
An active voxel is a cell of the 3D grid that intersects the object's surface. Only active voxels get a latent vector, so the stored structure stays sparse, and the cost grows with the surface rather than with the full volume.
QuestionCompute: a grid has N = 64 and an object has L = 20,000 active voxels. What fraction of the grid is active?Show answer
The grid has 643=262,14464^3 = 262{,}144 cells. The fraction is 20,000/262,144≈0.07620{,}000 / 262{,}144 \approx 0.076, about 7.6 percent.
QuestionWhy: the paper uses DINOv2 features rather than a dedicated 3D encoder. What does that buy?Show answer
The features come from a strong pretrained vision model that already captures shape and appearance cues from images. Using them avoids training a separate 3D encoder and avoids the costly per-object fitting step that other latent methods need to align 3D data to a representation.
QuestionApplied: you want to generate a 3D chair and export it as a mesh for a game engine. Which parts of the pipeline do you use?Show answer
Run both generation stages from the text or image prompt to get the structured latent, then use the mesh decoder, which turns each latent into voxel-corner values that become triangles. The Gaussian and radiance field decoders are not needed.

Sources

Read the full paper

Jianfeng Xiang, Zelong Lv, Sicheng Xu et al., 2024. arXiv:2412.01506