Nodes/ComfyUI-XJNodes/SEGS Stitcher
ComfyUI Node

SEGS Stitcher

Paste a processed crop back into the original image

By alexjx·Created 10 months ago·Updated 4 months ago· 0
SEGS Stitcher
  • original_image
  • processed_image
  • seg
  • image
feather_pixels5

The whole detect-crop-refine pattern - the thing Impact Pack made famous - ends with one step: put the improved crop back into the original image without leaving a seam. That's SEGS Stitcher's entire job. You give it the original image, the processed version of one segment's crop, the SEG that describes where that crop came from, and it composites the processed image back in place with feathered blending.

The feathering is the part that separates a good stitch from a visible rectangle. The node takes the segment's mask, optionally blurs its edges by feather_pixels (a Gaussian), and uses the result as the blend weight: processed pixels where the mask is 1, original pixels where it's 0, and a smooth gradient between. Done right, the edited region melts into the image instead of announcing itself. It also handles the boring but essential bookkeeping: it clamps the crop region to the actual image bounds, and if your processed crop doesn't match the crop's dimensions - say you upscaled it - it resizes the processed image and mask to fit before blending. That resize behavior is a real convenience; you don't have to carefully match sizes by hand.

The interface:

  • original_image - the full unedited image.
  • processed_image - the crop you've worked on (the image output from SEGS Extractor, after whatever nodes you ran).
  • seg - the SEG describing the crop region and mask (from SEGS Pick).
  • feather_pixels - 0–100, default 5. How soft the blend edge is; 0 gives a hard cut.
  • Output: image - the stitched result.

The intended flow is the pack's showcase: SEGS Pick → SEGS Extractor → process the crop in standard nodes → SEGS Stitcher to put it back. That's the full manual detailer loop, and it's the alternative to Impact Pack's one-node Detailer when you want to control exactly what happens to each region. It also composes with the pack's hook providers - many of those are designed to be applied to the crop before it reaches a stitcher.

Install is the standard routine:

cd ComfyUI/custom_nodes
git clone https://github.com/alexjx/ComfyUI-XJNodes

Restart ComfyUI, find it under XJNodes/segs, or use ComfyUI Manager and search "ComfyUI-XJNodes". No models, empty requirements.txt, and it only needs SEG data (i.e., Impact Pack) to be useful.

The personal-use caveat applies, plus one practical tip: if you see a visible edge, raise feather_pixels before you blame the node. Five pixels is soft but noticeable on high-contrast boundaries; 15–25 is usually the sweet spot for faces.

CategoryXJNodes/segs

Inputs (4)

NameTypeDefaultDescription
original_imageIMAGE
processed_imageIMAGE
segSEG
feather_pixelsINT50–100

Outputs (1)

NameTypeDescription
imageIMAGE