Extract facer mask v5.1.0
Pick individual face parts out of a facer parsing map (eyes, lips, brows, hair)
- image
- MASK
Face parsing is segmentation for the face: every pixel labeled as skin, eye, eyebrow, nose, lip, hair, or background. This node is the "pick which classes you want" step for the facer parsing palette - feed it a face-parsing map, tick left_eye, nose, hair, whatever, and it returns a MASK of exactly those regions. It's how you build a "protect the eyes" mask for inpainting or a "restyle only the hair" mask.
What it does
One image input and eleven booleans, one per facer class: background, face, hair, left_eye, right_eye, left_eyebrow, right_eyebrow, nose, upper_lip, lower_lip, inner_mouth. For each selected class it matches pixels against that class's exact RGB label in the facer palette (face is [0,138,255], nose [255,192,0], hair [150,0,255], and so on), ORs them together, and returns a single MASK.
The critical detail is in the previous paragraph: the image input is not a normal photo. It's the already-parsed segmentation map - the colored output of a facer-style face-parsing model, where every pixel carries one of those label colors. The node does no parsing of its own; it's pure color-keying on someone else's parsing result. Feed it a regular photograph and every boolean matches nothing, and you get an empty mask. The pack lists facer in its requirements, but this node never calls it - you need to source the parsing map from a facer-capable pipeline yourself.
That also means exact color matching applies, with all its usual strictness: lossy re-encoding or a different parser's palette and the lookups silently fail.
Where it fits
Face-aware inpainting and editing: mask the lips to recolor them without touching the skin, mask the hair for a restyle pass, mask the eyes to keep them out of a facial edit. It's the face-sized counterpart to tri3d-extract-masks-batch, but narrower - this one only understands the facer face palette.
Installing
ComfyUI Manager (search "tri3d"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
Install requirements (pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt). Note the facer package is installed but not used by this node - if you don't already have a face-parsing source, that's the part you'll have to supply.
Troubleshooting
- Empty mask on a normal photo - expected. The input must be a facer parsing map, not a photograph. Find the node/pipeline that produces the parsing map and feed its output here.
- Nothing selected - all booleans off means no mask. Tick at least one.
- Mask includes adjacent regions - the classes are OR'd; if you selected face and nose, you get both. For a strict single region, select only it.
The setup cost (getting a parsing map in the first place) is real, but once you have one, this is a fast, precise way to isolate any facial feature.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| background | BOOLEAN | false | — |
| hair | BOOLEAN | false | — |
| lower_lip | BOOLEAN | false | — |
| inner_mouth | BOOLEAN | false | — |
| upper_lip | BOOLEAN | false | — |
| nose | BOOLEAN | false | — |
| left_eyebrow | BOOLEAN | false | — |
| right_eyebrow | BOOLEAN | false | — |
| left_eye | BOOLEAN | false | — |
| right_eye | BOOLEAN | false | — |
| face | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MASK | MASK | — |