Mouth Strip Crop (fixed union box)
One locked-off box for the whole clip
- images
- masks
- matte
- images
- x
- y
- width
- height
If you're building a lipsync or dubbing pipeline, you've probably seen the "mouth-strip" trick: crop the reference video down to a tight vertical strip of just the mouth, and feed that strip to your control or guide model so it only has to track lip movement, not the whole face. Mouth Strip Crop is that trick, done properly, for an entire clip at once. The author built it for their own reference-clip workflow (the "H3 <Video N> refs" in the description are literally named after the source clips they use), and the design choices are worth understanding before you substitute your own crop node.
Why not just BatchCropFromMask?
The obvious tool is KJNodes' BatchCropFromMask, and the author's source notes explain exactly why it's wrong here. With two mouths far apart - a two-shot conversation, say - the union bounding box is wide and short, and BatchCropFromMask's size handling inflates the height until the crop is at face scale. They observed this directly: a 504×270 crop from an 848×480 two-shot, dragging eyes and hair into frame. A mouth guide needs the opposite: width spanning every lip pixel, height staying at lip scale. This node does that.
How it works
The core decision is a single fixed box for the whole clip. It unions the mask pixels across every frame (anything above the threshold, default 0.5), pads that union by pad_x/pad_y (defaults 32/24), grows the crop to a multiple of snap (default 16 - the tooltip spells out why: it keeps encoders and VAEs happy), and crops every frame with that same box. Zero jitter across the clip, so it reads like a locked-off close-up, and when two mouths converge for a kiss, the same box simply frames the contact instead of dancing around.
The inputs that matter:
imagesandmasks- the frames and a mouth-mask batch of the same length (the tooltip suggestsMouthMaskFromSapiens2Seg'smask_a, a sibling node in this same pack).background- what to do outside the matte inside the strip.keepis the default;bluris the interesting one, giving that shallow-depth-of-field look that hides eyes and identity sharing the strip's vertical range while staying natural video.blackis the hard cut.matte(optional) - a soft matte of the region to keep sharp, for finer control than the raw mask; defaults tomasksif unconnected.
Outputs are images plus the x, y, width, height of the box - you'll want those to paste the crop back into the full frame or pass the coordinates to a VACE paste stage.
Install & troubleshooting
It's part of Jalen-Brunson/lip_mask_from_pose - ComfyUI Manager (search the pack name) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Jalen-Brunson/lip_mask_from_pose
Restart after. No extra dependencies beyond what ComfyUI ships.
Two gotchas the source is upfront about. First, if the mask is empty across the entire clip, the node raises an error - there's genuinely nothing to crop to, so fix your upstream mask. Second, masks must be the same length as images (or a single frame, which it'll reuse), and it auto-resizes a spatial mismatch. If your crop looks like it's missing lips, check that your mask batch isn't being truncated upstream.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| masks | MASK | Mouth mask batch (same length as images), e.g. MouthMaskFromSapiens2Seg mask_a | |
| pad_x | INT | 320–1024 | Horizontal padding around the union of mask pixels |
| pad_y | INT | 240–1024 | Vertical padding around the union of mask pixels |
| threshold | FLOAT | 0.500–1 | — |
| snap | INT | 162–64 | Crop dims are grown to a multiple of this (keeps encoders/VAEs happy) |
| background | COMBO | keep | What to do OUTSIDE the matte inside the strip. 'blur' looks like shallow depth of field — hides eyes/identity that share the strip's vertical range while staying natural video. |
| background_blur_sigma | FLOAT | 14.01–64 | — |
| matteopt | MASK | Soft matte of the region to KEEP SHARP (e.g. mask_b of the same MouthMaskFromSapiens2Seg with bigger grow/blur). Defaults to `masks` if unconnected. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| x | INT | — |
| y | INT | — |
| width | INT | — |
| height | INT | — |