Nodes/ComfyUI-UtilsCollection/Image Inward Edge Fill
ComfyUI Node

Image Inward Edge Fill

Fill those borders from the inside

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

Regular padding stretches or repeats edge pixels, which gives you a blurred smear if the border is more than a few pixels wide. UC_ImageInwardEdgeFill does the smarter thing: it fills the masked border region using the image's own content, looking inward from the unmasked area to reconstruct the edge. Think of it as content-aware border extension without the AI.

This is the prep step for a lot of output-hungry workflows. You've got an image with letterbox bars, a watermark band, or a torn border you want to remove before the real work starts. Mask the region, run this, and you get a border filled from genuine surrounding pixels instead of a duplicated streak - which means the later inpaint or upscale pass has something sane to work with.

How it works

You give it image and a mask marking what to fill. The algorithm pulls pixel data from the unmasked interior and extends it outward into the masked zone, choosing the nearest valid edge pixels for each hole. Two knobs tune it:

  • inpaint_radius (default 3) - how far the algorithm searches for source pixels. Higher is slower but handles large holes; keep it low for thin borders.
  • edge_blend_blur (default 9) - a Gaussian blur on the mask that softens the boundary between filled and original content, killing visible seams. Set to 0 to disable.

Single output: the image with its border filled.

When to reach for it

Anytime a border region must disappear but the fill needs to plausibly continue the scene - removing letterbox bars before an upscale, cleaning a watermark strip, or pre-filling an edge before an outpaint so the model has a hint of what belongs there. For pure padding (add canvas around an image), the pack's UC_ImagePad is the better tool; this one replaces content, it doesn't add canvas.

Installing it

ComfyUI Manager → search "ComfyUI-UtilsCollection", or:

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

Restart. Deps are opencv-python and typing-extensions - no models, no downloads. Newer-extension-API pack, so keep ComfyUI updated.

The limit to know: it fills from available content, so it can't invent detail that isn't there. For a narrow letterbox bar it's essentially invisible; for a massive torn half of a photo, expect softness - that's what the inpaint/outpaint model pass is for afterward. And the mask is doing the real work, so mask generously but precisely; an unmasked 1px sliver at the edge is why your fill stops a pixel short.

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