Nodes/Comfyui-CraftsMan3DWrapper/Save CraftsMan Mesh
ComfyUI Node

Save CraftsMan Mesh

Getting the CraftsMan mesh onto disk (obj, glb, or ply)

By hunzmusic·Created about a year ago·Updated about a year ago· 15
Save CraftsMan Mesh
  • mesh_vf
  • mesh_path
only_max_componentfalse
output_filename_prefixcraftsman_mesh
file_typeobj

Save CraftsMan Mesh is the pack's export node, the one that turns the mesh_vf geometry from Decode CraftsMan Latents into a real file you can open in Blender, drop into a slicer, or view in a browser. Everything before this node exists in ComfyUI's memory; this is where your work becomes an asset.

It's a small node with a couple of decisions worth understanding, because they decide what you can actually do with the result.

What it does

The node takes the vertices/faces tensors, builds a trimesh.Trimesh, runs a little post-processing pass, and exports to your ComfyUI output directory. The post-processing is where the useful behavior hides:

  • fix_normals() - makes the triangle winding consistent so the mesh renders without black-face flicker in viewers.
  • A flat white PBR material is slapped on (baseColorFactor white, metallic 0.05, roughness 1.0). Don't read anything into the values - this wrapper only implements CraftsMan3D's coarse stage, so there's no texture to paint and the mesh ships untextured. The material is just so it doesn't import as featureless black in tools that expect one.
  • Filenames are <prefix>_<8-char-hash>.<ext>, where the hash comes from the vertex/face data. Same geometry, same filename - handy for not spamming your output folder on re-runs.

Inputs that matter

  • mesh_vf (GEOMETRY_VF) - required, from Decode CraftsMan Latents. Nothing else in the pack produces it, and no core ComfyUI node knows this socket type.
  • file_type (obj / glb / ply, default obj) - your format choice:
    • obj - the safest default. Universal, imports cleanly into Blender, slicers, and most tools. No texture, but that's true of all three.
    • glb - for web viewers and quick game-engine previews; self-contained single file.
    • ply - if your downstream tooling is point-cloud or mesh-optimization oriented.
  • only_max_component (false) - splits the mesh into connected components and keeps only the largest. Great for clearing floating debris or stray blobs that sampling sometimes leaves in the scene. Cheap to leave on.
  • output_filename_prefix ("craftsman_mesh") - the base name, and it can include a subfolder: craftman/craftsman_mesh writes into output/craftman/ (the pack's example workflow does exactly this).

The output

mesh_path (STRING) - the full path to the written file. Feed it to a text node, or - like the example workflow - straight into ComfyUI's Preview3D node to orbit the result in-graph before you go looking for the file on disk.

Install

Same as the rest of the pack - Manager (search "CraftsMan3D") or:

cd ComfyUI/custom_nodes
git clone https://github.com/hunzmusic/Comfyui-CraftsMan3DWrapper
cd ComfyUI-CraftsMan3DWrapper
pip install -r requirements.txt   # portable: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt

trimesh does the heavy lifting here and is in the requirements.

Common issues

  • "Valid mesh data dictionary required" - mesh_vf isn't coming from Decode CraftsMan Latents, or you fed it something that claims to be geometry and isn't. Only the decoder's output has the right shape.
  • File not where you expected - it's always in ComfyUI's output directory, plus any subfolder baked into the prefix. If you set a nested prefix and the folder didn't exist, the node creates it.
  • Looks flat and white in a viewer - expected, not a bug. Untextured coarse mesh is all this wrapper produces; texture is the refinement stage it doesn't implement. If you need surface detail, that's a job for a different 3D pipeline (Hunyuan3D or TRELLIS and friends), not this node.

For what it does - write a clean, valid mesh file with a name you can find - it's solid. Just remember the "coarse, untextured" asterisk that applies to everything in this pack.

Categorygeneration/3d/craftsman

Inputs (4)

NameTypeDefaultDescription
mesh_vfGEOMETRY_VF
only_max_componentoptBOOLEANfalse
output_filename_prefixoptSTRINGcraftsman_mesh
file_typeoptCOMBOobj3 options: obj, glb, ply

Outputs (1)

NameTypeDescription
mesh_pathSTRING