Nodes/ComfyUI-BPT/Trimesh Save
ComfyUI Node

Trimesh Save

The polite way to get a mesh out of ComfyUI

By Easymode-ai·Created about a year ago·Updated about a year ago· 12
Trimesh Save
  • trimesh
    filename_prefix3D/BPT_
    file_format

    Trimesh Save is the "for keeps" counterpart to Trimesh Preview. Where the preview node writes a temp file and returns a path for a viewer, this one writes a properly named, auto-numbered file to your output folder so you can actually use the mesh - import it into Blender, drop it in a game engine, or send it to a slicer. Every workflow that generates or remeshes geometry should end at a node like this, and this is the one this pack gives you.

    It's one of the four nodes in ComfyUI-BPT, the wrapper around Tencent's BPT remesher. The pack operates on the TRIMESH type - the same mesh type kijai's ComfyUI-Hunyuan3DWrapper and Microsoft's TRELLIS output - so Trimesh Save is the natural final stop for any of those meshes. The README itself points at this exact use: take the .glb that TRELLIS produces, run it through the pack, and save it back out here.

    How it works

    Under the hood it reuses ComfyUI's standard save-image path logic (get_save_image_path), which means the same counter behavior you know from SaveImage: write once, the file is BPT_00001_.glb; run again, BPT_00002_.glb. The mesh itself is written with the Python trimesh library, so you get the raw geometry in whatever format you asked for - no textures, no scene graph mangling, just the mesh.

    Inputs

    Three inputs, two of them worth touching:

    • trimesh (TRIMESH) - the mesh to save. Wire it from the BPT node, Trimesh Load, or any Hunyuan3D/TRELLIS mesh in your graph.
    • filename_prefix - defaults to 3D/BPT_. The 3D/ part creates a subfolder in ComfyUI/output/, so your meshes land in output/3D/. Change BPT_ to something recognizable and you'll thank yourself later. To write directly to the output root, drop the slash and use just a prefix like my_mesh_.
    • file_format - glb, obj, ply, stl, 3mf, or dae. This is the one that matters for what happens next: glb for engines and Blender, obj for interchange, stl/3mf for 3D printing. Pick based on your destination, not habit.

    It's an output node with no outputs to wire onward - it terminates the chain.

    Installing the pack

    Install once and it applies to all four nodes. Easiest: ComfyUI Manager, search "ComfyUI-BPT". Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Easymode-ai/ComfyUI-BPT
    

    Then install the dependencies (the README targets the portable install's Python):

    cd ComfyUI/custom_nodes/ComfyUI-BPT
    ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt
    

    The dependency list is heavy - deepspeed, torch_geometric, trimesh and friends - so expect a real install, not a blink. Saving a mesh doesn't load the BPT model weight, so you don't need that file for this node alone.

    Troubleshooting

    • "The filename, directory name, or volume label syntax is incorrect" when using a prefix with slashes on a single-level path - the 3D/ subfolder is created automatically, but avoid weird characters in your prefix.
    • File appears but looks wrong in another app. Check the file_format you chose matches what you actually need; glb and dae carry more structure than stl, which is geometry-only.
    • Nothing in output/? Look in output/3D/ - the default prefix puts it in a subfolder, easy to miss the first time.
    CategoryBPT

    Inputs (3)

    NameTypeDefaultDescription
    trimeshTRIMESH
    filename_prefixSTRING3D/BPT_
    file_formatCOMBO6 options: glb, obj, ply, stl, 3mf, dae

    Outputs (0)

    No outputs