TRELLIS.2-ROCm-INT4
microsoft/TRELLIS.2-4B (image to 3D) with calibrated INT4 flow DiTs, INT8 latent decoders and an INT8 DINOv3 image encoder, made for AMD GPUs with ROCm (tested on an RX 7900 XTX). The DiTs were calibrated block by block with RoundBit (AutoRound-style: learned rounding and group scales, INT4, group size 64). The last block (29) of the shape and texture 512 DiTs is replaced by a closed-form linear bridge. The decoders and the image encoder use weight-only INT8 with group size 128.
Code: github.com/WifiLast/TRELLIS.2-ROCm-INT4. It contains
the setup, the INT runtime with its Triton INT4 kernels, and generate.sh, which downloads these files
automatically.
Results (512 pipeline, seed 42)
| weights loaded | peak VRAM | |
|---|---|---|
| stock (bf16 DiTs, fp16 decoders) | 11.0 GB | 2.72 GiB |
| INT4 DiTs + INT8 decoders (until 2026-11-26) | 4.4 GB | 2.02 GiB |
| + bridges + INT8 image encoder (current files) | 3.4 GB | 2.03 GiB (T), 1.96 (bear), 1.13 (gear) |
Geometry stays on par with the stock models. The INT8 decoders are practically lossless. The INT4 DiTs change the
sample slightly, so a seed gives a slightly different object than with the stock models. Known loss: on the T.png
example, the glass cylinder comes out as dark metal. The bridges and the INT8 image encoder keep the geometry of the
INT4 + INT8 version on the T, bear and gear examples (full-resolution views against the source images); colours shift
slightly. The 1024_cascade pipeline with the current files has not been checked yet.
Files
| file | used by | size |
|---|---|---|
sparse_structure_flow_model.pt | 512, 1024_cascade | 678 MB |
shape_slat_flow_model_512.pt | 512, 1024_cascade | 656 MB (block 29 removed, see bridges.pt) |
tex_slat_flow_model_512.pt | 512 | 656 MB (block 29 removed) |
shape_slat_flow_model_1024.pt | 1024_cascade | 678 MB |
tex_slat_flow_model_1024.pt | 1024_cascade | 678 MB |
shape_slat_decoder.int8.pt, tex_slat_decoder.int8.pt | both | 482 MB each |
bridges.pt | 512, 1024_cascade | 19 MB: linear bridges for block 29 of the two 512 DiTs |
image_cond_model.int8.pt | both | 309 MB: DINOv3 ViT-L, bf16 + INT8 linears (stock: 1213 MB fp32) |
*.blocks.jsonl | calibration logs (per-block error) | – |
These are packed PyTorch files (INT codes plus fp16 group scales), not .safetensors. Each file replaces only the
quantized linear and conv layers of its model. Everything else (norms, embeddings, the sparse-structure decoder) is
still loaded from microsoft/TRELLIS.2-4B, so you need access to that repository. Of the gated DINOv3 encoder only its
config.json is read; its weights come from image_cond_model.int8.pt.
The two 512 DiT files need bridges.pt: use the GitHub code from commit 1b96b2d (2026-11-26) or newer. Older
checkouts still run, but load the original bf16 block 29 instead of the bridge and the fp32 image encoder.
Usage
git clone https://github.com/WifiLast/TRELLIS.2-ROCm-INT4.git && cd TRELLIS.2-ROCm-INT4
./setup.sh
./generate.sh --image photo.png # -> outputs/photo_s42.glb
./generate.sh --image photo.png --pipeline 1024_cascade
License
The weights are derived from microsoft/TRELLIS.2-4B (MIT). The RoundBit runtime code in the GitHub repository has its own license terms (see that repository).