Nodes/ComfyUI-MeshTools/MeshTools Simple Decimate
ComfyUI Node

MeshTools Simple Decimate

Set a target, get a mesh

By agenticvibes·Created 5 months ago·Updated 5 months ago· 0
MeshTools Simple Decimate
  • trimesh
  • trimesh
subdivideParts16
target_face_num
target_face_ratio

MeshTools Simple Decimate is the node you reach for when your mesh has 2 million faces and you need 200,000, and you'd rather not think about it for more than ten seconds. It wraps the same meshlib decimation engine as the pack's Advanced node, but strips it down to the two settings that matter: a target face count or a target ratio. No strategy enum, no error budgets, no boundary-shift thresholds. Just shrink the mesh.

Why you'd want that: everything this pack touches starts life as a generated mesh, and generated meshes are absurdly heavy. Hunyuan3D and TRELLIS output raw triangle counts that drag in game engines, choke slicers, and make Blender sluggish to orbit. A common workflow after cleanup is to decimate the mesh down to something the destination can actually chew - and this node is the zero-thought way to do it. It's also the "I need to upload this to a site with a file cap" node, and the "my viewport is dying" node.

How it works

The mechanism is meshlib's decimateMesh, running under the hood through its Python bindings. The node packs the mesh optimally (a meshlib preprocessing pass that reorders data for cache-friendly access), then collapses edges one at a time - each collapse removes a face while trying to keep the overall shape - until it hits your target. It's CPU work and it's fast; a million-face mesh decimates in a couple of seconds on a modern machine.

The inputs are the whole story:

  • trimesh (TRIMESH) - the mesh to shrink.
  • target_face_num (INT) - absolute face count. Set this or the ratio, not both in a way that fights.
  • target_face_ratio (FLOAT, max 0.999) - fraction of the original. 0.5 = half the faces. Handy when you don't know the starting count.
  • subdivideParts (INT, default 16) - the number of parallel threads meshlib uses. Match it to your CPU core count; on an 8-core machine set 8.

Output is a trimesh you can feed straight into Export, or into Postprocess if the result needs a sweep.

Installing

Standard pack install:

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 and restart. meshlib is the real dependency here; it's a substantial library (MeshLib is a full commercial-grade 3D processing toolkit with a free open-source tier) but it installs cleanly from PyPI. No models, no GPU.

Common issues

  • "target_face_num or target_face_ratio must be set" - the one real trap. Both default to 0, and 0 means "no target," so the node raises a ValueError rather than guessing. Set one.
  • Not sure of the starting count - use the ratio. It needs no knowledge of the original size. 0.1 gets you a tenth of the faces.
  • Shape looks slightly off at high reduction - expected. Decimation always trades a little fidelity for a lot of triangles; this node has no quality knobs to soften the trade. If you need shape-preserving magic, that's the Advanced node's strategy and maxError settings.

The one-line version: this is the decimator you actually use, and the Advanced node is the one you pull out when this one's results aren't good enough.

CategoryMeshTools

Inputs (4)

NameTypeDefaultDescription
trimeshTRIMESHInput mesh to decimate
subdividePartsINT161–64Number of CPU cores to use
target_face_numoptINT0–10000000Target face count. Set either this or target_face_ratio
target_face_ratiooptFLOAT0–0.999Target as fraction of original (0.5 = half). Set either this or target_face_num

Outputs (1)

NameTypeDescription
trimeshTRIMESH