Nodes/ComfyUI-BadmanNodes/Mask Blur (Badman)
ComfyUI Node

Mask Blur (Badman)

A gaussian blur node just for masks

By MariusKM·Created 2 years ago·Updated 3 months ago· 4
Mask Blur (Badman)
  • mask
  • MASK
amount6
device

A hard-edged mask produces a hard-edged seam wherever it's used - an inpaint boundary that's visibly a rectangle, a composite where the pasted region has a crisp, obviously-artificial edge, a brightness or color adjustment that stops dead instead of fading out. The fix is almost always the same: blur the mask before you use it, so the effect it's gating fades gradually instead of cutting off. This node is a gaussian blur, scoped specifically to masks.

Why not just reuse an image blur node

You could technically run a mask through an image-blur node if your setup lets you treat a mask as a single-channel image, but a dedicated mask-blur node is the more direct, less error-prone path - no channel-count mismatches, no accidentally blurring color data you didn't mean to touch, just the mask tensor in, a softened version out. It's a small thing, but it's exactly the kind of small thing that saves you a debugging session later when a generic node behaves slightly unexpectedly on a mask-shaped input.

Inputs and outputs

Three required fields:

  • mask - the MASK to soften.
  • amount (integer, 0256, default 6, step 1) - the blur radius. 0 is a no-op. The default 6 is a light, edge-softening touch; values well into the hundreds will blur a mask into something closer to a gradient than a defined shape, which is sometimes exactly what you want (a very gradual falloff for a large-area effect) and sometimes a sign you've gone too far for a normal seam-softening pass.
  • device - an enum, auto / cpu / gpu. Lets you steer where the blur computation runs. auto is the sensible default for most setups; forcing cpu is worth trying if you're tight on VRAM and don't want a blur pass competing with your model for GPU memory, while forcing gpu can be faster on a large batch of masks if you've got VRAM to spare.

One output: the blurred MASK.

Installing it

ComfyUI Manager: search ComfyUI-BadmanNodes, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/MariusKM/ComfyUI-BadmanNodes

No dependencies or downloads - a gaussian blur is standard tensor math, nothing extra to fetch.

Where people get tripped up

The most common mistake is ordering: blur after any shape-changing mask operation, not before. If you're also using this pack's Dilate Erode Mask node, run the dilate/erode pass first to get the shape and margin right, then blur last - blurring a mask and then dilating or eroding the blurred result tends to reintroduce a harder edge right where you just softened one, since morphological operations work on a threshold and a blurred mask has a lot of in-between values sitting right around that threshold. Second, a large amount on a high-resolution mask is genuinely expensive - if your graph feels like it's stalling on this node specifically rather than on the sampler, check whether amount crept up higher than you meant, and consider whether device: cpu or gpu changes the picture for your particular hardware.

CategoryBadman

Inputs (3)

NameTypeDefaultDescription
maskMASK
amountINT60–256
deviceCOMBO3 options: auto, cpu, gpu

Outputs (1)

NameTypeDescription
MASKMASK