ComfyUI Node

Hy3D Postprocess Mesh

Make the raw decoded mesh stop embarrassing you — floaters gone, face count sane

By kijai·Created 2 years ago·Updated 5 months ago· 1,033
Hy3D Postprocess Mesh
  • trimesh
  • trimesh
remove_floaterstrue
remove_degenerate_facestrue
reduce_facestrue
max_facenum40000
smooth_normalsfalse

Whatever comes straight out of Hy3DVAEDecode is not ready to ship. It's a raw marching-cubes extraction: hundreds of thousands of triangles, disconnected bits floating in space, degenerate slivers, and normals that only a mother could love. Hy3DPostprocessMesh is the cleanup step - the one node you'll wire in front of every mesh you actually plan to use, because it does the same post-processing Tencent's own pipeline does before anyone sees the result.

This is the node that makes the difference between "impressive silhouette" and "a mesh I'd hand to someone." The KB's warning about Hunyuan3D output - great surface, garbage topology - is precisely what this node exists to mitigate. It won't retopologize into clean quads (nothing in open weights does that yet), but it will make the geometry sane enough to print, bake, and export.

The five toggles, in order of effect

  • remove_floaters (default on) - kills disconnected junk: triangles and islands not attached to the main body. If your mesh has little specks orbiting it, this is the fix.
  • remove_degenerate_faces (default on) - deletes slivers and zero-area faces that wreck downstream operations (UV mapping especially).
  • reduce_faces (default on) - decimates the mesh down to max_facenum (default 40,000) faces using a quadric-based reduction. This is the big one: raw output can be many times that, and 40k is a good deliverable size for a game prop or a print.
  • smooth_normals (default off) - recomputes smooth vertex normals at the end. Handy if the surface looks faceted; costs nothing but a couple seconds.

Each step logs its before/after vertex and face counts, so you can watch the mesh slim down in the console. Order is fixed: floaters, degenerate faces, reduction, then optional smoothing.

How it works

The node copies your TRIMESH and applies the same FloaterRemover / DegenerateFaceRemover / FaceReducer classes that Tencent's Hunyuan3D shape pipeline uses, then returns a cleaned TRIMESH. It's pure CPU geometry processing - no model, no VRAM, no sampling. Which means it's fast, and it's also safe to run as many times as you like if you want to try different max_facenum values.

Where it sits

Right after decode and before anything that consumes the mesh:

Hy3DVAEDecode → Hy3DPostprocessMesh → Hy3DRenderMultiView → ...

If you skip it and feed the raw mesh into Hy3DRenderMultiView, you're rendering floaters into your normal/position maps, and the texture stage happily bakes them in. Clean first, paint second.

Install

Part of the pack - Manager search "Hunyuan3DWrapper", or git clone https://github.com/kijai/ComfyUI-Hunyuan3DWrapper into custom_nodes, then pip install -r requirements.txt. No extra dependencies; this node is just trimesh math.

Common issues

  • Faces still too many - you left reduce_faces off, or set max_facenum higher than you think you did. 40k is plenty for a prop.
  • Something important vanished - aggressive floater removal can eat thin, legitimate geometry if it's barely connected. If parts of your object disappear, that's the floaters step being too eager; dial remove_floaters off and inspect.
  • Faceted look after export - enable smooth_normals. If you're exporting to a viewer that computes its own normals it may not matter, but for anything that trusts the file, smooth them.
CategoryHunyuan3DWrapper

Inputs (6)

NameTypeDefaultDescription
trimeshTRIMESH
remove_floatersBOOLEANtrue
remove_degenerate_facesBOOLEANtrue
reduce_facesBOOLEANtrue
max_facenumINT400001–10000000
smooth_normalsBOOLEANfalse

Outputs (1)

NameTypeDescription
trimeshTRIMESH