Nodes/BrainDead Nodes/BD Smart Decimate
ComfyUI Node

BD Smart Decimate

Get a game-friendly triangle count without wrecking the shape

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Smart Decimate
  • mesh
  • mesh
  • status
target_faces50000
preserve_boundarytrue
preserve_topologytrue
quality_threshold0.3
planar_quadrictrue

The uncomfortable truth about image-to-3D models like TRELLIS and Hunyuan3D is that the silhouettes are impressive and the topology is a mess - machine-generated triangle soup, way too dense to ship anywhere. Decimation is the first step of every serious 3D pipeline for a reason. BD Smart Decimate is the BrainDead pack's edge-preserving answer, built on PyMeshLab's quadric edge collapse: point it at a target face count and it thins the mesh while keeping the silhouette and the important creases.

What it is

A TRIMESH-in, TRIMESH-out decimator. You give it a mesh (from a BD mesh node, a load node, or a TRELLIS2/Pixal3D output) and a target_faces count, and it runs MeshLab's simplification filter - quadric error metric edge collapse, the standard quality-first decimation algorithm - to get there.

How it works

Quadric error collapse repeatedly merges the edge whose removal least disturbs the surface, using a per-vertex quadric error metric. The reason it's "smart" rather than "dumb" is the toggles:

  • preserve_boundary (default true) - keeps the mesh's open edges intact. A hole that wasn't there before is a bug, not a feature.
  • preserve_topology (default true) - constrains the collapse so the mesh's genus/connectivity structure survives; on a clean character mesh you generally want this on.
  • quality_threshold (default 0.3) - how good a face quality you demand; higher preserves quality at the cost of more triangles.
  • planar_quadric (default true) - lets flat regions (a cape, a wall of a prop) collapse aggressively since they don't need density. This is what makes low-poly look clean instead of lumpy.

The one input that matters most is target_faces - default 50,000, but your number depends on the job. A 3D-print or hero prop can sit at 50–150k; a game-ready LOD needs to go far lower. It'll happily go to 100 faces if you ask; whether you should is a different question.

Outputs: the decimated mesh (TRIMESH) and a status string.

Where it fits

The canonical BrainDead pattern is sample-then-decimate-then-restore: sample vertex colors onto a high-poly mesh (BD Sample Voxelgrid Colors), decimate it here, then transfer the colors back onto the decimated mesh with BD Transfer Vertex Colors using face mode for clean, non-bleeding edges. That chain is the whole low-poly game-asset story in three nodes. Decimation is also where you fix the "garbage geometry" problem the 3D community complains about - you can't make bad topology good by decimating, but you can get a clean-looking low-poly mesh out the other side that's actually usable.

Gotchas

The one real requirement: PyMeshLab. It's not in the pack's requirements.txt, so you'll need pip install pymeshlab - and it's a chunky wheel. If the node errors at import time, that's the first thing to check. Also worth knowing: decimating is destructive, so chain it before you do UV work you care about, and keep the original around until you've verified the low-poly passes the eyeball test.

Installing it

ComfyUI Manager: search "BrainDead" → install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt
pip install pymeshlab   # required by this node

Restart, find it under 🧠BrainDead/Mesh. Feed it a TRIMESH from any BD mesh node and start with the defaults - 50k faces, boundary and topology preserved - then ratchet target_faces down until the silhouette complains.

Category🧠BrainDead/Mesh

Inputs (6)

NameTypeDefaultDescription
meshTRIMESH
target_facesINT50000100–10000000
preserve_boundaryoptBOOLEANtruePreserve mesh boundary edges
preserve_topologyoptBOOLEANtruePreserve mesh topology
quality_thresholdoptFLOAT0.30–1Quality threshold for edge collapse
planar_quadricoptBOOLEANtrueUse planar simplification for flat regions

Outputs (2)

NameTypeDescription
meshTRIMESH
statusSTRING