BD MP Load Face Data
Reload MediaPipe face masks after the image is gone
- 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
- status
Here's the problem BD_LoadMPFaceData exists to solve: MediaPipe face detection runs on a source image, but by the time you want the face masks, the image has been processed into something MediaPipe can no longer recognize - re-posed, re-rendered, or replaced entirely. The pack's answer is to persist everything MediaPipe found as a .mpface.npz file at save time (BD MP Save Face Data), then reload it later with this node. No MediaPipe needed at load time - that's the whole trick.
It outputs the full set of region masks the face-detection pass produces: face_oval, skin, left_eye/right_eye/eyes, left_brow/right_brow/brows, left/right/combined irises, lips, nose, left_ear/right_ear/ears, forehead, hair - plus head_mask, a masked_skin, and the original image. That's 22 outputs of ready-made masks.
How to point it at a file
- file_path - the direct way. Give it the
.mpface.npz(or.mpface.json) path and it loads that file. - context_id - the pack-aware way. Leave
file_pathempty and give aBD_SaveContextcontext id (or just have a single registered context and let it auto-pick), and the node resolves the path from the context template automatically - i.e. it finds the most recently saved.mpface.npzfor that context. This is the round-trip flow: Save Face Data writes with a context, Load Face Data finds it again without you typing a path. - frame_index (0–63) - which saved frame to load. Always 0 for single-frame saves; relevant if your pipeline saved a multi-frame sequence.
Missing regions come back as blank masks rather than errors - consistent with the rest of the pack's fail-soft loaders.
Where it fits
In the FaceWrap pipeline, you typically: detect face data on the original image → save it → run the heavy processing (SAM3-guided refinement, Qwen edits, whatever) → load the face data back at export time so the region masks still line up with the processed image for compositing or UV work. It's the persistence layer that makes that possible. The README's framing is exactly right: "reload later (after the image is processed and MediaPipe can no longer detect)."
Install
Part of the BrainDead pack:
cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt
Or search "BrainDead" in ComfyUI Manager and restart. Notably, this node needs no MediaPipe runtime - it's pure file loading.
Troubleshooting
- "File not found" with
context_id- no save exists yet for that context; run the save node once first, or type the path directly. - Masks come back blank - the file didn't have that region (e.g. no ears detected in the original pass), or you loaded the wrong frame index.
- Sizes don't match your processed image - the saved masks are at the original resolution; resize or re-align them to the current image before compositing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | Path to .mpface.npz (or .mpface.json). Leave empty to auto-locate via context_id. | |
| context_idopt | STRING | BD_SaveContext context_id. When file_path is empty, resolves the path automatically from the context template. Also accepts auto-pick when only one context is registered. | |
| frame_indexopt | INT | 00–63 | Which saved frame to load (always 0 for single-frame saves). |
Outputs (22)
| Name | Type | Description |
|---|---|---|
| face_oval | MASK | — |
| skin | MASK | — |
| left_eye | MASK | — |
| right_eye | MASK | — |
| eyes | MASK | — |
| left_brow | MASK | — |
| right_brow | MASK | — |
| brows | MASK | — |
| left_iris | MASK | — |
| right_iris | MASK | — |
| irises | MASK | — |
| lips | MASK | — |
| nose | MASK | — |
| left_ear | MASK | — |
| right_ear | MASK | — |
| ears | MASK | — |
| forehead | MASK | — |
| hair | MASK | — |
| head_mask | MASK | — |
| masked_skin | MASK | — |
| image | IMAGE | — |
| status | STRING | — |