ComfyUI Node

Blur Mask

Feather your inpaint mask so the seam disappears

By wmpmiles·Created 2 years ago·Updated about a year ago· 5
Blur Mask
  • mask
  • mask
  • mask_image
blur1.00
expand0

Blur Mask is the mask-prep node that fixes the most common inpainting complaint: the visible seam. Hard mask edges are great for selecting a region and terrible for blending it back - the boundary reads as a line where one thing starts and another ends. This node expands the mask and blurs its edge, turning that hard boundary into a graded transition. It's the difference between "obviously pasted" and "did you even touch this."

It's the pack's in-house answer to the feathering step in the inpainting playbook: three inputs, mask, blur, and expand; two outputs, mask and mask_image.

The inputs that matter

  • blur (FLOAT, default 1, min 0) - the Gaussian sigma of the edge blur. Higher = softer transition. 0 disables blurring. This is the knob that actually controls seam visibility.
  • expand (INT, default 0, min 0) - how many pixels to dilate the mask outward first (morphological dilation). Growing the mask a few pixels means the feather doesn't eat into the region you actually wanted covered - if your inpaint coverage is falling short at the edges, this is the fix.
  • mask - the MASK you want to feather. Standard single-channel mask.

The mechanics: if expand > 0, the mask is dilated; then if blur > 0, a Gaussian kernel is applied separably (the kernel radius is derived from sigma with a 0.99 coverage cutoff). Both off and it passes through unchanged, which makes it a handy place to keep a mask on a "currently disabled" setting.

The two outputs

  • mask - the processed MASK tensor, ready to feed an inpainting pipeline, a composite node, or Mask-Crop Inpaint | Post's mask input (where a feathered mask produces that soft, seam-free blend).
  • mask_image - the same mask rendered as a 3-channel IMAGE (the mask repeated across channels), so you can preview it with a regular image preview node or wire it into anything that wants an image rather than a mask.

That second output is a small quality-of-life thing you'll actually appreciate: being able to see your feathered mask as an image beats squinting at a MASK socket.

Using it in the crop workflow

In a Mask-Crop Inpaint pipeline, Pre gives you a mask for the sampler, and Post takes a composite mask for the final blend. If you want a hard generation region but a soft blend, use a tight mask for Pre and a blurred/expanded one for Post - or simply blur the mask feeding Post directly. The expand control matters there too: blur shrinks the effective coverage, and expand compensates so you don't end up with a gap between what was generated and what gets composited.

Installing

Ships in comfyui-some-image-processing-stuff:

cd ComfyUI/custom_nodes
git clone https://github.com/wmpmiles/comfyui-some-image-processing-stuff

Restart, or ComfyUI Manager → search "Some Image Processing Stuff". No models, no dependencies beyond PyTorch - the whole blur is a separable convolution, so it's instant even on big masks.

Categorymask

Inputs (3)

NameTypeDefaultDescription
maskMASK
blurFLOAT1.00
expandINT0

Outputs (2)

NameTypeDescription
maskMASK
mask_imageIMAGE