BD MP Save Face Data
Park your MediaPipe face masks so Blender can read them later
- face_oval
- skin
- left_eye
- right_eye
- eyes
- left_brow
- right_brow
- brows
- left_iris
- right_iris
- irises
- lips
- nose
- left_ear
- right_ear
- ears
- forehead
- hair
- head_mask
- masked_skin
- image
- npz_path
- json_path
- status
The whole point of the BrainDead face pipeline is that you detect face regions once with MediaPipe, refine them with SAM3, and then do something else with them - project onto a mesh, build a UV plate, feed a Blender script. But ComfyUI masks evaporate when the graph reruns, and the original image eventually stops being MediaPipe-detectable (once you've upscaled or composited it, the landmarks are gone). BD MP Save Face Data exists to make those masks durable: it writes everything to disk as NPZ + JSON, so the face data outlives the image it came from.
What it is
A persistence node for MediaPipe face mask data. You wire the outputs of BD MP Face Mask (or the SAM3-refined versions from BD MP Face Refine) into its matching mask inputs, and it writes an .mpface.npz plus a JSON sidecar to disk. Load it back later with the pack's load node after the image is processed and MediaPipe can no longer detect anything.
How it works
The node accepts the full set of region masks the MP pipeline produces - face_oval, skin, left_eye, right_eye, eyes, brows, irises, lips, nose, ears, forehead, hair, plus head_mask (external silhouette) and masked_skin (refined skin). You wire what you have; it packs the ones that are connected into the .npz and writes a JSON sidecar with per-region bounding boxes that are readable from Blender Python - which is the whole trick for the FaceWrap workflow, where the JSON drives UV placement in a Blender subprocess.
Two output paths:
- Legacy:
output_dir(defaultmediapipe_data) under ComfyUI's output folder + anamebase, withauto_incrementappending_001,_002… - Context-aware: wire/set
context_idfrom a BD Save Context and the context template decides the full path, ignoringoutput_dirandname.
Inputs that matter
- The mask inputs - wire from BD MP Face Mask, or from BD MP Face Refine to overwrite with SAM3-refined versions.
image(the pre-resolution source image) rides along for texture generation / Blender UV projection. context_idfor auto-path resolution.output_dir+nameif you're not using a context.
Outputs: npz_path, json_path, and status. That's it - it's an output node; nothing flows onward.
Why you'd bother
The FaceWrap pipeline in the README is the canonical use: MediaPipe landmarks → SAM3-guided face masks → socket infill → UV export. The save step is what lets you iterate on the mesh side without re-running face detection every time - and it's what keeps the data available for the Blender face-plate UV pipeline, which runs outside ComfyUI's graph entirely. If your face pipeline is one-shot and throwaway, you don't need this node. If you're doing actual character work that touches a DCC, it's the difference between re-detecting every run and having the data on disk.
Installing it
ComfyUI Manager: search "BrainDead" → install. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt
Restart, find it under 🧠BrainDead/Segmentation. The save node itself is dependency-light (numpy + json), but the nodes that produce the masks need pip install mediapipe - not in the pack's requirements.txt, so install it if MP Face Mask isn't running. And mind the context auto-pick gotcha shared across the pack: with exactly one BD Save Context registered and an empty context_id, this node follows the context silently.
Inputs (25)
| Name | Type | Default | Description |
|---|---|---|---|
| context_idopt | STRING | BD_SaveContext context_id. When wired/set, output_dir and name are ignored — the context template determines the full path. | |
| face_ovalopt | MASK | — | |
| skinopt | MASK | From BD MP Face Mask or BD MP Face Refine (SAM3-refined). | |
| left_eyeopt | MASK | — | |
| right_eyeopt | MASK | — | |
| eyesopt | MASK | — | |
| left_browopt | MASK | — | |
| right_browopt | MASK | — | |
| browsopt | MASK | — | |
| left_irisopt | MASK | — | |
| right_irisopt | MASK | — | |
| irisesopt | MASK | — | |
| lipsopt | MASK | — | |
| noseopt | MASK | — | |
| left_earopt | MASK | — | |
| right_earopt | MASK | — | |
| earsopt | MASK | — | |
| foreheadopt | MASK | — | |
| hairopt | MASK | — | |
| head_maskopt | MASK | External head silhouette (SAM3/BD MP Face Refine). | |
| masked_skinopt | MASK | Refined skin mask (BD MP Face Refine 'skin' output or custom). | |
| imageopt | IMAGE | Pre-resolution image for texture generation / Blender UV projection. | |
| output_diropt | STRING | mediapipe_data | Subdirectory under ComfyUI output/ (ignored when context_id is set). |
| nameopt | STRING | face | Base filename (ignored when context_id is set). |
| auto_incrementopt | BOOLEAN | true | Append _001, _002… to avoid overwriting. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| npz_path | STRING | — |
| json_path | STRING | — |
| status | STRING | — |