Mask Blur (YC)
Feather your masks before they hit the sampler — the difference between a seam and a blend
- mask
- MASK
Every inpainting guide ends with the same sentence: blur your mask. A hard mask edge means the sampler treats the boundary as a knife-cut, and you get a visible seam where regenerated content meets original pixels. Soften the edge and the model blends the new content into the old. This node is a one-knob gaussian blur for masks - nothing more, and that's fine.
What it's actually for
Feathering. You draw (or generate) a mask, blur it a few pixels, and feed it to the sampler. The inpainting playbook calls out 4–12 pixels as the typical range - too little and you get seams, too much and your edits bleed into surrounding areas you wanted untouched. This is the same step, done as a standalone node, and it slots right between your mask source and the masked sampler, or after YCImageSmartPad / YCMaskRatioPadCrop in this same pack when their masks come out hard-edged.
How it works
It runs torchvision's gaussian blur on the mask tensor. Two details worth knowing:
- Amount 0 is a no-op - the mask passes through untouched.
- Even amounts get bumped up by one. Gaussian blur kernels need odd sizes, so ask for 6 and it quietly blurs with 7. Don't fight it; pick a value and accept the +1.
The device input lets you force the blur onto CPU or GPU (auto picks for you). On GPU it uses ComfyUI's current torch device, then moves the result back to the intermediate device so the rest of your graph isn't suddenly off-device.
Inputs and outputs
The whole node:
- mask - your mask in
- amount - blur radius, 0–256, default 6
- device - auto / cpu / gpu
Output is the blurred mask. Wire it where your unblurred mask was.
Install
It's in ComfyUI-YCNodes. ComfyUI Manager → search "ComfyUI-YCNodes" → install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI-YCNodes
Dependencies are torch, numpy, pillow, opencv-python, scipy - and this node specifically needs torchvision (it ships with ComfyUI's torch install, so usually no extra work).
Where people get burned
- Blurring everything. A big
amounton a mask that's meant to protect a precise region will make your inpaint bleed outside it. Start at 4–8 and tune up. - Expecting a threshold. This is a blur, not a cleanup - it won't shrink or harden your mask, it just softens it. If you wanted to tighten edges, look at mask threshold/erode nodes instead.
- Output device surprises. If you force
gpuand the rest of your graph expects CPU tensors, the node returns it to the intermediate device for you - so in practice this rarely bites, but it's whyautois the safe default.
It's the dullest node in the pack and arguably the most used: every decent inpainting or outpainting workflow needs this exact step, and this one is a single widget that does it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| amount | INT | 60–256 | — |
| device | COMBO | 3 options: auto, cpu, gpu |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |