Nodes/ComfyUI-UtilsCollection/Image Inward Edge Fill (Legacy)
ComfyUI Node

Image Inward Edge Fill (Legacy)

Fill a hole by pulling the surrounding pixels in, not by guessing

By silveroxides·Created 2 months ago·Updated about 7 hours ago· 24
Image Inward Edge Fill (Legacy)
  • image
  • mask
  • image
inpaint_radius3
edge_blend_blur9

When a mask punches a hole in your image and you just want the hole gone - no diffusion pass, no inpaint model, no seed lottery - Inward Edge Fill (Legacy) is the deterministic fix. It takes an image and a mask, and fills the masked region by dragging the surrounding edge pixels inward. It's the node version of Photoshop's "content-aware-ish" gap filler, but cheaper and fully repeatable.

The mechanism is OpenCV's Navier-Stokes inpainting (cv2.INPAINT_NS). That sounds fancy, and it kind of is: it models how fluid flows into the hole and propagates the nearby colors and gradients inward, which is why edges and textures smear naturally rather than just getting a flat average slapped over them. It's not a diffusion model and it won't invent detail, but for blanking out a watermark, a scratch, a power line, or a blemish region, it's instant and deterministic - same input, same result, every time.

The inputs that matter

  • image / mask - the source and the region to fill. The mask is resized to match if its dimensions differ.
  • inpaint_radius - how far the algorithm looks for edge pixels. Higher values handle larger holes but get slower. 3 is a fine starting point; bump it for big regions.
  • edge_blend_blur - a Gaussian blur on the mask boundary after filling, so the patched area blends into the original instead of showing a hard edge. 9 default, 0 disables.

The output

A single image with the masked region filled. It drops into any pipeline as a normal IMAGE - before a compositor, before a VAE encode, wherever you need a cleaned-up frame. RGBA inputs are handled: the RGB channels are inpainted and alpha is preserved.

Installing it

Part of silveroxides/ComfyUI-UtilsCollection. ComfyUI Manager → search ComfyUI-UtilsCollection → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection

Restart after. Dependencies: opencv-python (this node is a thin wrapper over it) and typing-extensions. No models, no downloads. "(Legacy)" marks the compat alias for the pack's canonical UC_ImageInwardEdgeFill.

Where people get burned

The honest limitation: this is interpolation, not generation. On large holes - say, half a face or a big chunk of background - it produces smear, and that's expected. Keep it for small-to-medium regions where the surrounding context tells you exactly what belongs there. The other gotcha is the binary threshold: the mask is treated as strictly on/off (a value of 127 or more means "fill"), so a soft feathered mask from an upstream node gets hard-edged here regardless of its gradient. Soften the result with edge_blend_blur rather than expecting the mask's own feathering to carry through.

Categoryadvanced/image

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
maskMASK
inpaint_radiusINT31–100How far the algorithm looks for edge pixels. Higher values are slower but better for large holes.
edge_blend_blurINT90–101Applies a Gaussian blur to the mask to smoothly blend the filled area with the original edges. 0 disables it.

Outputs (1)

NameTypeDescription
imageIMAGE