Nodes/ComfyUI-BPT/Trimesh Preview
ComfyUI Node

Trimesh Preview

The node named Preview that actually saves a file

By Easymode-ai·Created about a year ago·Updated about a year ago· 12
Trimesh Preview
  • trimesh
  • relative_path
file_format

The name is a small lie: Trimesh Preview doesn't render anything in your graph. It takes a TRIMESH, exports it to your output folder, and hands you back a path string - which you then feed to an actual 3D viewer node. Think of it as a "save a temp copy so something else can look at it" node, and everything falls into place.

It ships in ComfyUI-BPT, a small wrapper around Tencent's BPT remesher from the Hunyuan3D-2 pipeline. The pack speaks the TRIMESH type, and this node is how you peek at whatever mesh is flowing through your workflow without committing to a full save. In the author's own example workflow, Trimesh Preview feeds its path straight into a Preview3D node (the viewer that ships with kijai's ComfyUI-Hunyuan3DWrapper) so you can rotate the mesh around and check it.

How it works

The node takes your mesh, exports it to ComfyUI/output/ as a temp file, and returns the file's path relative to the output folder. One quirk worth knowing: the code computes a filename like PBTtemp_00000_.glb but actually writes the file under a different name - hy3dtemp_00000_.glb. So don't go hunting for a "PBTtemp" file; the returned path is the real one, and it's what you want to wire onward.

Inputs and output

Only two inputs, and you'll touch one of them:

  • trimesh (TRIMESH) - the mesh to export. Comes from anywhere that speaks the type: the BPT node, Trimesh Load, or kijai's Hunyuan3DWrapper.
  • file_format - one of glb, obj, ply, stl, 3mf, dae. Default to glb; it's the most forgiving for viewers and keeps vertex color info when it's there.

The single output is relative_path (STRING) - the path to the exported file, relative to ComfyUI/output/. Wire it into a viewer node that consumes a path, or into any text node if you just want to see where the file landed.

Installing the pack

Grab the whole pack first - Trimesh Preview is one of four nodes in it. Easiest route is ComfyUI Manager: search for "ComfyUI-BPT" and install. Otherwise:

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

Then install dependencies (the README does it against the portable install's Python):

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

Note this is a chunky dependency list (deepspeed, torch_geometric, trimesh and friends), so give the install time. You only need the BPT model weight if you actually run the BPT node - previewing a mesh you already have doesn't touch it.

Troubleshooting

  • Nothing appears on screen. That's expected - this node doesn't render. Check that a viewer node is receiving the relative_path, and confirm the file exists in ComfyUI/output/hy3dtemp_*.glb.
  • Viewer shows nothing or a broken model. Your chosen file_format and what the viewer accepts may disagree; glb is the safest bet.
  • The file in output/ is named hy3dtemp_…, not what you expected. Known quirk, not a bug you caused.

If all you want is a permanent copy, Trimesh Save is the node you actually want - this one is for looking, not for keeping.

CategoryBPT

Inputs (2)

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

Outputs (1)

NameTypeDescription
relative_pathSTRING