图像分区 · 人脸身份参考遮罩
Stop the identity reference from importing its eyes — without touching the composite
- image
- face_landmarks
- base_mask
- identity_conditioning_mask
- excluded_eye_material_mask
- preview
- report_json
Identity-conditioned face editing has a dirty little secret: if you tell the model "match this reference identity," it will happily import the reference's eyes - iris color, pupil, catchlights - right along with the face shape. Sometimes that's what you want. Often it isn't, especially when the source photo's eyes are the thing you're trying to keep. RegionEditFaceIdentityConditioningMask exists for that second case: it produces a version of your identity-conditioning mask with the eye material carved out, so the reference conditions the face geometry but doesn't inject its gaze or iris.
The key design fact, and it's a good one: this mask never participates in the final composite. It's conditioning-only. The output doesn't create an output pixel boundary, doesn't affect the generation mask, and can't become a "pasted eye" seam. It exists purely to stop the reference from feeding eye material into the model's conditioning while the source photo remains available as reference image 0. That's a subtle distinction and the whole reason the node exists rather than being a mask-subtract one-liner.
How it works
You give it image, face_landmarks, a base_mask (your identity-conditioning mask - the head region you're feeding the model), and a face_index. Then eye_exclusion_mode picks how much of the eye gets removed:
none- pass through unchanged.iris_only- excludes just the iris/pupil discs, using iris landmark groups (needs 478-point MediaPipe landmarks). The defaulteye_exclusion_scaleof 1.8 makes the excluded region a bit larger than the strict iris so the model can't cheat the boundary.visible_eye_interior- excludes the whole visible eye interior (aperture), for when you want nothing eye-like from the reference at all.
It's a hard gate, not a soft one: if the exclusion ends up removing the entire conditioning mask, or if it doesn't overlap the base mask at all, the node errors instead of silently producing something broken.
Outputs: identity_conditioning_mask (what you feed the conditioning stack), excluded_eye_material_mask (the carved-out region, for inspection), preview (base in green, exclusion in red - check this before running), and report_json.
Inputs that matter
base_mask- feed it the mask you were going to use for identity conditioning; you get back the cleaned version.eye_exclusion_mode- the only real decision. Start withiris_only; switch tovisible_eye_interiorif the model still sneaks in eye material.eye_exclusion_scale- 0.75–3.0. If you see a dark halo around the restored eye, you're excluding too little.
Install
ComfyUI Manager → search "Region Edit Toolkit" (package ID native-region-tile-planner-merge) → install → restart. Or git clone https://github.com/Liu-Bot24/ComfyUI-Region-Edit-Toolkit.git into ComfyUI/custom_nodes, then pip install -r requirements.txt into ComfyUI's Python, restart. Python 3.10+; deps numpy, Pillow, scipy, argostranslate. No models.
Gotchas
The iris_only mode demands a full 478-landmark MediaPipe detection. Feed it a 68-point set and it throws - and the error tells you exactly that, which is more than most nodes bother with. Also worth internalizing: this node doesn't fix eyes that were already pasted by the composite; it's a prevention tool that runs before sampling. If you're seeing pasted-eye seams in your final image, that's RegionEditFaceEyeMaterialRestore's territory instead. Use them as a pair: this one stops the conditioning from importing eyes, that one repairs eyes the model drew wrong anyway.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| face_landmarks | FACE_LANDMARKS | — | |
| base_mask | MASK | — | |
| face_index | INT | 00–15 | — |
| eye_exclusion_mode | COMBO | none | 3 options: none, iris_only, visible_eye_interior |
| eye_exclusion_scale | FLOAT | 1.800.75–3 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| identity_conditioning_mask | MASK | — |
| excluded_eye_material_mask | MASK | — |
| preview | IMAGE | — |
| report_json | STRING | — |