Nodes/was-node-suite-comfyui/Mask Smooth Region
ComfyUI Node Runs on cloud

Mask Smooth Region

Soften jagged mask edges in ComfyUI

By WASasquatch·Created 3 years ago·Updated about a year ago· 1,812
Mask Smooth Region

      Masks straight out of a segmentation or threshold step are often ugly at the edges - blocky, jagged, stair-stepped. Mask Smooth Region rounds those boundaries off so the mask transitions cleanly instead of in hard pixel stairs. Wherever you're using that mask - inpainting, compositing, a selective filter - smoother edges mean the seam blends instead of announcing itself.

      This is one of WAS Node Suite's deep bench of mask utilities, and it's a genuinely useful one. A rough mask edge is one of the most common reasons a composite or inpaint looks "pasted on," and smoothing the region is the direct fix.

      How it works

      The node processes the mask's boundaries, smoothing the transition between the masked (white) and unmasked (black) areas. Instead of a razor edge that jumps from 0 to 255 in a single pixel, you get a softer falloff that reads as a natural blend. The description is right there in the name: it smooths the region's boundaries.

      The practical effect downstream: an inpaint using the smoothed mask feathers into the surrounding image, and a masked filter fades in rather than cutting off at a hard line. It's the mask-space version of feathering a selection before you use it.

      The inputs and outputs that matter

      You feed in a mask and get a smoothed mask back. The one thing you'll tune is the amount of smoothing - how far the softening reaches. Light smoothing knocks off the jaggies while keeping the shape tight; heavy smoothing rounds the mask noticeably and can shrink or bloat fine detail. The output wires straight into whatever consumes your mask.

      How to install it

      Ships in WAS Node Suite. Install once through ComfyUI Manager (search WAS Node Suite, install, restart) or manually:

      cd ComfyUI/custom_nodes
      git clone https://github.com/WASasquatch/was-node-suite-comfyui
      pip install -r was-node-suite-comfyui/requirements.txt
      

      then restart. On Windows portable, run the pip step with python_embeded\python.exe -s -m pip install -r ... (or install.bat) so requirements target ComfyUI's Python.

      Common issues & troubleshooting

      Too much smoothing eats your detail. Crank the amount and a mask around something intricate - hair, fingers, thin objects - loses its shape; the smoothing rounds off exactly the detail you were trying to mask. Use the lightest setting that kills the jaggies and no more.

      Small masks vanish or bloat. Aggressive smoothing on a tiny masked region can blur it away entirely, or spread it past where you wanted. If a small mask misbehaves, smooth gently, or reach for a different mask op - WAS ships a whole family (dilate, erode, gaussian, fill) and one of those may be the better tool for your specific shape.

      The edge is still hard downstream. Smoothing the mask only helps if the node using it respects soft mask values. Some operations treat a mask as strictly binary. If your edge is still hard after smoothing, check whether the consuming node is thresholding your soft mask back to black-and-white.

      Which smoothing node? WAS has several nearby options - Mask Smooth Region, Mask Gaussian Region, Mask Dilate/Erode. Smooth Region is the one for gently rounding boundaries; Gaussian Region blurs the whole mask more heavily; dilate/erode grow or shrink it. Pick by what you actually need the edge to do.

      The suite won't import. WAS Node Suite is large and unmaintained since late 2023; the recurring gotcha is an "Import Failed" after a ComfyUI update, from a dependency version clash (opencv is the usual offender). Reinstall the requirements against your ComfyUI Python and restart. The mask node is reliable - the suite install is the weak point.

      Categoryx

      Inputs (0)

      No inputs

      Outputs (0)

      No outputs