Nodes/lip_mask_from_pose/Lip Mask from Pose Keypoints
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.

By Jalen-Brunson·Created 4 months ago·Updated 3 months ago· 1
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)

NameTypeDefaultDescription
pose_keypointPOSE_KEYPOINT
mask_modeCOMBOinner_mouth6 options: inner_mouth, outer_lips, lips_only, outer_expanded, top_lip_only, bottom_lip_only
blur_radiusINT50–100Gaussian blur radius for feathering mask edges. 0 = hard edge.
grow_pixelsINT00–200Dilate/grow the mask outward by this many pixels.
person_indexINT0-1–99Which detected person to extract lips from (0 = first/largest). -1 = all people, masks unioned together.
confidence_thresholdFLOAT0.300–1Skip frames where average lip keypoint confidence is below this.
auto_fallbackBOOLEANtrueAuto-switch to elliptical face-anchor mask when inner mouth polygon collapses (puckered lips, lollipop, kissing).
fallback_area_thresholdFLOAT0.150.01–1Inner 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_hFLOAT1.200.5–3Horizontal scale for fallback ellipse. 1.0 = tight to mouth corners.
fallback_pad_vFLOAT1.300.5–3Vertical scale for fallback ellipse. 1.0 = tight to upper lip top / lower lip bottom.

Outputs (4)

NameTypeDescription
maskMASK
centroid_x_listFLOAT
centroid_y_listFLOAT
fallback_active_listBOOLEAN