Detailer
The face detailer that hugs the face instead of boxing it
- image
- segm_detector
- sam_model
- bbox_detector
- eye_bbox_detector
- characterPrompts
- tagger
- image
- mask_visualization
- matching_report
The pack's other face detailer is the sibling you probably want if seams show. NAIFaceDetailerSegmNode runs the exact same detect-crop-segment-inpaint-paste loop as NAIFaceDetailerNode, with one role swap: a segmentation detector (polygon, following the face outline) is the required primary that defines the crop region, and a bbox detector is the optional additive source. You'll find it in the node list under the plain name "Detailer".
Why the swap matters: a bbox detector hands you a rectangle, and a rectangle's edges can show against the surrounding pixels after the inpaint is pasted back. A segmentation detector returns a polygon that follows the face's actual outline, so the mask hugs the subject and the seam mostly disappears. If you've tried the bbox version and see a rectangular patch, this is the one to reach for.
How it works
Same pipeline as its sibling, so this is the short version:
- Detect - the required
segm_detectorfinds the first face and defines the crop region. - Crop and upscale - the crop is scaled so its longest side is 1024px.
- Segment - SAM produces the final mask. A connected
bbox_detectoris an equal-layer additional source: it doesn't replace the segm detector, it contributes extra SAM input boxes whose masks get unioned in. SAM still wins the final word. - Grid-ify - the mask becomes 32px boxes on an 8px stride per the
threshold. - Re-render - crop + mask go to NovelAI infill with your prompt,
strength, sampler, steps, CFG. - Paste back - the result is downscaled and pasted over the crop region.
Only the first detected face is processed. No face found → both outputs return your original image. Autosaves land under output/<date>/NAI_autosave/face/ with NAI metadata intact.
The inputs
Required: image, segm_detector, sam_model, prompt / negative_prompt (defaults smiling face, highly detailed / lowres, bad anatomy), model (the same V5/V4.5/V4/V3 dropdown), strength (default 0.55), threshold (default 0.3), sampler, steps, cfg_scale, bbox_threshold, dilation, crop_factor, scheduler, seed. Optional: bbox_detector (the additive source above), eye_bbox_detector (adds eye-region boxes - the classic "eyes are always a mess" fix), limit_opus_free.
Outputs: image (composited result) and mask_visualization (debug view of the mask).
Install
Pack via ComfyUI Manager (search ComfyUI_RS_NAI_API_Request) or clone, plus the same mandatory extras as its sibling:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
git clone https://github.com/ltdrdata/ComfyUI-Impact-Subpack.git
The SEGM_DETECTOR and SAM_MODEL types are Impact's; you need a segmentation YOLO (a *-seg.pt detector) and a SAM checkpoint, plus NAI_ACCESS_TOKEN=... in the node's .env.
Gotchas
Same cloud-cost and single-face caveats as the bbox version - this is a cloud inpaint call per run, and it fixes the first face it finds. The thing this version buys you is the polygon: tighter masks, fewer seams, and the mask_visualization output is worth a look on your first few runs to confirm the segm detector is actually finding the face's outline and not a hat brim or collar.
Inputs (28)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| segm_detector | SEGM_DETECTOR | — | |
| sam_model | SAM_MODEL | — | |
| prompt | STRING | smiling face, highly detailed | — |
| negative_prompt | STRING | lowres, bad anatomy | — |
| model | COMBO | NAI Diffusion V5 Curated | 8 options: NAI Diffusion V5 Curated, NAI Diffusion V5 Full, NAI Diffusion V4.5 Curated, NAI Diffusion V4.5 Full, NAI Diffusion V4 Full, NAI Diffusion V4 Curated Preview, +2 |
| strength | FLOAT | 0.550–1 | — |
| threshold | FLOAT | 0.300–1 | — |
| sampler | COMBO | k_euler | 7 options: k_dpmpp_2m, k_dpmpp_sde, k_dpmpp_2m_sde, k_dpmpp_2s_ancestral, k_euler_ancestral, k_euler, +1 |
| steps | INT | 281–50 | — |
| cfg_scale | FLOAT | 6.00–30 | — |
| bbox_threshold | FLOAT | 0.500–1 | — |
| dilation | INT | 40–64 | — |
| crop_factor | FLOAT | 3.01–10 | — |
| scheduler | COMBO | karras | 4 options: native, karras, exponential, polyexponential |
| seed | INT | -1-1–4294967295 | — |
| bbox_detectoropt | BBOX_DETECTOR | — | |
| eye_bbox_detectoropt | BBOX_DETECTOR | — | |
| limit_opus_freeopt | BOOLEAN | true | — |
| detail_modeopt | COMBO | first | 2 options: first, all |
| matching_modeopt | COMBO | shared | 2 options: shared, wd14 |
| characterPromptsopt | LIST | — | |
| taggeropt | RS_WD_TAGGER | — | |
| match_min_scoreopt | FLOAT | 0.250.01–1 | — |
| match_min_marginopt | FLOAT | 0.080.01–1 | — |
| match_crop_factoropt | FLOAT | 2.01–5 | — |
| max_regionsopt | INT | 161–64 | — |
| preview_onlyopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask_visualization | IMAGE | — |
| matching_report | STRING | — |