Nodes/WtlNodes/Mask Translation
ComfyUI Node

Mask Translation

Shift a mask by pixels without touching the image

By Scorpiosis0·Created 10 months ago·Updated 2 months ago· 3
Mask Translation
  • mask
  • MASK
translate_x0
translate_y0
enhanced_visibilityfalse
apply_type

Sometimes the problem isn't that a mask is the wrong shape - it's that it's sitting in the wrong place. MaskTranslation slides a mask left/right/up/down by a set number of pixels and returns it as a MASK. That's the entire feature set, and honestly it's the right one to keep small.

Two inputs do the work: translate_x and translate_y, both integers ranging −4096 to 4096. Positive X shifts right, positive Y shifts down; the area the mask vacates becomes empty (black), and whatever it slides over gets covered. That's all. There's no scaling, no rotation, no interpolation dropdown - those live in the pack's MaskZoom and MaskRotation siblings, and it's nice that they kept this one pure.

The classic use case is alignment. You've detected a face, or a region, and the mask is consistently a few pixels off from where the composite needs it - a common artifact when a detector and your canvas disagree about framing. Nudge it, preview it, commit. It's also handy in multi-pass workflows where a mask from an earlier, differently-sized pass needs to slide back into register before it reaches a compositor.

Like the rest of the pack's mask nodes it carries the apply_type dropdown: none pauses per image and waits for Apply/Skip with a live RAM preview, apply_all pauses once for the whole batch, and auto_apply just executes with current values. And enhanced_visibility colors the vacated region red in the preview so you can actually see what moved - again, preview only; the output is a plain grayscale mask.

The one real footgun applies to all these transform nodes: the interactive modes (none, apply_all) block the workflow until someone clicks Apply or Skip in the browser. If you queue a batch through the API or run with the UI closed, use auto_apply. Otherwise the job sits there waiting for a click that will never come.

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

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

then restart ComfyUI. Pack deps are numpy, scipy, and pillow; the translation itself runs through OpenCV from your ComfyUI environment. No model downloads, no keys.

It's a two-slider node, and that's a feature. When you need a mask moved by exactly 12 pixels, this is less ceremony than any graph-math detour, and the live preview means you'll know it's right before you burn a generation.

CategoryWtlNodes/mask

Inputs (5)

NameTypeDefaultDescription
maskMASK
translate_xINT0-4096–4096
translate_yINT0-4096–4096
enhanced_visibilityBOOLEANfalse
apply_typeCOMBO3 options: none, auto_apply, apply_all

Outputs (1)

NameTypeDescription
MASKMASK