Blur Mask
Blur a mask without feathering it at the image edges — the edge case this node exists for
- mask
- MASK
Blurring a mask sounds trivial, until your mask touches the edge of the image. Standard Gaussian blur treats the outside of the image as empty black, which drags the mask's values toward zero along every border - you get an unintended feathered fade along the edges, and your "blur just the interior" operation quietly eats your mask. Blur Mask from Pirog's Nodes is the version that handles this properly: near image boundaries it switches to reflection-mode blur, so the mask keeps its edge values where it matters while the interior gets the smoothing you asked for.
How it works
The node computes a distance map from each pixel to the nearest image boundary. Pixels within a protection zone (roughly twice the blur radius) get blurred with reflection padding - the image is mirrored at the edge, so boundary values don't collapse toward zero. Interior pixels get a plain Gaussian blur. The two results are blended with a smoothstep transition based on distance, so there's no hard seam between "protected" and "not protected." That's the whole trick, and it's genuinely clever for a three-input node.
The inputs
- mask - the
MASKto blur. - blur_radius (0–100, default 2) - the Gaussian sigma. 0 returns the mask untouched, which is a fine shortcut when you want the node in the graph but no blur yet.
- tapered_corners (default on) - the edge-protection toggle. On is the smart behavior above. Turn it off and you get a plain Gaussian blur with
constantedge mode - the naive behavior you're probably replacing. It exists so the node can also act as a dumb blur when you want one.
Output: MASK, same size as the input.
When you need it
Anywhere a mask feeds something edge-sensitive: inpainting regions that run to the canvas border, gradient masks for compositing, or any mask you want to soften before it drives a blend. The pack's own docs call it out as the fix for "blur a mask without edge artifacts" - the exact problem that has you hunting through other packs for a workaround. It pairs naturally with Image Blend by Mask and Blur by Mask, which will happily use a softened mask.
Installing it
Part of Pirog's Nodes - one install gets the whole pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Pirog17000/Pirogs-Nodes
pip install -r Pirogs-Nodes/requirements.txt
Or search "Pirog's Nodes" in ComfyUI Manager and restart. It needs scipy (already in the pack's requirements) for the Gaussian filter - you're covered by the normal install.
Gotchas
The protection zone scales with the blur radius, so at very large radii the "protected" region can cover most of a small mask - the result will look less blurred than you expect near borders, by design. That's the intended trade-off, not a bug. And remember tapered_corners defaults on; if someone gives you a workflow using this node and the mask looks "unblurred" at the edges, that's the feature working.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| blur_radius | FLOAT | 2.00–100 | — |
| tapered_corners | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |