BD Face Feature Coords
MediaPipe landmarks, formatted for SAM3 prompts
- landmarks_batch
- positive_coords
- bbox_json
- status
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_coordsinput. - 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.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| landmarks_batch | BD_LANDMARKS_BATCH | LANDMARKS_BATCH from BD_FaceLandmarks. | |
| frame_indexopt | INT | 00–63 | Which frame in the batch to extract. 0 for single-image pipelines. |
| left_eyeopt | BOOLEAN | false | — |
| right_eyeopt | BOOLEAN | false | — |
| left_browopt | BOOLEAN | false | — |
| right_browopt | BOOLEAN | false | — |
| left_irisopt | BOOLEAN | false | — |
| right_irisopt | BOOLEAN | false | — |
| lipsopt | BOOLEAN | false | — |
| noseopt | BOOLEAN | false | — |
| face_ovalopt | BOOLEAN | false | — |
| contoursopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| positive_coords | STRING | JSON [{x,y},...] of all enabled feature landmarks. Wire to SAM3_Detect positive_coords. |
| bbox_json | STRING | Tight bounding box as JSON {x,y,width,height} covering all enabled features. |
| status | STRING | — |