ComfyUI Node
Occlusion Mask (Face Protection for ReActor)
A ComfyUI node in image/faceswap with 8 inputs and 3 outputs.
Occlusion Mask (Face Protection for ReActor)
- input_image
- IMAGE
- MASK
- PREVIEW
◄face_targetLargest face only►
◄face_crop_padding0.15►
◄fallback_to_full_imagefalse►
◄detection_sensitivity0.65►
◄mask_expansion6►
◄edge_softness4►
◄mask_modeSoft (recommended)►
Categoryimage/faceswap
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| input_image | IMAGE | — | |
| face_target | COMBO | Largest face only | Largest face only: fastest, best for single-subject images. All faces: processes every detected face independently and unions the masks. |
| face_crop_padding | FLOAT | 0.150–0.5 | How much extra area around the detected face bounding box to include before running the occlusion models. Increase if objects near the face edges are being missed. 15% is a good default. |
| fallback_to_full_image | BOOLEAN | false | If enabled and no face is detected, the entire image is treated as the face region. Useful for heavily occluded faces. Disable for safety to avoid accidental full-image masking. |
| detection_sensitivity | FLOAT | 0.650–1 | Controls how aggressively objects are detected. LOW (0.2–0.4): only very prominent occlusions like a hand covering the face. MID (0.5–0.7): good default — catches microphones, glasses, held objects. HIGH (0.8–1.0): catches subtle occlusions but may bleed into face edges. |
| mask_expansion | INT | 6-20–50 | Expands (positive) or shrinks (negative) the detected occlusion mask. Positive values add a safety margin around objects — recommended to avoid faceswap pixels bleeding under object edges. Negative values trim the mask if it's accidentally covering face skin. |
| edge_softness | INT | 40–30 | Gaussian blur applied to the mask AFTER expansion. Soft edges create a smoother transition between the swapped face and the preserved object, avoiding hard seams. 4–8px is recommended for most cases. |
| mask_mode | COMBO | Soft (recommended) | Soft: the mask retains gradient values (0.0–1.0) allowing partial blending at object boundaries — best for natural-looking results. Hard: mask is strictly 0 or 1 — use if ReActor produces ghosting artifacts with soft masks. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| PREVIEW | IMAGE | — |