Nodes/ComfyUI_TRELLIS/Trellis_LoadModel
ComfyUI Node

Trellis_LoadModel

Where Your TRELLIS Install Lives or Dies

By smthemex·Created 2 years ago·Updated about a year ago· 181
Trellis_LoadModel
    • model
    repoJeffreyXiang/TRELLIS-image-large
    dino
    attn_backend
    spconv_algo

    "Load a model" is the most boring node name in this pack, but it's the node that decides whether you end up with a 3D model or a wall of Python errors. Trellis_LoadModel is the front door to Microsoft's TRELLIS - the structured-3D-latents model from late 2024 that made image-to-3D actually usable - and everything else in ComfyUI_TRELLIS (the sampler, the multi-image loader) hangs off what this node hands you. Get this one working and the hard part is behind you.

    What it actually does

    The node picks which TRELLIS pipeline to load and flips two environment knobs before handing the pipeline to the sampler. Whether you get image-to-3D or text-to-3D is decided by the repo field: if the string "text" is in the name, you get the text pipeline; otherwise it's image mode. On first run it downloads the model from Hugging Face into your HF cache (several gigabytes), or you can point repo at a local folder if you pre-downloaded it.

    The inputs that matter

    • repo - Hugging Face id or a local path. Default is JeffreyXiang/TRELLIS-image-large; switch to JeffreyXiang/TRELLIS-text-large for text-to-3D.
    • dino - this is the one that trips everyone. Despite the name it's a dropdown of the checkpoints found in ComfyUI/models/dinov2 (image mode) and ComfyUI/models/clip (text mode). TRELLIS needs a vision encoder to make sense of your image, and the official code reaches for GitHub at runtime, so the pack author swapped in an offline DINOv2 checkpoint. If the dropdown only offers "none", you haven't dropped dinov2_vitl14_reg4_pretrain.pth into models/dinov2 yet - and the node refuses to run.
    • attn_backend - xformers or flash-attn. Pick the one you actually installed; the README is explicit that one of them is required.
    • spconv_algo - auto or flash-native. Leave it on auto unless you have a reason.

    Its one output, model (type MODEL_TRELLIS), wires straight into the model input on Trellis_Sampler. Nothing else consumes it.

    Installing this pack is the real work

    Clone it into ComfyUI/custom_nodes and restart, then run the requirements - but don't let pip install -r requirements.txt fool you into thinking you're done. That file (torch, trimesh, xatlas, rembg, onnxruntime-gpu, xformers, utils3d from git, and more) is the easy half. The part that eats people's afternoons is the compiled extensions:

    cd ComfyUI/custom_nodes
    git clone https://github.com/smthemex/ComfyUI_TRELLIS.git
    cd ComfyUI_TRELLIS
    pip install -r requirements.txt
    
    # then the native extensions, matched to your torch/CUDA:
    pip install kaolin -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu124.html
    pip install ./tmp/extensions/nvdiffrast
    pip install ./tmp/extensions/diffoctreerast
    pip install ./tmp/extensions/mip-splatting/submodules/diff-gaussian-rasterization/
    pip install spconv-cu120   # or spconv-cu118 for CUDA < 12
    pip install ./tmp/extensions/vox2seq
    

    On Windows you additionally need Visual Studio on the box with cl.exe on your PATH and CUDA_PATH set, or those native builds will fail in confusing ways. The repo ships a setup.sh that automates the whole gauntlet with flags (--kaolin, --nvdiffrast, --vox2seq, …), which beats doing it by hand. Expect this to be the longest part of the whole process - "works great once it works" is the community's honest summary of TRELLIS, and this is why.

    Models you'll need

    • The TRELLIS repo itself (auto-downloaded or a local path in repo)
    • dinov2_vitl14_reg4_pretrain.pth in ComfyUI/models/dinov2 for image mode
    • a CLIP checkpoint (clip_l.safetensors) in ComfyUI/models/clip for text mode

    Common issues

    • OOM on first run. Stock TRELLIS wants ~16GB VRAM; fp16 builds get it down to ~8GB, and 12GB cards run it fine. If you're on 8GB, expect to lower texture_size and close everything else.
    • The dino dropdown shows only "none". You put the encoder weights in the wrong place or skipped them.
    • Backend mismatch. Picked flash-attn in the node but only installed xformers - or vice versa. Install one, then select it.
    • torch 2.6. Per the README, bumping torch past 2.5.1 means rebuilding kaolin and diff-gaussian-rasterization, so pin your versions and resist the upgrade itch.
    CategoryTrellis

    Inputs (4)

    NameTypeDefaultDescription
    repoSTRINGJeffreyXiang/TRELLIS-image-large
    dinoCOMBO1 options: none
    attn_backendCOMBO2 options: xformers, flash-attn
    spconv_algoCOMBO2 options: auto, flash-native

    Outputs (1)

    NameTypeDescription
    modelMODEL_TRELLIS