Mask Brightness
Turn a mask up or down without touching its shape — Mask Brightness
- mask
- mask
Masks in ComfyUI aren't just on/off - they're a strength map, and sometimes you want to weaken one without resizing or reshaping it. A mask that's 60% covered by a soft selection, a mask you want to make more assertive so the inpaint region pulls harder, a blend weight that needs a nudge. wcx_MaskBrightness is the volume knob: multiply every pixel of the mask by a brightness factor and clamp back to the 0–1 range.
The mechanism is a one-liner under the hood: clamp(mask * brightness, 0, 1). Nothing clever, nothing that touches geometry - the mask keeps its exact shape and position, only the intensity changes. Input is mask (MASK) and brightness (FLOAT, 0–2, default 1.0); output is mask. It handles batches as-is, since it's a pure per-pixel multiply.
What you'd actually use it for:
- Brightness > 1 makes a mask stronger. An inpaint or detail pass reads mask intensity as how strongly to apply the operation, so pushing a weak detection mask up (say to 1.2–1.5) can stop a region from being half-ignored.
- Brightness < 1 softens it. Turning a full 1.0 mask down to 0.7 gives you a gentler pass over the same region - useful when a full-strength mask overcorrects but you still want the area touched.
- It's a poor man's "reduce the effect." When you don't want to re-run a detector to get a different mask, dimming the one you have is a two-second experiment.
The gotchas are the natural limits of the approach:
- It never changes what's masked, only how strongly. If the mask is too small or mispositioned, brightness won't save you - that's
Mask Growor a re-detection. You're adjusting weight, not coverage. - Brightness is capped at 2.0. The widget's max is 2, so if you need a genuinely huge boost you'll want to multiply elsewhere or just re-detect. And there's no threshold behavior: 0.5× stays fractional, it doesn't clip at some boundary.
- It's linear. Doubling brightness doubles the values - fine for intuition, just don't expect any curve-shaping.
Standard light install, no dependencies:
# ComfyUI Manager: search "ComfyUI-Practical-Tools" → Install → restart
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/wenchengxiang/ComfyUI-Practical-Tools
# restart ComfyUI
It's a five-second tool for a five-second adjustment - the kind of thing you reach for mid-tuning when a mask is close but not quite pulling its weight.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| brightness | FLOAT | 1.000–2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |