Mask Opacity
Dial your mask back without rebuilding it
- mask
- mask
Masks are binary in ComfyUI's heart: 1.0 means "touch this," 0.0 means "leave it alone." But a hard binary is a blunt instrument. Inpainting at full denoise inside a sharp mask makes seams; a controlnet weight mask at full strength overpowers the prompt; a composited region that's slightly too strong needs a nudge, not a rebuild. MaskOpacity from the Rebalance Pack is the nudge: it scales a mask by a single opacity value, 0 to 1, so a full mask becomes a soft one, and everything in between is yours to tune.
There are fancier mask-softening nodes - blur, feather, erode - but sometimes you just want "make this mask weaker by a third." This is the one-liner for that, and being a single knob makes it dead easy to wire a slider into a workflow you're still iterating on.
How it works
It's gloriously simple: the input mask tensor gets multiplied by opacity and handed back. opacity = 1.0 returns the mask unchanged, opacity = 0.0 returns a fully transparent (all-zero) mask, and anything between scales every pixel linearly. The node also normalizes mask layouts on the way through - a 2D mask gets a batch dimension, a 4D channel-last mask gets squeezed down - so you can feed it masks straight from almost any source without thinking about the tensor shape.
Output is mask, same shape, softer.
That linear scale is exactly what you want in the two big use cases: denoise control (a 0.5-opacity mask in an inpaint lets the sampler blend between old and new pixels instead of committing to full regeneration, which is how you avoid the "sticker" look) and weight-mask control for controlnet/attention patchers where the mask scales influence strength. In both, opacity is your "how much do I trust this region" dial.
The inputs that matter
- mask - whatever you're softening.
- opacity (0–1, default 1.0) - the multiplier. Displayed as a slider, which is the whole ergonomics win.
Install
Part of the Rebalance Pack. ComfyUI Manager: search "ComfyUI-Conditioning-Rebalance" (or "Rebalance Pack"). Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/nova452/ComfyUI-ConditioningKrea2Rebalance
Restart afterwards. No models, no dependencies.
Troubleshooting
The one thing that catches people: it scales, it doesn't feather. A sharp-edged mask scaled to 0.5 still has sharp edges - the intensity drops, the boundary doesn't soften. If your problem is a hard seam, reach for a blur/feather node instead (or blur first, then use this to set the overall level). Also note that values between 0 and 1 on a mask fed to a standard SetLatentNoiseMask don't do partial denoise per-pixel the way some expect - many consumers read the mask as a hard gate. Test the exact consumer node; if it ignores fractional masks, use opacity to blend at the compositing stage instead, where fractional values genuinely mean something.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| opacity | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |