Official repo for paper "Structured 3D Latents for Scalable and Versatile 3D Generation" (CVPR'25 Spotlight).
Official repo for paper "Structured 3D Latents for Scalable and Versatile 3D Generation" (CVPR'25 Spotlight).
TRELLIS is a large 3D asset generation model. It takes in text or image prompts and generates high-quality 3D assets in various formats, such as Radiance Fields, 3D Gaussians, and meshes. The cornerstone of TRELLIS is a unified Structured LATent (SLAT) representation that allows decoding to different output formats and Rectified Flow Transformers tailored for SLAT as the powerful backbones. We provide large-scale pre-trained models with up to 2 billion parameters on a large 3D asset dataset of 500K diverse objects. TRELLIS significantly surpasses existing methods, including recent ones at similar scales, and showcases flexible output format selection and local 3D editing capabilities which were not offered by previous models.
Check out our Project Page for more videos and interactive demos!
03/25/2025
12/26/2024
12/18/2024
app.py and example.py. (#40)Clone the repo:
git clone --recurse-submodules https://github.com/microsoft/TRELLIS.git
cd TRELLISInstall the dependencies:
Before running the following command there are somethings to note:
--new-env, a new conda environment named trellis will be created. If you want to use an existing conda environment, please remove this flag.trellis environment will use pytorch 2.4.0 with CUDA 11.8. If you want to use a different version of CUDA (e.g., if you have CUDA Toolkit 12.2 installed and do not want to install another 11.8 version for submodule compilation), you can remove the --new-env flag and manually install the required dependencies. Refer to PyTorch for the installation command.PATH should be set to the correct version before running the command. For example, if you have CUDA Toolkit 11.8 and 12.2 installed, you should run export PATH=/usr/local/cuda-11.8/bin:$PATH before running the command.flash-attn backend for attention. For GPUs do not support flash-attn (e.g., NVIDIA V100), you can remove the --flash-attn flag to install xformers only and set the ATTN_BACKEND environment variable to xformers before running the code. See the Minimal Example for more details. Create a new conda environment named trellis and install the dependencies:
. ./setup.sh --new-env --basic --xformers --flash-attn --diffoctreerast --spconv --mipgaussian --kaolin --nvdiffrast The detailed usage of setup.sh can be found by running . ./setup.sh --help.
…We provide the following pretrained models:
| Model | Description | #Params | Download |
|---|---|---|---|
| TRELLIS-image-large | Large image-to-3D model | 1.2B | Download |
| TRELLIS-text-base | Base text-to-3D model | 342M | Download |
| TRELLIS-text-large | Large text-to-3D model | 1.1B | Download |
| TRELLIS-text-xlarge | Extra-large text-to-3D model | 2.0B | Download |
Note: It is always recommended to use the image conditioned version of the models for better performance.
Note: All VAEs are included in TRELLIS-image-large model repo.
The models are hosted on Hugging Face. You can directly load the models with their repository names in the code:
TrellisImageTo3DPipeline.from_pretrained("microsoft/TRELLIS-image-large")If you prefer loading the model from local, you can download the model files from the links above and load the model with the folder path (folder structure should be maintained):
TrellisImageTo3DPipeline.from_pretrained("/path/to/TRELLIS-image-large")Here is an example of how to use the pretrained models for 3D asset generation.
…After running the code, you will get the following files:
sample_gs.mp4: a video showing the 3D Gaussian representationsample_rf.mp4: a video showing the Radiance Field representationsample_mesh.mp4: a video showing the mesh representationsample.glb: a GLB file containing the extracted textured meshsample.ply: a PLY file containing the 3D Gaussian representationapp.py provides a simple web demo for 3D asset generation. Since this demo is based on Gradio, additional dependencies are required:
. ./setup.sh --demoAfter installing the dependencies, you can run the demo with the following command:
python app.pyThen, you can access the demo at the address shown in the terminal.
We provide TRELLIS-500K, a large-scale dataset containing 500K 3D assets curated from Objaverse(XL), ABO, 3D-FUTURE, HSSD, and Toys4k, filtered based on aesthetic scores. Please refer to the dataset README for more details.
TRELLIS’s training framework is organized to provide a flexible and modular approach to building and fine-tuning large-scale 3D generation models. The training code is centered around train.py and is structured into several directories to clearly separate dataset handling, model components, training logic, and visualization utilities.
Prepare the Environment:
Dataset Preparation:
--data_dir argument when launching training.Configuration Files:
configs/ directory.| Config | Pretained Model | Description |
|---|---|---|
vae/ss_vae_conv3d_16l8_fp16.json |
Encoder Decoder | Sparse structure VAE |
vae/slat_vae_enc_dec_gs_swin8_B_64l8_fp16.json |
Encoder Decoder | SLat VAE with Gaussian Decoder |
vae/slat_vae_dec_rf_swin8_B_64l8_fp16.json |
Decoder | SLat Radiance Field Decoder |
vae/slat_vae_dec_mesh_swin8_B_64l8_fp16.json |
Decoder | SLat Mesh Decoder |
generation/ss_flow_img_dit_L_16l8_fp16.json |
[Denoiser](https://huggingface.co/microsoft/TRELLIS-image-large/blob/main/ckpts/ss_flow_img_dit_L_16l8_fp16.safetenso |
My babys first bhiirtday
hola
Verify evals on Papers with Code
A cat
Evaluation Data: TRELLIS vs. TRELLIS.2-4B geometry metrics in 2,307-model census
Complete Deployment Guide & Troubleshooting for TRELLIS v2
Updated TRELLIS 1 App with Torch 2.13 and CUDA 13 installers for all GPUs for both Windows and Linux with pre-compiled wheels
Is there a way to run with 12g VRAM? Is there a way to optimize it
SIGFPE error when training
Discussion on Visual feature aggregation