Nodes/WtlNodes/Mask Zoom
ComfyUI Node

Mask Zoom

Zoom a mask in or out, with the pan you'll end up needing anyway

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Mask Zoom
  • mask
  • MASK
zoom1.00
translate_x0
translate_y0
interpolationnearest
enhanced_visibilityfalse
apply_type

MaskZoom is the "close enough, now make it bigger" node. A detector hands you a mask that covers the subject but a little too tight - or too loose - and you need to scale the mask itself without scaling the image underneath it. That's the whole job: zoom scales the mask, and when scaling alone puts it off-center, translate_x/translate_y slide it back.

The zoom input runs 0.1 to 5.0 - below 1 shrinks the mask, above 1 grows it, 1 is identity. Values under 1 are your "tighten the inpaint region" move; values over 1 are your "give the composite breathing room" move. Because scaling almost always changes where the mask's center of mass lands relative to what you're masking, the node pairs zoom with the same pixel translation controls as MaskTranslation, ranging ±4096 pixels. In practice, zoom and translate get tuned together more often than not - a classic case where the pack's live preview saves you from four generations of guesswork.

Interpolation is there too, with the standard five options (area, nearest, bilinear, bicubic, lanczos). For masks, nearest keeps edges crisp; the smoother options soften the boundary slightly if you're zooming a feathered region. OpenCV's resize engine does the work, and - same as the other mask transforms - enhanced_visibility paints the empty area red in the preview only. The MASK output itself is plain grayscale.

And yes, apply_type is here with the pack-wide interactive behavior: none pauses per image waiting for Apply/Skip while sliders update live, apply_all pauses once for the whole batch, auto_apply skips all interaction. The usual warning applies double for a node like this, because zooming is inherently a "tweak until it looks right" task: if you're running headless, set auto_apply and tune your values in a test pass, because the interactive modes block until a human clicks in the browser.

Install via ComfyUI Manager (search "WtlNodes") or:

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

then restart ComfyUI. Deps are numpy, scipy, and pillow; the resize runs through OpenCV from your standard ComfyUI environment. No models, no downloads.

If you've ever manually redrew a mask because it was 10% too small, this node is the reason you don't have to. Zoom, nudge, preview, commit.

CategoryWtlNodes/mask

Inputs (7)

NameTypeDefaultDescription
maskMASK
zoomFLOAT1.000.1–5
translate_xINT0-4096–4096
translate_yINT0-4096–4096
interpolationCOMBOnearest5 options: area, nearest, bilinear, bicubic, lanczos
enhanced_visibilityBOOLEANfalse
apply_typeCOMBO3 options: none, auto_apply, apply_all

Outputs (1)

NameTypeDescription
MASKMASK