trellis.cpp: running Microsoft's TRELLIS.2 image-to-3D model locally in C++ and GGML
TRELLIS.2 image-to-3D in C++/GGML (CUDA + Vulkan), with a resident HTTP server
At a glance
- What is it?
- trellis.cpp ports Microsoft's TRELLIS.2-4B image-to-3D pipeline to native C++ on GGML, with CUDA, ROCm and Vulkan backends, a CLI, a resident HTTP server and a Tauri desktop app. This analysis covers what you run, what the optional quad retopology costs, and what the sample reconstructions do and do not tell you.
- Who is it for?
- Choose trellis.cpp if you have a CUDA, ROCm or Vulkan GPU, room for about 16.5 GB of weights, and want TRELLIS.2 without a Python runtime. Skip the quad retopology path unless you are willing to build from source, since the prebuilt binaries omit it, and read the install script before piping it into a shell.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 21 days ago.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- pwilkin/trellis.cpp409 ★ · +96
| Repository | 2026-09-21 | 2026-11-22 |
|---|---|---|
| pwilkin/trellis.cpp | 313 | 409 |
96 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The whole TRELLIS.2 chain runs in native code with no Python at runtime
trellis.cpp is a standalone GGML-based C++ implementation of Microsoft's TRELLIS.2-4B image-to-3D pipeline. It ports the reference implementation at microsoft/TRELLIS.2 and covers every stage in native code: background removal, image conditioning, the three flow transformers, the VAE decoders, mesh extraction and UV-textured GLB export. The result of the basic command is a GLB with a texture atlas and PBR maps:
./build/trellis-cli assets/goblin.png out/goblin.glb # image -> UV-textured GLB (atlas + PBR)
python tools/render_glb.py out/goblin.glb out/view.png # quick multi-view renderThe second line is the one place Python appears, and it is only a preview renderer, not part of generation. The project can also be driven from a text prompt when stable-diffusion.cpp produces the input image. That makes the chain two models deep, and the second one is a separate project you build and configure yourself. The repository also names a role as the trellis backend of Lemonade, which matters if you already run that stack. Ownership of the model itself stays with Microsoft: this repository is a port, so questions about training data or model behavior belong with the upstream TRELLIS.2 project.
The one-command installer pipes a remote script into your shell and downloads about 16.5 GB
The fastest start is Trellis Studio, which auto-detects your GPU runtime among CUDA, ROCm and Vulkan, downloads the server plus weights, and installs the desktop app. Linux x86-64 uses a curl pipe into bash:
# Linux (x86-64)
curl -fsSL https://raw.githubusercontent.com/pwilkin/trellis.cpp/main/install/install.sh | bashWindows x64 uses PowerShell:
# Windows (x64), in PowerShell
irm https://raw.githubusercontent.com/pwilkin/trellis.cpp/main/install/install.ps1 | iexThe installer fetches the matching trellis-server build and roughly 16.5 GB of weights, so plan disk space and bandwidth before you run it. Both commands execute whatever is on the main branch at that moment, so open install/install.sh or install/install.ps1 first if the machine matters to you. The platforms named for installation are Linux and Windows. Prebuilt binaries for those two systems come in Vulkan, ROCm and CUDA variants on the releases page, and docs/getting-started.md carries the installer options and troubleshooting steps that the front page leaves out.
Trellis Studio keeps a local gallery and starts the server for you
Studio is a Tauri desktop app. On launch it starts and supervises trellis-server, so you drag an image onto the drop zone, click to browse or paste from the clipboard, then generate. Optional settings are resolution (512 light, 1024 cascade, 1536 high), seed, background removal (auto, birefnet or threshold) and UV unwrap (xatlas or box), with defaults that match the CLI. Generation takes a few minutes and a live stage line shows progress. The preview is Google's three.js-based model-viewer, with Reset view to re-frame the camera and Save GLB to export. Every result goes into a local gallery stored in IndexedDB, and clicking a thumbnail reloads the model, input image and settings even after the app restarts. The Settings panel points the app at a different models directory, GPU index or port, while the models directory, backend and server binary come from the config.json the installer writes. The gallery lives in the app's browser storage, so it is not a project folder you can sync; the exported GLB is the artifact to keep. Because the UI is a plain web bundle, you can also open it in a browser against a server you started yourself.
The default is a two-stage 1024 cascade, and the light path is a flag away
The CLI default is the 1024 cascade: a low-resolution flow_512 stage, an upsample, a high-resolution flow_1024 stage and a res-1024 decode, which the project describes as giving sharper geometry. Passing --res 512 selects the lighter res-512 path instead. Everything is driven by CLI flags, and trellis-cli --help prints the full list; the front page does not reproduce it. The same three resolution tiers show up in Studio as 512, 1024 and 1536, so the desktop app exposes one tier above the CLI default. The cost of the cascade is two transformer passes at different sizes rather than one, so if your GPU memory is tight the 512 path is the setting to try first. Nothing on the front page gives a memory figure for either path, so check against your own card rather than assuming a number. For scripted use, trellis-server is the resident HTTP server named in the project description, kept running so that the weights do not have to be loaded again for each request.
All-quad retopology is a source build option and the prebuilt binaries leave it out
An optional all-quad textured export exists on Linux and Windows, but you must build for it. Enable both retopology options, and CMake downloads pinned LEMON, CGAL and Boost sources. Linux additionally builds GMP and MPFR, while Windows uses CGAL's Boost Multiprecision backend. Building trellis-cli also builds the retopology driver and helper executables. The release binaries omit this path entirely. The Linux recipe is:
# Linux
cmake -S . -B build -DGGML_VULKAN=ON \
-DTRELLIS_RETOPO_MATCHING=ON -DTRELLIS_RETOPO_COLLISION=ON
cmake --build build --target trellis-cli -j
mkdir -p out/retopo-work
TMPDIR="$PWD/out/retopo-work" ./build/trellis-cli assets/goblin.png out/goblin-quads.glb \
--models /path/to/gguf --seed 42 --res 1024 --tex-res 512 \
--retopo 512 0 900000 --retopo-no-weld-fill --retopo-dual-pbr \
--retopo-atlas 4096 --retopo-workdir out/retopo-workThe three --retopo numbers are the tetra remesh grid, the initial QEM face target (zero preserves the full shell) and the final QEM face target. The --retopo-dual-pbr flag requires --res 1024 --tex-res 512 and decodes a 1024-resolution PBR field when the 512 field leaves texture holes, at extra compute and storage cost. The Windows route needs an MSVC developer PowerShell with Ninja and the Vulkan SDK.
The retopology evidence is one Linux Vulkan goblin and one humanoid
The project states what passed: on Linux, the configuration above completed a full Vulkan goblin run, and a thin-feature humanoid passed with the same 512 grid and no-weld preparation. That is the extent of the validation described for quad output. Two inputs on one platform and one backend do not establish that other meshes, CUDA or ROCm builds, or Windows will behave the same way. If you depend on all-quad geometry, such as for sculpting or animation work, run your own subjects through it and inspect the result before committing a pipeline to it. The extra work is also real, because the dual PBR decode adds compute and storage, and the retopology scratch files go into the directory named by --retopo-workdir, which is why the recipe points TMPDIR at out/retopo-work. Budget disk for that folder. The standard GLB path with its UV atlas does not carry any of this build burden, which is why it is the sensible baseline to compare against before you enable the quad route.
The sample reconstructions come from one AMD GPU, not your machine
The sample set has seven reconstructions made with v0.4.3 on a single Radeon 8060S: an axe, a chest, a cottage, a drone, a golem, a knight and a racer. All used the res-1024 cascade, seed 42, about 300K faces and a 2048 pixel atlas, and the GLBs with their Z-Image-Turbo source images sit in assets/showcase. The preview grids are 4096 by 4096, four views at 75 degrees elevation, produced by tools/mv_preview/render_quad.js, a headless Playwright driver around model-viewer, and stitched with stitch_quad.py. These are quality examples, not timing data, and they come from a release several versions older than v0.8.1. The recent releases show the pace since: v0.6.0 on 19 August 2026 covered CUDA geometry fixes and legacy NVIDIA support, v0.8.0 on 24 September added Pixal3D and native quad retopology, and v0.8.1 on 25 September made retopology builds portable. The last push was on 1 November 2026, and a ROADMAP.md sits at the top level. Output on current releases can differ from those images.
Editorial conclusion
Choose trellis.cpp if you have a CUDA, ROCm or Vulkan GPU, room for about 16.5 GB of weights, and want TRELLIS.2 without a Python runtime. Skip the quad retopology path unless you are willing to build from source, since the prebuilt binaries omit it, and read the install script before piping it into a shell.
Frequently asked questions
Can I run TRELLIS.2 locally?
Yes. trellis.cpp runs the TRELLIS.2-4B image-to-3D pipeline in native C++ and GGML with no Python at runtime, on CUDA, ROCm or Vulkan, and the installer downloads about 16.5 GB of weights.
What is trellis software?
trellis.cpp is a C++/GGML port of Microsoft's TRELLIS.2 image-to-3D pipeline. It turns an input image into a UV-textured GLB model through a CLI, a resident HTTP server or the Trellis Studio desktop app.
Who owns TRELLIS.2?
The TRELLIS.2-4B model and its reference implementation come from Microsoft at microsoft/TRELLIS.2. trellis.cpp is a separate MIT-licensed C++ port in the pwilkin/trellis.cpp repository.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/pwilkin-trellis-cpp)Star history chart for your README
[](https://hysenlabs.com/projects/pwilkin-trellis-cpp)Was this useful?