Nodes/comfyui_cv/CV Fill Holes
ComfyUI Node

CV Fill Holes

Fills interior holes of a binary mask - background pixels fully enclosed by foreground become foreground (flood-fill from the border, then OR the unreachable interior back in). Turns a ring into a solid disk, or a motion mask with gaps over an object's low-texture regions into a solid blob - essential before eroding it into a GrabCut seed, so the seed does not punch holes in the object. Objects touching the image edge are handled (the mask is padded before the flood) and an empty mask stays empty.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Fill Holes
  • image
  • mask
Categoryimage/CV/contours

Inputs (1)

NameTypeDefaultDescription
imageCOMFY_MATCHTYPE_V3Binary image (or MASK); non-zero = foreground. The mask comes back in this input's format. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.

Outputs (1)

NameTypeDescription
maskCOMFY_MATCHTYPE_V30/255 mask with interior holes filled, in the image input's format.