Nodes/BrainDead Nodes/BD Face Feature Coords
ComfyUI Node

BD Face Feature Coords

MediaPipe landmarks, formatted for SAM3 prompts

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Face Feature Coords
  • landmarks_batch
  • positive_coords
  • bbox_json
  • status
frame_index0
left_eyefalse
right_eyefalse
left_browfalse
right_browfalse
left_irisfalse
right_irisfalse
lipsfalse
nosefalse
face_ovalfalse
contoursfalse

SAM3 is brilliant at segmenting a face region you point at, but it doesn't know which pixels are the left eye versus the nose - that's what MediaPipe is for. BD Face Feature Coords is the bridge between the two: it takes a LANDMARKS_BATCH from BD Face Landmarks, extracts the pixel-space landmark coordinates for whichever features you enable, and emits them as a positive_coords JSON string that plugs directly into a SAM3_Detect node. All enabled features are merged into one payload, so a single SAM3_Detect call gets positive prompts for every feature at once.

It's a small glue node, and it sits at the center of the "MediaPipe-guided SAM3" pattern this pack uses to get pixel-accurate face masks: MediaPipe gives you the where, SAM3 gives you the exact boundary.

What you toggle and what comes out

Every feature is an on/off checkbox, all off by default: left_eye, right_eye, left_brow, right_brow, left_iris, right_iris, lips, nose, face_oval, and contours. There's also frame_index (which frame of a batch to extract; 0 for single-image pipelines). Enable the features you want - the merged coordinates go out as:

  • positive_coords (STRING) - wire this into SAM3_Detect's positive_coords input.
  • bbox_json (STRING) - an informational bounding box JSON, handy for debugging or for nodes that want a box.
  • status (STRING).

Installing

Ships in ComfyUI-BrainDead:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

or ComfyUI Manager → search "BrainDead" → install, then restart. It consumes the same MediaPipe model bundle as BD Face Landmarks (auto-downloaded), so no extra weights.

Where people get burned

The obvious one: this node only works as far upstream as its landmarks. If the detection failed on a view, positive_coords will be garbage - check BD Face Landmarks' overlay before trusting this. And it's a targeting aid, not a magic segmentation: it makes SAM3 look at the right spots, but you still need the SAM3 model running and the rest of your prompt chain correct for the masks to come out. If a feature mask comes back wrong, first suspect that you forgot to toggle that feature on here.

Category🧠BrainDead/FaceWrap

Inputs (12)

NameTypeDefaultDescription
landmarks_batchBD_LANDMARKS_BATCHLANDMARKS_BATCH from BD_FaceLandmarks.
frame_indexoptINT00–63Which frame in the batch to extract. 0 for single-image pipelines.
left_eyeoptBOOLEANfalse
right_eyeoptBOOLEANfalse
left_browoptBOOLEANfalse
right_browoptBOOLEANfalse
left_irisoptBOOLEANfalse
right_irisoptBOOLEANfalse
lipsoptBOOLEANfalse
noseoptBOOLEANfalse
face_ovaloptBOOLEANfalse
contoursoptBOOLEANfalse

Outputs (3)

NameTypeDescription
positive_coordsSTRINGJSON [{x,y},...] of all enabled feature landmarks. Wire to SAM3_Detect positive_coords.
bbox_jsonSTRINGTight bounding box as JSON {x,y,width,height} covering all enabled features.
statusSTRING