Nodes/ComfyUI Warper Nodes/Facial Part Mask from Pose (Warper)
ComfyUI Node

Facial Part Mask from Pose (Warper)

Face, mouth, and eye masks from DWPose landmarks

By AIWarper·Created about a year ago·Updated 8 months ago· 14
Facial Part Mask from Pose (Warper)
  • pose_keypoints
  • MASK
mask_entire_facefalse
mask_mouthtrue
mask_left_eyefalse
mask_right_eyefalse
mask_shapeConvex Hull
expand_mask10
person_index0

Faces are where inpainting gets fiddly: the mouth, the eyes, the whole face - each needs a mask, and each mask needs to track the face as it moves across frames. Facial Part Mask from Pose (Warper) generates those masks from DWPose face landmarks automatically. You tick which parts you want (whole face, mouth, left eye, right eye), pick a shape (convex hull, ellipse, rectangle, or circle), and it draws a mask that follows the landmarks frame by frame. Hand-painting this for a 200-frame clip is the alternative. Don't do that.

It's the flexible sibling of Mouth Mask from Pose (Warper) in the ComfyUI Warper Nodes pack from workflow author AIWarper. Where the mouth-only node stamps a plain circle, this one gives you part selection, shape control, and mask expansion - everything you need for serious regional rework of a face.

How it works

Same input contract as its sibling: pose_keypoints is the POSE_KEYPOINT output from a DWPose preprocessor (ControlNet Aux or Impact Pack). It reads the 68-point face landmarks: 48–67 for the mouth, 36–41 left eye, 42–47 right eye, 0–26 for the whole face (jawline plus brows). For each enabled part it takes the confident landmarks and builds a shape - Convex Hull hugs the points, Ellipse fits one, Rectangle is a bounding box, Circle is the minimum enclosing circle. Parts are combined into one mask, then expand_mask (default 10, range −100 to 100) dilates or erodes it with a 5×5 kernel. Negative values shrink the mask; zero leaves it alone.

Inputs that matter:

  • mask_entire_face / mask_mouth / mask_left_eye / mask_right_eye - the on/off switches. Whole-face ignores the individual parts.
  • mask_shape - the geometry, default Convex Hull (best fit for mouths).
  • expand_mask - feather-room dial; default 10 gives breathing space around the feature.
  • person_index - which person, default 0.

Output is one MASK tensor, batched across all input frames, ready for any inpainting or regional conditioning node.

Installing it

Standard Warper install: ComfyUI Manager → search "ComfyUI-WarperNodes" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AIWarper/ComfyUI-WarperNodes
# restart ComfyUI

Only standard imaging deps (numpy, opencv, torch). You do need a DWPose detector upstream from another pack. The README's RAFT model is only for Flow Visualizer.

Common issues

Same feed problem as every node in this family: it consumes DWPose keypoints, not images, and bad input silently yields empty (black) masks. The ellipse fallback is worth knowing - cv2.fitEllipse needs at least five points, so with a partially-detected eye it quietly falls back to a convex hull, which is fine but can look different than you configured. expand_mask works in half-pixel-ish steps (iterations are abs(expand)/2), so a value of 3 effectively expands by 1; don't expect a 1:1 pixel correspondence. And watch the whole-face slice: it covers jawline + brows but not the eyes and mouth regions you might assume - if you want everything, tick all the parts. The masks are also pure landmark geometry with no temporal smoothing, so fast head turns can make them jitter between frames; that's a property of the approach, not a bug.

CategoryWarper Tools/DWMasking

Inputs (8)

NameTypeDefaultDescription
pose_keypointsPOSE_KEYPOINT
mask_entire_faceBOOLEANfalse
mask_mouthBOOLEANtrue
mask_left_eyeBOOLEANfalse
mask_right_eyeBOOLEANfalse
mask_shapeCOMBOConvex Hull4 options: Convex Hull, Ellipse, Rectangle, Circle
expand_maskINT10-100–100
person_indexINT0

Outputs (1)

NameTypeDescription
MASKMASK