Image_smooth_blur
Feather a mask edge and recolor what's outside it
- image
- mask
- image
- smooth_mask
- invert_mask
The name undersells it a bit - this isn't a generic image blur, it's a mask-edge softener with a background swap built in. Give it an image and a mask, and it feathers the mask's hard edge into a gradient, optionally grows or shrinks the mask first, and lets you recolor both the masked region and the area outside it independently. It's the kind of node you reach for right before a composite, when a razor-sharp cutout edge would look pasted-in and you want it to blend.
How it works
Under the hood this is doing two related jobs. First, smoothness blurs the mask itself (not the image) - a small Gaussian-style falloff at the mask boundary instead of a hard 0/1 cutoff, so whatever you composite with it next fades in rather than snapping on. Second, mask_expansion grows (positive) or shrinks (negative) the mask before that softening happens, which is the usual fix when a mask is a few pixels too tight or too loose around your subject. On top of that, mask_color and bg_color let you flatten the masked region and the background to solid colors (or leave them as the original image, or pull alpha) - useful for previewing a mask's shape, or for generating a clean silhouette/matte rather than a photographic composite.
The inputs and outputs that matter
image/mask(required) - the pair you're working with.smoothness(INT, 0–2000, default 0) - how much the mask edge gets feathered. 0 is a hard edge; push it up for a soft transition.mask_expansion(INT, -50 to 50, default 0) - grow or shrink the mask before feathering.invert_mask(BOOLEAN, default off) - flips which side is "inside."mask_color/bg_color- what fills the masked region and the outside-mask region respectively. Both acceptimage(leave it as-is),Alpha(transparent), or a flat color (white/black/red/green/blue/gray).bg_colordefaults toAlpha,mask_colordefaults towhite.brightness(FLOAT, optional, 0–10, default 0) - an extra brightness adjustment on top of everything else.
Three outputs: image (the processed composite), smooth_mask (the feathered mask on its own, useful for reuse downstream), and invert_mask (the inverted version of that same feathered mask - handy when you need both sides without a separate invert node).
How to install it
ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset
pip install -r requirements.txt
install.bat is Windows-only; on Linux (comfy.icu included) run pip install -r requirements.txt. No model files needed - this is pure image/mask compositing.
Common issues
A smoothness value that looks fine at low resolution can look barely-there once you're working at 2K+ - the feather radius is in pixels, not a percentage of image size, so scale it up with your resolution. If the mask edge still looks hard after cranking smoothness, double-check mask_expansion isn't zero when your source mask was already tight - feathering a mask that's clipped right at the subject boundary has nothing to soften into; expand it a few pixels first.
The mask_color/bg_color combo is also easy to misread if you're expecting a straight blur: with both left at their defaults (white mask, Alpha background), you'll get a white silhouette on transparent, not the original photo with soft edges - set both to image if you want the original pixels preserved everywhere and only the mask boundary softened.
As with the rest of the pack, this node ships inside a large requirements.txt (onnxruntime, gguf, transparent-background, and more, for the pack's other 100+ nodes) that has to import cleanly for anything in ComfyUI-Apt_Preset to load. If the whole pack fails with IMPORT FAILED on a fresh install - a real, reported failure mode for this pack - check the ComfyUI console for the specific missing package before assuming this node is the problem.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| smoothness | INT | 00–2000 | — |
| invert_mask | BOOLEAN | false | — |
| mask_expansion | INT | 0-50–50 | — |
| mask_color | COMBO | white | 8 options: image, Alpha, white, black, red, green, +2 |
| bg_color | COMBO | Alpha | 8 options: image, Alpha, white, black, red, green, +2 |
| brightnessopt | FLOAT | 0.000–10 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| smooth_mask | MASK | — |
| invert_mask | MASK | — |