😺NKD Face Stitch
Put the processed face back at its original angle — the detailer's invisible partner
- image
- face_data
- image
The second half of the 😺NKD face pipeline. Crop grabs a face, straightens it and frames it; your model does its thing on the clean square; then this node puts the result back where it came from - same angle, same size, blended so the seam doesn't announce itself. Without the stitch half, "crop and detail a face" ends with a pasted patch that's the wrong rotation and visibly edged, which is how you get a good face on a face-plant of a composite.
It works off the face_data that 😺NKD Face Crop hands over - the geometry that records exactly how the crop was rotated and scaled. Give it the processed crop and that data, and it reverses the whole journey rather than guessing.
The inputs that matter
image- the processed face crop, straight out of whatever you ran (a detailer, an inpaint, a swap).face_data- from Face Crop. This is the part that makes the paste land exactly.feather- softens the edge of the pasted area, in pixels of the original image. Default 12; too low and the seam shows, too high and the fix bleeds into the untouched face around it.edge_hardness- firms up the blend edge to stop the original face ghosting through as a halo. 0 = off, 1 = hard edge. If the old face shows through at the boundary, nudge this up before reaching for anything heavier.match_colors- pulls the colors of the new face back toward the original photo. 0 = off, 1 = full match. This is the fix for the classic "the detailer changed the skin tone" complaint - a re-render round-trips the VAE and often drifts color slightly, and matching it back is deterministic and instant.seamless_edges- an extra pass that erases any remaining color or lighting seam at the edge. Heavier, can smear fine texture - use only if a seam survives Match Colors, and it needs OpenCV.
Output is a single image: the original photo with the processed face composited in.
Where this fits
Think of it as the same finish work as the pack's Inpaint Stitch, applied to the face path. The ordering rule that keeps coming up in detailing docs applies here too: detail at the crop's native resolution first, upscale after - stitching a low-res patch into a high-res image and then upscaling compounds the mismatch.
Install and gotchas
Install via ComfyUI Manager (search ComfyUI-NKD-Basic-Tools) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools
Restart after. Needs onnxruntime (pack dependency) or the face nodes are skipped at startup; YuNet (~232 KB) and the landmark weights (~10 MB) fetch on first use. If you're seeing a visible edge, the debugging order is: feather up → match_colors up → edge_hardness up → seamless_edges as the last resort. And don't reach for seamless_edges first - it can smear the fine texture you just spent a detail pass adding.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | The processed face crop. | |
| face_data | NKD_FACEDATA | — | |
| feather | INT | 120–256 | Softens the edge of the pasted area, in pixels of the original image. |
| edge_hardness | FLOAT | 0.000–1 | Firms up the blend edge to stop the original face from ghosting through as a halo. 0 = off, 1 = hard edge. |
| match_colors | FLOAT | 0.000–1 | Pulls the colors of the new face back toward the original photo. 0 = off, 1 = full match. |
| seamless_edges | BOOLEAN | false | Extra pass that erases any remaining color or lighting seam at the edge. Heavier, and can smear fine texture. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |