Nodes/WtlNodes/Mask Resize
ComfyUI Node

Mask Resize

Resize a mask without fuzzing its edges

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Mask Resize
  • mask
  • MASK
resize_byfalse
width512
height512
multiplier1.0
interpolationnearest
fit_mode
enhanced_visibilityfalse
apply_type

Resizing a mask is not the same as resizing an image, though most tools treat them the same and leave you with feathered, half-transparent garbage where your hard selection used to be. Mask Resize from WtlNodes is the mask-aware version: it gives you the same fit and interpolation options as the pack's Image Resize, tuned for single-channel masks where edge crispness is the whole game.

If you've ever had an inpaint or a conditioning region silently shrink or soften because the mask got resized with bilinear, you already know why this node exists. The default interpolation is nearest for exactly that reason - masks want hard edges, not gradients.

The inputs that matter

  • resize_by - the mode switch. false (default) means target dimensions; true means scale by multiplier (0.1 to 8). Flip it when you know "double the mask" but not the pixel size.
  • width / height - absolute target, 64 to 8192, step 8.
  • multiplier - relative scale when resize_by is on.
  • interpolation - area, nearest, bilinear, bicubic, lanczos. Default nearest keeps masks binary and crisp. Drop to area for downscaling noisy masks; bilinear/bicubic only if you want a softened edge, which is rare here.
  • fit_mode - crop, adjust, or fit, mirroring the image-resize semantics: crop to the target and lose overflow, adjust the canvas, or fit within bounds.
  • enhanced_visibility - a preview nicety: renders the mask on a red background in the UI so a white-on-white mask is actually visible. Masks are notoriously invisible against dark canvases, so this toggle is more useful than it sounds.

One MASK output.

Where it fits

Any time your mask and your latent disagree on size - which happens constantly once you're resizing latents, upscaling, or working with a mask generated at a different resolution than the image. The classic fix-up: you generated at 1024, upscaled to 2048, and now your inpaint mask from the 1024 pass needs to cover the same region at 2×. That's this node.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Scorpiosis0/ComfyUI-WtlNodes.git

Restart ComfyUI, or grab the pack via ComfyUI Manager (search "WtlNodes"). No models, no heavy deps.

Gotchas

  • Bilinear on a mask = soft edges. If your mask turns gray and translucent after resize, you picked a smooth interpolation on a binary mask. nearest or area is almost always right for masks.
  • enhanced_visibility only affects the preview, not the data. The mask that comes out is unchanged; the red backdrop is purely so you can see what you're doing.
  • fit_mode changes the output dimensions. If the node downstream demands a specific size, crop is the safest choice - adjust and fit let the canvas float.
CategoryWtlNodes/mask

Inputs (9)

NameTypeDefaultDescription
maskMASK
resize_byBOOLEANfalse
widthINT51264–8192
heightINT51264–8192
multiplierFLOAT1.00.1–8
interpolationCOMBOnearest5 options: area, nearest, bilinear, bicubic, lanczos
fit_modeCOMBO3 options: crop, adjust, fit
enhanced_visibilityBOOLEANfalse
apply_typeCOMBO3 options: none, auto_apply, apply_all

Outputs (1)

NameTypeDescription
MASKMASK