Mesh Normals Make Consistent
The Shift+N of ComfyUI mesh nodes
- BPY_OBJ
- BPY_OBJ
If you've ever opened a generated mesh and half of it looks weirdly dark or see-through from the "wrong" side, this is the fix - and it's usually the first thing anyone touches when a mesh looks broken. This node is a direct wrap of Blender's "Recalculate Normals" operator, the one every Blender tutorial teaches you as Shift+N within the first week.
What it is and why you'd reach for it
Every face on a mesh has a normal - a direction it's considered to be "facing" - and rendering, lighting, and even some geometry operations depend on those normals pointing the right way. Meshes built or edited programmatically (which is exactly what this pack's whole pipeline does, generating and slicing meshes from segmented character images) are prone to ending up with a mix of inward- and outward-facing normals, especially after operations like poking, offsetting, or joining. The symptom is inconsistent shading: parts of the mesh look inverted or oddly flat compared to their neighbors. Run this node and it fixes it in one pass, mesh-wide.
How it works
It's a topology-aware flood fill, not a guess. Blender walks the connected faces of the mesh and flips normals as needed so they all agree on an "outside," using the mesh's actual connectivity to decide which way is consistent rather than any per-face heuristic. That's why it's reliable on organic, irregular meshes - the kind this pack generates from photo segmentation - where a simpler "always point up" rule would fail.
The inputs and outputs that matter
One field, and it's a straightforward toggle:
inside(boolean, default off) - leave it off and normals get recalculated to point outward, which is what you want essentially all the time. Flip it on and they're recalculated to point inward instead - rare, but occasionally intentional if you're building a mesh meant to be viewed from within (a dome, an interior shell).
Output is the standard single BPY_OBJ, geometry unchanged, normals corrected.
How to install it
ComfyUI Manager: search Avatar Graph, install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
python -m pip install -r requirements.txt
The pack needs Python 3.10.x, no exceptions - it's built on bpy, Blender shipped as a pip package, and bpy wheels only exist for specific Python minor versions. The README is upfront about this: Windows users get a separate embedded-Python-3.10 zip to unpack into the ComfyUI folder specifically to dodge version mismatches, and macOS/Linux users are told to use a pinned conda create --name comfyui python=3.10 environment rather than whatever ComfyUI's default Python happens to be. Restart with --enable-cors-header (add --force-fp16 on Mac) if you want the live avatar preview panel to work - without it you still get a working graph, just no real-time viewer, and you'd export a .glb/.gltf from the Avatar Main Output node to check the result elsewhere.
Common issues
If the install step fails while pulling in bpy, it's almost never a broken package - check your Python version first, it's the far more common cause. If running this node doesn't visibly change anything, that's actually a good sign: it means your normals were already consistent, and this was a no-op safety pass, which is fine to leave in a pipeline permanently as cheap insurance after any mesh-generating step. If flipping inside gives you the opposite of what you expected, remember it's mesh-wide - there's no per-face selection exposed here, so you can't recalc just one region while leaving the rest alone; for that level of control you'd need to do the selection upstream before this node runs.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| insideopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |