sanmi_BlurMaskArea
Blur only the part the mask covers
- image
- mask
- image
The name says it all: blur the area covered by a mask, leave everything else alone. Where a normal blur smears the whole image, this one computes a Gaussian blur and then uses your mask to blend - masked region gets the blur, the rest stays untouched. That makes it the classic "blur a face, a license plate, or a background detail you don't want in the frame" tool, or a quick way to soften a region before you composite something over it.
How it works
The image is padded and run through a depthwise 2D convolution using a Gaussian kernel. The kernel size derives from blur_radius (kernel = blur_radius*2+1), and sigma shapes the Gaussian falloff - smaller sigma gives a tighter, subtler blur; larger sigma spreads it out. Then the mask is expanded across the channels and used as a blend factor: mask * blurred + (1 - mask) * original. White mask = fully blurred, black mask = original pixels. Softer mask edges give you a gradual transition, which is usually what you want for a believable blur instead of a hard-edged smudge.
Inputs and outputs
- image - IMAGE.
- mask - MASK, same dimensions as the image.
- blur_radius - INT, 1–31 (default 1). The amount of blur.
- sigma - FLOAT, 0.1–10 (default 1). The Gaussian spread.
Output: image - the composite. Note the code has a guard where blur_radius of 0 returns the original untouched, but the input minimum is 1, so in practice you're always blurring.
What it's actually good for
Pair it with a segmentation node: run a face detector or SAM to get a mask over the face, wire that mask and your image in, and you've got anonymized output without touching the rest of the frame. Same idea for license plates, or for defocusing background elements before you lay text or a watermark on top. One honest limitation: blur_radius caps at 31, so this is a local softening tool, not a "melt the whole background" heavy blur - for aggressive background blur you'll want a proper bokeh/depth-based approach. The sharp edge between blurred and unblurred regions is a function of your mask; feather the mask upstream for a natural transition.
And yes, the standing caveat: this node was cut from the pack in the April 2025 rewrite, so a fresh install of the repo ships only the captioner. The code survives in the old Load_Image_Batch.py in git history.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/438443467/ComfyUI-GPT4V-Image-Captioner
Restart ComfyUI. No models, no extra dependencies - it's a couple of tensor convolutions.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| blur_radius | INT | 11–31 | — |
| sigma | FLOAT | 1.00.1–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |