ComfyUI Node
Lip Mask from Pose Keypoints
Generates mouth/lip masks from DWPose face keypoints. Auto-fallback detects puckered/occluded lips and switches to elliptical anchor mask. Outputs centroid coordinates for SAM-2 prompting.
Lip Mask from Pose Keypoints
- pose_keypoint
- mask
- centroid_x_list
- centroid_y_list
- fallback_active_list
◄mask_modeinner_mouth►
◄blur_radius5►
◄grow_pixels0►
◄person_index0►
◄confidence_threshold0.30►
◄auto_fallbacktrue►
◄fallback_area_threshold0.15►
◄fallback_pad_h1.20►
◄fallback_pad_v1.30►
Categorymask/pose
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| pose_keypoint | POSE_KEYPOINT | — | |
| mask_mode | COMBO | inner_mouth | 6 options: inner_mouth, outer_lips, lips_only, outer_expanded, top_lip_only, bottom_lip_only |
| blur_radius | INT | 50–100 | Gaussian blur radius for feathering mask edges. 0 = hard edge. |
| grow_pixels | INT | 00–200 | Dilate/grow the mask outward by this many pixels. |
| person_index | INT | 0-1–99 | Which detected person to extract lips from (0 = first/largest). -1 = all people, masks unioned together. |
| confidence_threshold | FLOAT | 0.300–1 | Skip frames where average lip keypoint confidence is below this. |
| auto_fallback | BOOLEAN | true | Auto-switch to elliptical face-anchor mask when inner mouth polygon collapses (puckered lips, lollipop, kissing). |
| fallback_area_threshold | FLOAT | 0.150.01–1 | Inner mouth area as ratio of outer lip area. Below this = collapsed/puckered, triggers fallback. 0.15 means if inner mouth is less than 15% of outer lip area. |
| fallback_pad_h | FLOAT | 1.200.5–3 | Horizontal scale for fallback ellipse. 1.0 = tight to mouth corners. |
| fallback_pad_v | FLOAT | 1.300.5–3 | Vertical scale for fallback ellipse. 1.0 = tight to upper lip top / lower lip bottom. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| centroid_x_list | FLOAT | — |
| centroid_y_list | FLOAT | — |
| fallback_active_list | BOOLEAN | — |