Nodes/Melite Autorig Nodes/πŸ”— Load GLB β†’ TRIMESH
ComfyUI Node

πŸ”— Load GLB β†’ TRIMESH

Nothing connects β€” that's the whole job of Load GLB β†’ TRIMESH

By JayDataEngineerΒ·Created 2 months agoΒ·Updated 4 days agoΒ· 1
πŸ”— Load GLB β†’ TRIMESH
    • trimesh
    β—„glb_pathβ–Ί

    This node exists because two other node packs refuse to talk to each other.

    TRELLIS-style image-to-3D wrappers hand you a file path as a string. Auto-riggers like SkinToken want a TRIMESH - an actual Python trimesh.Trimesh object in memory. ComfyUI's type system doesn't coerce one into the other, and it shouldn't; they're different universes. So you get a one-input, one-output adapter node whose whole purpose is to bridge the gap:

    Trellis2ImageTo3D β†’ (STRING) β†’ LoadGLBAsTrimesh β†’ (TRIMESH) β†’ SkinTokenRigTrimesh
    

    If you're staring at two nodes that won't connect, no amount of re-arranging will fix it. This is the wire.

    It's worth a sentence on why this class of "glue node" is a legitimate thing and not bloat. Custom node packs in ComfyUI share one Python environment and no common object model, so every pack invents its own socket types - TRIMESH, MESH, GS_PLY, and so on. The KB's history of 3D in ComfyUI is basically a history of people failing to connect things for this reason. A ten-line adapter is cheaper than everyone re-implementing mesh loading.

    What it actually does

    trimesh.load(path, force="mesh", process=False). Two arguments carry the weight:

    • force="mesh" - a GLB can be a Scene (several meshes, transforms, a hierarchy). This collapses it to one Trimesh. TRELLIS output is single-mesh so it's usually academic, but a multi-part GLB gets concatenated rather than kept apart. If you care about parts, don't route them through here.
    • process=False - trimesh's default processing pipeline merges duplicate vertices and fixes winding. Skipping it keeps your vertex list byte-for-byte as authored. That matters downstream: the sibling-vertex unification and nearest-neighbour weight transfer in this pack both reason about vertex positions and indices, and silent welding would change what they see.

    Before returning, it checks that the loaded object actually has vertices and faces, and raises with the counts if either is empty - so a truncated or zero-byte GLB fails here with a readable message instead of exploding three nodes later.

    Path handling follows the pack's house rule: absolute paths pass through, otherwise it tries ComfyUI's input/ then output/, then walks output/ recursively looking for a matching bare filename. That's what lets you paste kimodo_character.glb without knowing where ComfyUI put it.

    Inputs and output

    One required input: glb_path. It's a STRING with forceInput: True - meaning the author has converted the text widget into a socket, so you cannot type a path into it. You have to feed it a string from somewhere: the TRELLIS node's output, or a core PrimitiveString. That trips people up for five minutes every time.

    Despite the display name, it also accepts GLTF, OBJ and STL.

    One output: trimesh of type TRIMESH. That goes into an auto-rig node's mesh input. In this pack's own pipeline the consumer is SkinTokenRigTrimesh from the vendored ComfyUI-SkinToken submodule - which means the TRIMESH type is defined by that pack. If SkinToken isn't installed, this node will still run, but nothing in your graph will accept its output.

    Install

    cd /path/to/ComfyUI/custom_nodes
    git clone https://github.com/JayDataEngineer/melite-autorig-nodes.git
    

    ComfyUI Manager works too - search "melite". Restart ComfyUI afterwards. The only dependency this node needs is trimesh, which is in the pack's requirements.txt alongside scipy and requests. No Blender, no GPU work, no model downloads.

    Failure modes, honestly

    • "glb_path is empty." You wired a string node in but never set it, or an upstream node returned an empty string on a cache hit. Check the source node's output, not this one.
    • "file not found (checked abs, input/, output/)". The message lists exactly where it looked. Usual cause: the upstream 3D node wrote into a nested subfolder and you passed a path that doesn't match on case or extension.
    • "loaded mesh has no geometry". Genuinely corrupt output from the generator, or a glTF that's metadata-only. Regenerate rather than debug.
    • The mesh loads but rigging later produces nonsense. Not this node's fault, and worth saying plainly: generated meshes have machine-made topology, and the KB's read on the whole field is that topology - not surface quality - is the unsolved problem. A clean vertex array is no guarantee of a riggable one.

    If all you need is to look at the model, ComfyUI's core Load3D node gives you an orbitable viewport and doesn't care about socket types at all. Reach for LoadGLBAsTrimesh only when something downstream demands a live TRIMESH object.

    CategoryMelite/AutoRig

    Inputs (1)

    NameTypeDefaultDescription
    glb_pathSTRINGPath to a GLB/GLTF/OBJ/STL mesh file. Typically the output of Trellis2ImageTo3D.

    Outputs (1)

    NameTypeDescription
    trimeshTRIMESHβ€”