Nodes/lip_mask_from_pose/Mouth Mesh Extractor (MediaPipe)
ComfyUI Node

Mouth Mesh Extractor (MediaPipe)

Extracts mouth contour from MediaPipe 478-point face mesh. Uses VIDEO mode for temporal tracking + interpolation for dropped frames. Outputs lip-only render (for VACE control) and filled mask (for inpainting).

By Jalen-Brunson·Created 4 months ago·Updated 3 months ago· 1
Mouth Mesh Extractor (MediaPipe)
  • images
  • mouth_render
  • mouth_mask
  • centroid_x_list
  • centroid_y_list
  • fallback_active_list
render_modecontour_only
line_colorgreen
line_thickness2
max_faces1
min_confidence0.30
mask_blur5
mask_grow0
person_index0
include_innertrue
include_outertrue
auto_fallbacktrue
fallback_area_threshold0.15
fallback_pad_h1.20
fallback_pad_v1.30
Categorymask/pose

Inputs (15)

NameTypeDefaultDescription
imagesIMAGE
render_modeCOMBOcontour_only3 options: contour_only, contour_and_fill, fill_only
line_colorCOMBOgreen5 options: green, white, red, cyan, magenta
line_thicknessINT21–10Thickness of lip contour lines in pixels.
max_facesINT11–10
min_confidenceFLOAT0.300.05–1Lower = fewer dropped frames but more false positives.
mask_blurINT50–100Gaussian blur for mask edges. 0 = hard edge.
mask_growINT00–200Dilate mask outward by this many pixels.
person_indexINT0-1–9Which face (0=first). -1=all faces merged.
include_innerBOOLEANtrueInclude inner lip contour (mouth opening edge).
include_outerBOOLEANtrueInclude outer lip contour (vermilion border).
auto_fallbackBOOLEANtrueFallback to elliptical mask when lips collapse (pucker/kiss).
fallback_area_thresholdFLOAT0.150.01–1Inner/outer area ratio below which fallback activates.
fallback_pad_hFLOAT1.200.5–3Horizontal scale for fallback ellipse.
fallback_pad_vFLOAT1.300.5–3Vertical scale for fallback ellipse.

Outputs (5)

NameTypeDescription
mouth_renderIMAGE
mouth_maskMASK
centroid_x_listFLOAT
centroid_y_listFLOAT
fallback_active_listBOOLEAN