Nodes/ComfyUI-NKD-Basic-Tools/😺NKD Crop / Outpaint Stitch
ComfyUI Node

😺NKD Crop / Outpaint Stitch

The node that puts your crop back — same spot, same angle, no seam

By Nekodificador·Created 2 months ago·Updated a day ago· 92
😺NKD Crop / Outpaint Stitch
  • image
  • crop_data
  • image
â—„feather10â–º
â—„edge_hardness0.00â–º

Crop-and-stitch only works if the "stitch" part is invisible. 😺NKD Crop / Outpaint Stitch is the way back from 😺NKD Crop / Outpaint: you hand it the patch you just sampled or edited, it undoes the crop's rotation and resize, and composites the result onto the original at full resolution. If you've ever squared up a rotated crop by hand so it would fit back on the canvas, this is the node that makes that someone else's problem.

What it does, and what it quietly carries

Here's the whole job, end to end:

  1. 😺NKD Crop / Outpaint - drag a box over the region, rotate it if you like, and it hands you the crop plus a crop_data object.
  2. Your sampling pipeline - img2img, an inpaint pass at high denoise, a Qwen-Image-Edit or Klein-style masked edit, whatever.
  3. Stitch - feed it the processed crop and the same crop_data, and out comes the original image with the patch composited back.

The part beginners miss: Stitch does not take the original image. crop_data already contains the original full-resolution frames, the crop box, and the rotation angle, so Stitch only needs the processed crop and that one wire. The original image is wired into Crop once and never dragged across the canvas again - the same one-wire-carries-the-geometry trick as context buses and SEGS pipes, just for a crop.

Mechanically, it's an inverse warp over the whole background canvas rather than a paste of a rectangle. That single choice is what makes both rotation and outpainting work: a crop taken at 12° goes back at 12°, and a patch whose content extends past the original image's bounds (an outpaint) is composited correctly instead of clipping. There's no rounding error where the patch used to sit - the composite runs against the real full-res background, not against a shrunk proxy.

The two inputs that matter

Everything defaults to sensible, so most people never touch more than these:

  • feather - softens the edge of the pasted area in pixels (default 10). It only ever grows inward. Blurring outward would smear the patch over pixels that were never part of it and leave a visible frame around the paste, so the node won't do it. Bump this up when the seam reads as a hard line.
  • edge_hardness - firms the blend edge back up to stop the original background ghosting through as a halo (default 0, up to 1 for a hard edge). If you raised the feather and now see the old background bleeding in around your patch, this is the dial that fixes it. Feather and hardness pull against each other: too much feather, ghosting; not enough, a seam.

Output is a single image - the original with the crop composited back. Wire that straight to a Save Image or into the next stage of your graph.

Install and workflow notes

Stitch ships in the same pack as the crop, Nekodificador's ComfyUI-NKD-Basic-Tools (search "NKD Basic Tools" in ComfyUI Manager, or):

cd ComfyUI/custom_nodes
git clone https://github.com/Nekodificador/ComfyUI-NKD-Basic-Tools

then restart ComfyUI. No extra model downloads and no heavy Python deps for this node - pure torch compositing. The pack is written against the newer node API, so update ComfyUI if the node doesn't show up after a fresh install.

Real-world notes. This is the manual counterpart to the mask-based 😺NKD Inpaint Stitch: reach for the mask-driven one when a mask already defines your region, and for this one when you framed something by eye (or outpainted, where there's no mask yet - the outpainted area only becomes a mask after Crop generates one). The pair is genuinely handy with modern edit models, which have a habit of subtly shifting the whole image even when you ask for a local change - crop-and-stitch keeps everything except your chosen region bit-identical, and Stitch is what enforces that boundary. And it handles video frames too, so a per-frame edit on a clip comes back at full resolution without you babysitting batch alignment.

Category😺NKD Nodes/Basic

Inputs (4)

NameTypeDefaultDescription
imageIMAGEThe processed crop.
crop_dataNKD_MANUAL_CROPDATA—
featherINT100–256Softens the edge of the pasted area, in pixels.
edge_hardnessFLOAT0.000–1Firms up the blend edge to stop the original background from ghosting through as a halo. 0 = off, 1 = hard edge.

Outputs (1)

NameTypeDescription
imageIMAGEOriginal image with the crop composited back.