Nodes/BrainDead Nodes/BD Fix Normals
ComfyUI Node

BD Fix Normals

Flipped normals on your generated mesh? This is the fast, Python-only fix

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Fix Normals
  • mesh
  • mesh
  • status
methodcentroid
double_sidedfalse

You've generated a mesh, dropped it into a viewer or a game engine, and it looks like you're seeing it from inside - faces show through, the model looks hollow, or it's weirdly dark on one side. That's flipped normals: the surface triangles are there, they're just oriented inward. Every image-to-3D pipeline produces meshes with this problem at some point, and it's one of the first cleanup passes you'll learn to do. BD_FixNormals is the BrainDead pack's fast, Blender-free answer: reorient face normals to point outward in pure Python, preserving materials and UVs.

The mesh you feed it is a TRIMESH - the pack's full trimesh.Trimesh object carrying vertex colors, UVs, and materials. That's the type used by TRELLIS2, Hunyuan3D-2-1, and every other BD mesh node (Load Mesh, CuMesh Simplify, Blender Decimate, export). Feed it something like that and you get the same mesh back, fixed.

How it works

Four methods, selected by the method combo:

  • centroid (default) - a component-based centroid heuristic. For each connected mesh component it checks whether faces point toward or away from the centroid and flips accordingly. Fast, and great for convex shapes.
  • trimesh - uses trimesh's merge-based fix_normals, which handles more complex/concave topology.
  • both - runs centroid first, then trimesh. Slower, but the most thorough; the one to reach for on organic, non-convex geometry.
  • none - skip geometry fixing entirely. Only useful if you're pairing it with double_sided.

double_sided is the pragmatic second input: it sets the mesh material's doubleSided flag, so the engine renders both sides and masks whatever residual flips you couldn't be bothered to chase. It's a band-aid, but a legitimate one for background props nobody inspects closely.

Outputs are mesh (the fixed TRIMESH) and a status string.

Where it sits in a pipeline

The honest context from the 3D world: generated meshes have garbage topology and you'll be doing cleanup either way. This node is the quick cleanup - the one you run before a preview or before passing a mesh to a decimator, so the simplify step doesn't operate on inside-out faces. For heavy, topology-based normal surgery (custom split normals, hard-edge marking), the pack defers to BD_BlenderNormals, which shells out to a bundled Blender 5.0. Start here; escalate only if the geometry is genuinely gnarly.

Install

Standard BrainDead pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

Or search "BrainDead" in ComfyUI Manager and restart. This node needs trimesh (the pack guards its absence and returns "ERROR: trimesh not installed" if it's missing - pip install trimesh if you ever see that).

Troubleshooting

  • Mesh still looks inside-out after centroid - switch to both; concave or disjoint geometry defeats the centroid heuristic.
  • You're in a hurry and it's a background prop - set double_sided and move on.
  • Normals point every which way after fixing - that's a sign the mesh had duplicate or non-manifold geometry; run BD Mesh Repair or BD MeshLib Fill Holes first, then fix normals again.
Category🧠BrainDead/Mesh

Inputs (3)

NameTypeDefaultDescription
meshTRIMESH
methodCOMBOcentroidcentroid=fast heuristic | trimesh=merge-based | both=combined | none=skip
double_sidedoptBOOLEANfalseSet material doubleSided flag (renders both sides, masks flips)

Outputs (2)

NameTypeDescription
meshTRIMESH
statusSTRING