Mask Resize
Resize a mask without fuzzing its edges
- mask
- MASK
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;truemeans scale bymultiplier(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 whenresize_byis on.interpolation-area,nearest,bilinear,bicubic,lanczos. Defaultnearestkeeps masks binary and crisp. Drop toareafor downscaling noisy masks; bilinear/bicubic only if you want a softened edge, which is rare here.fit_mode-crop,adjust, orfit, 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.
nearestorareais almost always right for masks. enhanced_visibilityonly 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_modechanges the output dimensions. If the node downstream demands a specific size,cropis the safest choice -adjustandfitlet the canvas float.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| mask | MASK | — | |
| resize_by | BOOLEAN | false | — |
| width | INT | 51264–8192 | — |
| height | INT | 51264–8192 | — |
| multiplier | FLOAT | 1.00.1–8 | — |
| interpolation | COMBO | nearest | 5 options: area, nearest, bilinear, bicubic, lanczos |
| fit_mode | COMBO | 3 options: crop, adjust, fit | |
| enhanced_visibility | BOOLEAN | false | — |
| apply_type | COMBO | 3 options: none, auto_apply, apply_all |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |