Nodes/ComfyUI_AC_FUNV8Beta1/AC_Super_MaskScaleBy
ComfyUI Node

AC_Super_MaskScaleBy

Scale a mask by a factor, not a target size

By A719689614·Created 3 years ago·Updated 4 months ago· 14
AC_Super_MaskScaleBy
  • mask
  • IMAGE
  • MASK
upscale_method
scale_by1.00
channel

AC_Super_MaskScaleBy is the factor-based sibling of AC_Super_MaskScale. Where that node asks for an exact width and height, this one takes a scale_by multiplier and scales the mask proportionally. It's the answer for "make this region 1.5× bigger" - grow a face mask to cover a wider area, or shrink a region mask before it feeds an inpaint pass.

How it works

Same mechanism as its sibling: the single-channel mask is reshaped into a 3-channel image, run through comfy.utils.common_upscale, then one channel is extracted back into a mask. The difference is only in how the target size is computed - scale_by multiplies the current dimensions, so a 512×512 mask at 2.0 becomes 1024×1024, and at 0.5 becomes 256×256. Both outputs come out: the upscaled IMAGE and the MASK.

The inputs

  • mask - the input mask.
  • upscale_method - nearest-exact, bilinear, area, bicubic, lanczos. Same edge-crispness tradeoff as its sibling: nearest-exact keeps hard edges, the smooth methods feather them.
  • scale_by - a FLOAT from 0.01 to 8.0, default 1.0. Below 1 shrinks, above 1 grows.
  • channel - red/green/blue/alpha. Since the node duplicated the mask's single channel into all three, they're identical - red is the safe default.

The outputs

IMAGE and MASK, both at the scaled size. Use the MASK output downstream in an inpaint or composite; use the IMAGE output if the next node wants to see the mask as pixels.

Installing it

Part of ComfyUI_AC_FUNV8Beta1 by Cc啊程 (Bilibili ComfyUI teacher; README is Chinese). ComfyUI Manager (search "AC_FUN") or:

cd ComfyUI/custom_nodes
git clone https://github.com/A719689614/ComfyUI_AC_FUNV8Beta1

Restart ComfyUI. No downloads.

Where people get burned

The trap is forgetting masks are resolution-bound by the image they belong to. Scaling a mask by a factor without scaling the image it operates on will make the region misalign - growing a mask 2× while the image stays put means the masked area no longer lines up with the subject. Use the factor version when the underlying image is also being rescaled (like in a hires pass), and the absolute-size version when you need the mask to hit a specific resolution. That's the whole difference between the two nodes, and it's the one that matters.

Category🔯AC_FUNV8.0

Inputs (4)

NameTypeDefaultDescription
maskMASK
upscale_methodCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
scale_byFLOAT1.000.01–8
channelCOMBO4 options: red, green, blue, alpha

Outputs (2)

NameTypeDescription
IMAGEIMAGE
MASKMASK