MeshTools Postprocess
Make the generated mesh not-terrible in one node
- trimesh
- trimesh
MeshTools Postprocess is the "make it not-terrible" node. Every image-to-3D generator hands you a mesh with the same three problems: little disconnected fragments floating in space, zero-area faces, and a face count that's a multiple of what you actually need. The community thread on cleaning up Hunyuan3D output describes it exactly - "so many vertices and faces intersect, there are hidden faces and unnecessary jumbling." This node is the automated first pass at that mess, and it lives in the ComfyUI-MeshTools pack as the default cleanup stage after any generator.
The KB's 3D generation essay makes the case for why this matters: static props and 3D prints are usable straight out of generation, but only if you're willing to clean up the geometry underneath. Printers don't care about topology, but they do care about watertight meshes, and hidden or degenerate faces can break a slicer. Postprocess is the fastest fix in this space - no Blender import, no manual selection loops.
How it works
The node chains four independent steps, each with its own toggle, so you can mix and match:
remove_floaters(default on) - uses pymeshlab to find small disconnected components floating in space and deletes any smaller than 0.5% of the total face count. That's your "why is there a triangle cloud orbiting my object" fix.remove_degenerate_faces(default on) - drops zero-area faces, which are common in generated meshes and cause rendering artifacts, UV problems, and slicer complaints. It does this in pure trimesh: faces with no area are removed and orphaned vertices cleaned up.reduce_faces(default on) - decimates the mesh down tomax_facenumusing pymeshlab's quadric edge collapse, which preserves the overall shape while cutting triangles aggressively. Note it's a cap: if your mesh is already undermax_facenum, this step silently does nothing.smooth_normals(default off) - recalculates vertex normals with area-weighted averaging for smoother shading. Off by default because it softens intentionally hard edges.
The inputs that matter
Only two really:
max_facenum(default 40,000) - the target ceiling whenreduce_facesis on. The author's guidance is sensible: 40k is a good detail/performance balance, 100k+ if you're printing, and 10k–20k for real-time/game use. Set this based on your destination, not your ego.remove_floaters/remove_degenerate_faces- leave both on. Turning them off is only for when you've already cleaned the mesh and want to skip the round-trip through pymeshlab (it's not slow, but it does write temp files).
Output is a single trimesh socket, ready to flow into Export or further processing.
Installing
Same story as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/agenticvibes/ComfyUI-MeshTools
cd ComfyUI-MeshTools
pip install -r requirements.txt
Or search "ComfyUI-MeshTools" in ComfyUI Manager. No models to download; pymeshlab is the heavyweight dependency here and it's CPU-only.
Common issues
- "It didn't reduce my faces" - check the count first. If you're under
max_facenum, the reduction step skips by design. Crank the target down. - Big disconnected chunks survived - the floater filter only removes fragments under 0.5% of the face count. A large chunk that's genuinely separate from the main object won't be touched. For that you'd want a connected-component selection with a real threshold, which this node doesn't expose.
- Normals look weird after - that's
smooth_normalsdoing exactly what it says. If a mesh has hard edges you want to keep, leave it off and let the export format carry whatever shading data exists.
The honest limit: this is a cleanup node, not a repair one. It removes junk and shrinks counts, but it won't fill holes, fix non-manifold edges, or give you clean topology. That's what the Remesh node is for.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| trimesh | TRIMESH | Input 3D mesh to process | |
| remove_floaters | BOOLEAN | true | Remove small disconnected mesh fragments that float in space |
| remove_degenerate_faces | BOOLEAN | true | Remove zero-area faces that can cause rendering artifacts |
| reduce_faces | BOOLEAN | true | Reduce polygon count using quadric edge collapse decimation |
| max_facenum | INT | 400001–10000000 | Maximum number of faces after reduction. Only used when reduce_faces is enabled |
| smooth_normals | BOOLEAN | false | Recalculate vertex normals for smoother shading |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| trimesh | TRIMESH | — |