Skip to content

TRELLIS.2

Open model that turns a single image into a 3D asset with PBR materials, on NVIDIA GPUs.

Stars
12.6k
Forks
1.5k
Licence
MIT
Language
Python
Last update
4 months ago
Type
AI model / agent

What it is

TRELLIS.2 is a 4-billion-parameter AI model from Microsoft that generates 3D objects from a single input image. It outputs textured meshes with physically based rendering (PBR) materials such as base color, roughness, metallic, and opacity, and can export them as GLB files. It is released under the MIT license with pretrained weights on Hugging Face.

  • Generate a textured 3D asset from a single image using the minimal Python example
  • Run the included web demo (app.py) to generate assets in a browser interface
  • Produce a turntable-style video preview of a generated asset with environment lighting
  • Export a generated asset to GLB format for use in 3D software
  • Generate PBR textures for an existing 3D shape using example_texturing.py

Great for

  • Researchers and developers experimenting with image-to-3D generation
  • Designers who want a quick textured 3D base model from a reference image and have an NVIDIA GPU
  • People comfortable running Python and CUDA on Linux

Not ideal for

  • Users without an NVIDIA GPU with at least 24GB of memory, since the README says it is necessary
  • Windows or macOS users, since the README says the code is currently tested only on Linux
  • Anyone wanting a point-and-click tool, since setup involves conda, CUDA and compiled dependencies
Step-by-step guide: how to use TRELLIS.2Install, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    You'll need: Linux · NVIDIA GPU with at least 24GB memory · CUDA Toolkit (12.4 recommended) · Conda · Python 3.8 or higher

    Clone the repository with submodules

    git clone -b main https://github.com/microsoft/TRELLIS.2.git --recursive

    Enter the project directory

    cd TRELLIS.2

    Create the conda environment and install dependencies

    . ./setup.sh --new-env --basic --flash-attn --nvdiffrast --nvdiffrec --cumesh --o-voxel --flexgemm
  2. 2

    Run it

    • Activate the trellis2 conda environment created by the setup script
    • Run the minimal example script with an input image such as assets/example_image/T.png
    • Check the generated sample.mp4 for a preview and sample.glb for the exported 3D asset
    • Alternatively, start the web demo with python app.py and open the address shown in the terminal
  3. 3

    Get the most out of it

    • Set PYTORCH_CUDA_ALLOC_CONF to expandable_segments:True to reduce GPU memory use, as shown in the example
    • Use the --help option of setup.sh to install only the components you need
    • Set ATTN_BACKEND to xformers if your GPU does not support flash-attn, per the README
    • Connect the GLB texture's alpha channel manually in your 3D software if you need transparency
    • Try the texturing scripts (example_texturing.py or app_texturing.py) to add PBR materials to your own shapes

Downloads

Strengths

  • Handles open surfaces, non-manifold geometry and internal structures, according to the README
  • Supports full PBR material outputs including roughness, metallic and opacity
  • Ships with pretrained weights, an example script, a web demo and an academic paper

Trade-offs

  • Requires a high-end NVIDIA GPU and a heavy dependency stack with CUDA compilation
  • Only tested on Linux according to the README; the README also lists no Windows or macOS support
  • Exported GLB is opaque by default, so transparency requires manual setup in 3D software

How it compares

ProjectStarsTypeLevelUpdatedBest for
TRELLIS.2 (this)12.6kAI model / agentadvanced4 months agoResearchers and developers experimenting with image-to-3D generation
TRELLIS14.2kAI model / agentadvanced10 days agoResearchers exploring text- or image-to-3D generation

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.