Nodes/lip_mask_from_pose/Ensure Mask Canvas
ComfyUI Node

Ensure Mask Canvas

The fix for that phantom 64×64 mask

By Jalen-Brunson·Created 5 months ago·Updated 10 days ago· 1
Ensure Mask Canvas
  • mask
  • image
  • MASK

Ever wired a painted mask into a Wan 2.2 VACE inpaint or a SetLatentNoiseMask and gotten a crash, or a mask that clearly isn't the size of your video? That's the exact bug this node exists to murder. Ensure Mask Canvas does one boring thing: it takes any mask and any image, and hands you back a single mask at precisely the image's H×W. No magic, no settings - and it's the difference between a mask workflow that works on paper and one that works on canvas.

The 64×64 problem

The name isn't obvious until you've hit the failure. If you've painted a mask by hand in ComfyUI, you probably did it with Impact Pack's PreviewBridge. Here's the trap the author of this pack actually hit: an unpainted PreviewBridge emits a 2-D 64×64 zero mask - a tiny stub, not an empty canvas-sized mask. Downstream nodes that assume a real (B, H, W) mask at full resolution (the wanvaceadvanced control-mask inputs, SetLatentNoiseMask) either crash on that shape or silently mis-scale it. If you've ever stared at an inpaint that only "took" in a small square, this is often why.

How it works

Mechanically it's as simple as a mask node gets. Feed it your mask (whatever shape it came out of the bridge in) and an image - the tooltip on that input is the whole design: "Reference for the output canvas size." Internally it squeezes 2-D masks up to a batch dimension, keeps only frame 0, and if the spatial size doesn't match the reference it either writes a clean all-zero canvas (if the mask is empty) or bilinearly resizes it, clamped to [0, 1]. That empty-mask branch matters: it means "I haven't painted anything yet" becomes a proper zeroed canvas instead of interpolated garbage.

The only inputs you'll actually touch are mask and image; there's nothing else. Output is a single MASK at the image's exact resolution, ready to feed the inpaint or VACE node that was complaining.

Install

It ships in the Jalen-Brunson/lip_mask_from_pose pack. Easiest route is ComfyUI Manager - search "lip_mask_from_pose" and install. Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/Jalen-Brunson/lip_mask_from_pose

Then restart ComfyUI. This pack pulls no extra dependencies - the README is explicit that it's numpy, cv2, and torch, all of which ComfyUI already ships. You'll find it under mask/pose in the node menu.

When to reach for it

This is a plumbing node, not a headline feature, and it deserves the honest framing: it exists because its sibling mask nodes in the same pack hand you masks in odd shapes, and because PreviewBridge's stub is a classic footgun. If you're building a mouth-inpaint or VACE workflow and you keep fighting mask-size mismatches, drop this between your mask source and anything that consumes masks. One note: it keeps only frame 0 of a batched mask, so if you're working with a video mask batch, do your reshaping upstream - this node is for a single reference canvas.

Categorymask/pose

Inputs (2)

NameTypeDefaultDescription
maskMASK
imageIMAGEReference for the output canvas size.

Outputs (1)

NameTypeDescription
MASKMASK