Superside Stitch Region
Paste a Processed Crop Back Into the Original, Seam Included
- destination
- source
- mask
- image
The crop-edit-stitch pattern is one of the oldest tricks in image editing: instead of processing a whole big image, you crop a small region, work on it, and paste it back. The paste-back step is where amateur pipelines fall apart - the generator returned a slightly different size, the seam is a hard rectangle, the whole thing looks patched. Superside Stitch Region is the paste-back done properly, and it pairs with its sibling Superside Crop By Region in the same pack.
Why it's here
This pack sends images to fal.ai APIs that are much happier with a small, focused crop than a huge full frame - a face region, a product detail, a specific garment. Crop By Region cuts that region out (recording exactly where it cut), you run your edit node on the crop, and Stitch Region pastes the edited crop back at the exact recorded position. Without the stitch half, every crop-edit workflow is a manual, error-prone copy-paste job.
How it works
You hand it the destination (the original full image), the source (your processed crop), and the crop_x, crop_y, crop_w, crop_h integers that Crop By Region produced. The node's clever bit: it resizes the source to exactly crop_w × crop_h before pasting. So even if your edit node came back at a slightly different resolution - which fal calls love to do - the stitch still lands pixel-perfect at the recorded position. No manual resizing, no misalignment.
The seam handling is the other half. The optional mask input takes the same full-resolution mask you fed into Crop By Region, so the paste respects the actual region shape rather than a rectangle. And feather_pixels (default 24) applies a Gaussian blur to the paste mask edge, so the boundary blends into the surrounding image instead of showing a hard edge. That blur radius is the dial you'll tune: too low and you see the seam, too high and the edited region bleeds into what it shouldn't.
If you omit the mask, the whole crop rectangle gets pasted - fine for testing, not ideal for anything where the region isn't rectangular.
Inputs and outputs that matter
destination/source- original and processed crop.crop_x,crop_y,crop_w,crop_h- wire these straight from Crop By Region's outputs.mask(optional) - the full-res region mask, for shaped paste.feather_pixels- seam softness, default 24.
Output: a single image - the composite. Local node, no API key, no network.
Installing it
Part of the comfyui-superside-nodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Superside/comfyui-superside-nodes.git
cd comfyui-superside-nodes
pip install -r requirements.txt
Restart ComfyUI; it's under the Superside category.
Where people get burned
The classic mistake is mixing coordinate spaces - feeding it crop coordinates from one image while the destination is a different size. Always wire the coordinates straight from Crop By Region into this node and don't let anything recompute them. The other one is expecting a perfect blend at feather_pixels of 0: that's a hard paste, and the seam will show. If your edit changed colors or lighting in the region, a soft mask helps but won't fully hide a tone mismatch - that's a job for a color-match node, not for the stitch. For everything a crop-edit-stitch should do, this is the missing half you've been rebuilding by hand.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| destination | IMAGE | — | |
| source | IMAGE | — | |
| crop_x | INT | 00–1000000 | — |
| crop_y | INT | 00–1000000 | — |
| crop_w | INT | 00–1000000 | — |
| crop_h | INT | 00–1000000 | — |
| maskopt | MASK | Full-resolution mask (the same one fed into SupersideCropByRegionNode). If omitted, the whole crop rectangle is pasted. | |
| feather_pixelsopt | INT | 240–512 | Gaussian blur radius applied to the paste mask edge, for a seamless blend. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |