Hunyuan 3D 2.1 Export Mesh
The only node in this pack that gets you a file you can actually use
- trimesh
- glb_path
- relative_path
- model_3d
Everything before this node exists inside ComfyUI's RAM. Hy3D21ExportMesh is the moment your generated, postprocessed, UV-wrapped, textured mesh becomes a real file sitting on disk - a .glb you can drag into Blender, drop into a game engine, or put on Sketchfab. It's the end of the line for just about every workflow in this pack, and it's blessedly simple: TRIMESH in, file out.
The node takes your trimesh, a filename_prefix (default 3D/Hy3D - files land in ComfyUI/output/3D/ with that base name), and a file_format from a dropdown: glb, obj, ply, stl, 3mf, or dae. The optional save_file toggle (default true) controls whether it writes to the real output path or to a temp file - leave it on. The single output is glb_path, a string with the relative path of what it wrote, which is handy if you're scripting something after the fact.
Which format do you actually want?
- glb - the default and the one you'll reach for 90% of the time. Binary glTF, self-contained, keeps your textures attached. If you're sending the model anywhere, this is it.
- obj - the Blender-import classic, but it dumps material/texture as separate files you have to re-associate. Fine if you want to work in a traditional DCC.
- ply / stl - geometry-only formats for 3D printing and scanning workflows. Your textures won't survive.
- 3mf - the modern 3D-printing format, if that's your actual endgame.
- dae - COLLADA; mostly useful if some old toolchain still demands it.
How it works
Under the hood it uses trimesh.export(), the same library the whole pack runs on, with ComfyUI's standard output-folder plumbing (so filename collision handling, counters, and subfolder resolution all behave like every other ComfyUI save node). It's an output node - the queue shows it as a terminal step - and it returns the path string rather than another mesh.
Installing it
Nothing special: it ships with the pack and only needs trimesh, which is in the requirements file.
cd ComfyUI/custom_nodes
git clone https://github.com/visualbruno/ComfyUI-Hunyuan3d-2-1
cd ComfyUI-Hunyuan3d-2-1
pip install -r requirements.txt
Where people get confused
Two gotchas. First, exporting a mesh that was never UV-wrapped or never baked gives you a perfectly valid file with no texture - the export node won't warn you, it just writes what's in the TRIMESH. Second, the returned glb_path is relative to the output folder, not an absolute path, so if you're feeding it into a shell script, prefix it with your output directory. And if your file opens looking gray in Blender, that's usually Blender's viewport lighting, not your export - check the texture is embedded (it is, in glb) before you blame the node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| trimesh | TRIMESH | — | |
| filename_prefix | STRING | 3D/Trellis2 | — |
| file_format | COMBO | 6 options: glb, obj, ply, stl, 3mf, dae |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| glb_path | STRING | — |
| relative_path | STRING | — |
| model_3d | FILE_3D | — |