Nodes/Avatar Graph/Mesh Fill Holes
ComfyUI Node

Mesh Fill Holes

Automatically patching small gaps in Avatar Graph

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Fill Holes
  • BPY_OBJ
  • BPY_OBJ
sides4

Mesh-generation steps in Avatar Graph - extracting a masked region, decimating, remeshing - can leave small open boundaries behind: gaps in the surface where faces should be but aren't. Mesh Fill Holes finds those gaps automatically and patches them, without you having to manually select each boundary loop and hit "fill" yourself.

How it works

This wraps Blender's mesh.fill_holes operator. It scans the mesh for open boundary loops - places where an edge only has one face attached instead of two - and fills any hole whose loop is small enough, based on the sides parameter. This is the detail that catches people: the default doesn't fill everything, it only fills holes made of up to that many edges.

The inputs and outputs that matter

  • BPY_OBJ - the mesh to scan and patch.
  • sides (default 4) - the maximum boundary-loop size, in edges, that counts as fillable. At the default, a small triangular or quad-shaped gap gets patched; a larger, more irregular hole with more than four boundary edges gets left alone. Set it to 0 to remove the size limit entirely and fill every hole on the mesh regardless of how big it is.

Output is a single BPY_OBJ, the same mesh with qualifying holes closed.

How to install it

ComfyUI Manager, search "Avatar Graph" and install, or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui

then pip install -r requirements.txt and restart. Needs Blender's bpy module, pinned to Python 3.10.x - a dedicated conda environment on macOS/Linux, or Avatech's prebuilt Python-3.10 ComfyUI zip on Windows with the pack installed through Manager afterward.

Common issues & troubleshooting

If the mesh still has visible holes after this node runs, check sides first - the default 4 is conservative on purpose, and any boundary loop bigger than that gets skipped entirely rather than partially filled. If you're cleaning up after something that can leave larger, irregular gaps (a mask extraction with a complex boundary, a heavy decimate pass), set sides to 0 so nothing gets excluded by size.

A bpy import failure at ComfyUI startup is the pack's Python-version pin, not this node specifically - confirm you're running a clean Python 3.10.x environment with requirements.txt installed without errors.

One thing worth knowing before you rely on this as a catch-all: it fills based on boundary topology, not on whether the fill actually looks good. On a hole with an awkward, non-planar boundary, the automatic fill can produce a valid but visually ugly patch - flat where the surrounding surface curves, or with faces that pinch oddly. For a hole that matters visually (versus one you just need closed for solidity or export), it's worth eyeballing the result rather than assuming "no more holes" means "looks right."

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
sidesoptINT40–1000

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ