A working install of microsoft/TRELLIS.2 (image-to-3D, 4B parameter model) inside ComfyUI on AMD GPUs via ROCm. Tested end-to-end with both shape-only and full textured pipelines on a 7900 XTX (gfx1100, 24 GB VRAM).
This guide consolidates fixes for several real bugs in the upstream wrapper that prevent the stack from working out-of-the-box on most environments. If you've tried the Aero-Ex/ComfyUI-Trellis2-GGUF install or the egore/comfyui-trellis2-gguf-rocm ROCm fork and got stuck, this is the path that worked.
πΌοΈ See it running: Live demo of meshes generated with this setup is at
/docs(will be hosted via GitHub Pages once a few showpieces are added).
- ComfyUI running on ROCm with 45 TRELLIS-2 nodes registered
- 6 native HIP extensions built and loadable:
cumesh,flex_gemm,nvdiffrast,nvdiffrec_render,o_voxel,custom_rasterizer - TRELLIS auto-downloads its model weights (~2.5 GB GGUF Q4 / ~8 GB BF16) from
Aero-Ex/Trellis2-GGUFintoComfyUI/models/Trellis2/ - Working image-to-3D pipeline producing
.glboutputs from your reference images
| Tested | Notes | |
|---|---|---|
| GPU | AMD Radeon RX 7900 XTX (gfx1100) | Should also work on 7900 XT, 7800 XT, 7700 XT (same Navi 31/32 ISA). 7600/7600 XT = gfx1102 β change the arch flag below. RDNA2 (6000-series) untested; would need ROCm 6.x and may hit Triton kernel issues |
| OS | Ubuntu 22.04 (kernel 6.8) | Other Linux distros should work; ROCm packages must match |
| ROCm | 7.2.2 | 7.0+ likely fine; 6.x untested with this stack |
| Python | 3.10.12 | The wrapper authors test on 3.14; 3.10 works with the patches in this repo |
| Disk | ~15 GB free | Build temp ~2 GB, downloads ~3 GB GGUF or ~8 GB BF16, build artifacts in site-packages |
| VRAM | 8 GB+ workable, 16 GB+ comfortable | Q4_K_M model + low_vram=True fits in 8 GB; BF16 + textured pipeline wants 16+ |
Confirm your GPU's ISA target before starting:
rocminfo | grep "Name:.*gfx" | head -1
# Example output: Name: gfx1100Use whatever your card reports (gfx1100, gfx1101, gfx1102) anywhere this guide says gfx1100. The patches default to gfx1100; edit patches/01-gfx-arch.patch if your card is different before applying.
If you already have ComfyUI on ROCm, skip to Step 2.
# ROCm 7.2 PyTorch wheels (adjust URL for your ROCm version)
pip install --user torch torchvision torchaudio \
--index-url https://download.pytorch.org/whl/rocm7.2
# Verify ROCm + GPU detected
python3 -c "import torch; print('torch:', torch.__version__); \
print('hip:', torch.version.hip); \
print('cuda_avail:', torch.cuda.is_available()); \
print('device:', torch.cuda.get_device_name(0))"
# Expect: torch 2.11.0+rocm7.2, hip 7.2.x, cuda_avail True, device Radeon RX 7900 XTX
# ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI.git ~/ComfyUI
cd ~/ComfyUI
pip install --user -r requirements.txtTest ComfyUI loads cleanly before going further:
cd ~/ComfyUI
python3 main.py --listen 0.0.0.0 --port 8188
# Browse to http://localhost:8188 β should show the empty canvas. Ctrl-C to stop.cd ~/ComfyUI/custom_nodes
git clone https://github.com/egore/comfyui-trellis2-gguf-rocm.git
cd comfyui-trellis2-gguf-rocmComfyUI imports every directory under custom_nodes/, including this script-only directory. Drop a no-op __init__.py to prevent a startup error:
cat > __init__.py <<'EOF'
# This directory is the install script (not a custom node).
NODE_CLASS_MAPPINGS = {}
NODE_DISPLAY_NAME_MAPPINGS = {}
EOFThe egore install script has four issues outside its tester's exact environment. Apply patches 01 through 04 from this repo:
# Clone this guide repo somewhere (or copy just the patches/ dir)
cd /tmp
git clone https://github.com/toastmanAu/trellis-2-rocm-comfyui.git
cd ~/ComfyUI/custom_nodes/comfyui-trellis2-gguf-rocm
# Apply each patch
git apply /tmp/trellis-2-rocm-comfyui/patches/01-gfx-arch.patch
git apply /tmp/trellis-2-rocm-comfyui/patches/02-comfy-root-home.patch
git apply /tmp/trellis-2-rocm-comfyui/patches/03-pip-user-flag.patch
git apply /tmp/trellis-2-rocm-comfyui/patches/04-site-packages-user.patchDon't have your GPU on
gfx1100? Editpatches/01-gfx-arch.patchfirst β replacegfx1100withgfx1101(Navi 32) orgfx1102(Navi 33 / 7600-series).
What each patch does:
| Patch | What it fixes |
|---|---|
01-gfx-arch.patch |
The script hardcodes gfx1102 (the maintainer's 7600 XT). Change to your card's ISA. |
02-comfy-root-home.patch |
Repoints COMFY_ROOT from the script's directory to $HOME so ${COMFY_ROOT}/ComfyUI resolves to a vanilla ~/ComfyUI install. |
03-pip-user-flag.patch |
Adds --user to pip args so packages install to ~/.local/lib/python3.x/site-packages instead of needing sudo. |
04-site-packages-user.patch |
Makes SITE_PACKAGES point at the user site-packages (matching the --user install) so post-install file patches target the right path. Without this the script dies at curl: (23) Failure writing output partway through. |
Make sure ComfyUI is not running on port 8188 (the script checks and aborts if it is):
# If you have a systemd unit for ComfyUI:
systemctl --user stop comfyui.service
# Or just kill the process:
pkill -f "ComfyUI/main.py"Then:
cd ~/ComfyUI/custom_nodes/comfyui-trellis2-gguf-rocm
bash ./install-trellis2-gguf-rocm.shThis runs ~20β30 minutes the first time:
- Downloads DINOv3 model (~1.2 GB)
- Builds CuMesh from source with HIP patches (~5 min)
- Builds FlexGEMM (Triton-based, ~1 min)
- Builds nvdiffrast with HIP patches and OpenGL backend (~3 min)
- Builds nvdiffrec_render (~2 min)
- Builds o_voxel (~3 min)
- Clones
Aero-Ex/ComfyUI-Trellis2-GGUFintocustom_nodes/ - Installs Python requirements (transformers 5.2.0, sdnq, meshlib, pymeshlab, rembg, etc.)
There's a real upstream bug in Aero-Ex/ComfyUI-Trellis2-GGUF/model_manager.py that 404s any Safetensors (BF16) model_format pick. The Aero-Ex HF repo names BF16 weights as <basename>.safetensors (basename already ends in _bf16), but the wrapper unconditionally appends _bf16.safetensors β _bf16_bf16.safetensors β 404.
Apply the fix after Step 4 (the wrapper's source has to exist first):
cd ~/ComfyUI/custom_nodes/ComfyUI-Trellis2-GGUF
git apply /tmp/trellis-2-rocm-comfyui/patches/05-model-manager-bf16.patchIf you only intend to use GGUF quants, you can skip this β the bug only affects the BF16 / FP8 safetensors path.
The egore script doesn't include custom_rasterizer (used by TRELLIS's texturing pipeline), but it lives inside the Hunyuan3D wrapper's tree and PyTorch's CUDAExtension auto-HIPifies the source. ~3-min build:
# Get the source (this is also the Hy3D wrapper, useful in its own right)
cd ~/ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-Hunyuan3DWrapper.git
cd ComfyUI-Hunyuan3DWrapper/hy3dgen/texgen/custom_rasterizer
PYTORCH_ROCM_ARCH=gfx1100 \
ROCM_HOME=/opt/rocm \
HIP_HOME=/opt/rocm \
CUDA_HOME=/opt/rocm \
FORCE_CUDA=1 \
python3 -m pip install --user --no-build-isolation .
# Verify
python3 -c "import custom_rasterizer; print(custom_rasterizer.__file__)"TRELLIS uses nvdiffrast's OpenGL backend on AMD (the CUDA rasterizer doesn't have a HIP port). OpenGL doesn't compose with ComfyUI's default xformers attention path, so you must pass --use-pytorch-cross-attention:
cd ~/ComfyUI
python3 main.py --listen 0.0.0.0 --port 8188 --use-pytorch-cross-attentionIf you have a systemd user unit, add the flag to your ExecStart:
ExecStart=/usr/bin/python3 main.py --listen 0.0.0.0 --port 8188 --use-pytorch-cross-attentionsystemctl --user daemon-reload && systemctl --user start comfyui.serviceWatch for these markers in the log to confirm everything loaded:
[Trellis2] Using native ComfyUI-GGUF support (ops/dequant/loader)
0.7 seconds: /home/.../custom_nodes/ComfyUI-Trellis2-GGUF
If you see IMPORT FAILED for comfyui-trellis2-gguf-rocm, you forgot the no-op __init__.py from Step 2.
ComfyUI ships example workflows in ~/ComfyUI/custom_nodes/ComfyUI-Trellis2-GGUF/example_workflows/. Pick LowPoly.json for fastest first test.
β οΈ Heads up: Aero-Ex's example JSONs were authored against an older node schema; loading them in the current ComfyUI UI causes widget-position drift errors likedevice: 'True' not in ['cpu', 'cuda']ormodel_format: 'flash_attn' not in [...]. The values are correct but in the wrong dropdown slots.
- Manual fix: re-pick
model_format,backend,device,low_vramin theTrellis2LoadModel_GGUFnode; re-pickdual_contouring_resolutioninTrellis2Remesh_GGUF; re-pickuv_unwrap_methodinTrellis2MeshTexturing_GGUF. The error messages name the offending fields.- Or build fresh from the Add Node menu β the registered node signatures are correct, only the example JSONs are stale.
Steps:
- Browser β
http://localhost:8188 - Drag
LowPoly.jsononto the canvas - In
Trellis2LoadModel_GGUF, set:modelname:TRELLIS.2-4Bmodel_format:GGUF Q4_K_M(smallest first download)backend:sdpa(only ROCm-compatible option βflash_attn,xformers,flash_attn_3are CUDA-only)device:cuda(yes, "cuda" β PyTorch ROCm advertises itself as CUDA via HIP)low_vram:Truekeep_models_loaded:True
- In
Trellis2LoadImageWithTransparency_GGUF, upload a clear-subject reference image - Critical: in
Trellis2PreProcessImage_GGUF, setremove_background: Trueif your image is RGB (no alpha). SetFalseonly if you've pre-cut a transparent PNG yourself. - Queue Prompt
First run downloads ~2.5 GB of weights from Aero-Ex/Trellis2-GGUF to ~/ComfyUI/models/Trellis2/. Expect 5β10 min download then ~30 s generation. Output .glb files appear in ~/ComfyUI/output/3D/.
model_format |
Disk | VRAM working set | Notes |
|---|---|---|---|
GGUF Q4_K_M |
~2.5 GB | ~6 GB | Smallest; surprisingly capable for shape, slightly soft textures |
GGUF Q5_K_M |
~3 GB | ~7 GB | Good balance |
GGUF Q6_K |
~3.5 GB | ~8 GB | Diminishing returns above this for shape |
GGUF Q8_0 |
~4.5 GB | ~10 GB | Near-BF16 quality |
Safetensors (FP8) |
~4 GB | ~9 GB | Faster than GGUF on some GPUs |
Safetensors (BF16) |
~8 GB | ~16 GB | Reference quality (needs Step 5 patch) |
Voxel resolution (pipeline_type field on Trellis2MeshWithVoxelAdvancedGenerator_GGUF) is independent of quant β 512 is fast (~30 s), 1024 is detailed (~90 s), 1024_cascade is max quality (~3 min). Each resolution downloads a separate set of weight files on first use.
No module named 'custom_rasterizer' β see Step 6.
IndexError: index 3 is out of bounds for axis 2 with size 3 β Trellis2PreProcessImage_GGUF tried to read alpha on an RGB input. Fix: enable remove_background: True, OR upload a transparent PNG.
Generation hangs at 85% in custom frontend integrations β ComfyUI 0.18+ emits execution_success as the workflow-end WebSocket event, not the legacy null-node executing. Listen for both:
elif msg["type"] == "execution_success" and msg["data"].get("prompt_id") == prompt_id:
break
elif msg["type"] == "executing" and msg["data"].get("node") is None:
breakHSA_STATUS_ERROR_INVALID_ISA β native extension built for wrong gfx target. Rebuild with the correct PYTORCH_ROCM_ARCH=<your_gfx>.
Entry Not Found for url: https://huggingface.co/...bf16_bf16.safetensors β Step 5 BF16 patch not applied.
Custom validation failed for node β device: 'True' not in [...] β Aero-Ex example workflow JSON has widget-position drift. See Step 8 heads-up.
HIPBLAS_STATUS_INVALID_VALUE on RDNA3 β add to your launch env:
export TORCH_BLAS_PREFER_HIPBLASLT=0hipBLASLt has shape gaps on RDNA3 for certain matmul sizes; falling back to hipBLAS costs ~5β10 % on those matmuls but handles every shape.
OpenGL context creation fails β nvdiffrast needs a usable GL context. On a desktop with a connected display this works; headless servers may need EGL/GBM fallback or Xvfb.
- TRELLIS via SDNQ quants β alternative quantization scheme;
Trellis2LoadModel_SDNQinstead of_GGUF. Same install applies. - Mesh refinement β
Trellis2MeshRefiner_GGUFruns a second pass at higher voxel resolution conditioned on multiple views. Adds 1β2 min, recovers thin features. - Upstreaming the BF16 fix β patch
05is small and clear. PR welcome from anyone with cycles.
- microsoft/TRELLIS.2 β the model
- Aero-Ex/ComfyUI-Trellis2-GGUF β ComfyUI integration with GGUF quants
- egore/comfyui-trellis2-gguf-rocm β the ROCm install script + HIP patches this guide builds on
- kijai/ComfyUI-Hunyuan3DWrapper β source of the
custom_rasterizerextension TRELLIS shares
If this guide saved you time, β star the repo and link upstream too.
MIT β see LICENSE.