🐳遮罩百分比羽化
Mask feathering that scales with resolution instead of guessing pixels
- mask
- MASK
Most mask feather tools ask you for a radius in pixels, and then you get to rediscover why that's painful the first time you upscale: the same mask at 2048px needs a much bigger radius than it did at 512px, and your perfectly-soft edge suddenly looks like a hard cut. 🐳遮罩百分比羽化 (Mask Feather Percentage) sidesteps all of it by taking the radius as a percentage of the mask's smaller dimension. The feather is proportional, so it survives resolution changes without retuning.
You want this anywhere a hard mask edge will betray you - inpainting, compositing, edge-blending a subject into a background, or feeding a mask into ControlNet where a smooth transition gives the sampler room to work. It's one of those small nodes you don't miss until you've had to re-tune a pixel radius for the sixth time.
How it works
The node reads the mask, takes the smaller of its height and width as the reference dimension, and computes radius = dimension × percentage / 100. Then it feathers along the mask's boundary. The 保持锐利边缘 (keep sharp edges) toggle picks between two very different methods:
- 是 (yes) - distance-transform feathering. The interior of the white region stays fully solid, and only a band along the boundary ramps from 1 to 0 over the feather radius. This gives you a soft outer edge while the heart of the mask stays rock-solid - ideal when you want the region itself intact.
- 否 (no) - a plain Gaussian blur on a binary mask. Softer overall, but it also shrinks the effective region as it blurs, and corners round off.
For inpainting, "keep sharp edges = 是" is usually the better default: the middle stays protected and only the rim fades.
Inputs and output
mask- the MASK.羽化百分比(feather percentage) - 0.1 to 100, default 5. At 5% of the smaller dimension, a 1024px mask feathers ~51px. Start there and adjust.保持锐利边缘(keep sharp edges) - 是 / 否, default 否.
Output: the feathered MASK, ready to feed an inpaint node, a detailer, or a compositor.
One note: the node's mask normalization only takes the first frame of a multi-frame mask batch, so it's a single-mask tool - feed it one mask at a time. It also depends on scipy for the distance transform, so make sure that made it in from the pack's requirements.
Install
Standard Pond Nodes install:
ComfyUI Manager → search "Pond Nodes" (comfy_Pond_Nodes)
or:
cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes
pip install -r requirements.txt
Restart after. Torch, numpy, and scipy cover it; no models. Pack footnote: the README flags a console-spam conflict with comfyui_HiDream-Sampler.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| 羽化百分比 | FLOAT | 5.00.1–100 | — |
| 保持锐利边缘 | COMBO | 否 | 2 options: 是, 否 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |