Inpaint Canvas Stitch
Putting the inpaint back without a seam, as its own node
- result
- image
Here's the trick that makes the whole Inpaint Canvas round trip work: when the canvas node runs, it quietly expands an invisible stitch node that takes your inpainted crop, sizes it back down to the region it came from, feathers the edge and composites it onto the original. That's the mechanism behind the "unmasked pixels stay byte-for-byte identical" guarantee - only the patch region ever goes through the model, never the whole frame through a VAE encode/decode.
Inpaint Canvas Stitch is that same step, but explicit: a node on your graph that takes result plus stitch_info and hands you the stitched full image. You need it exactly when you don't want to rely on the canvas node's back-link - usually because you want the stitched result for something downstream before it becomes a layer. Save it under your own filename, feed it to an upscaler or a detailer, run a second pass on the whole frame. And even then, the patch is still delivered to the canvas as a layer at the same time, so your editor loop keeps working while your graph also gets the composite.
Inputs and outputs
There are no widgets - this node is all wires.
result- the inpainted crop. Any size, it gets resized to the region. If it's RGBA (API nodes often return that), only the RGB is used.stitch_info- a STRING, thestitch_infooutput of the Inpaint Canvas node. It's a JSON blob the canvas node packs with everything the stitch needs: the base image reference, the mask, the crop's bounding box, the emitted size, the feather and blend widths, and whether alignment and colour match are on.image- the full stitched canvas at full resolution.
The node is also marked as an output node, so it keeps running the chain the way the canvas node does.
How the seam disappears
Stitch reads stitch_info and does the boring-but-important work. The result is resized back to the exact crop rectangle; if it has the same aspect ratio as the emitted crop it's stretched back precisely, and a mismatched aspect (some API models return a fixed shape) is center-cropped rather than distorted. Then, depending on what the editor set: an affine alignment registers the patch to the unchanged ring around the selection when it measurably helps, colour match shifts the patch's means toward that ring so a colour-shifted result leaves no visible seam, and the composite is opaque inside your selection with a soft transition outside it - the feather width you set in the editor, or the auto feather derived from the selection size.
Installing it
It ships with the pack, so it comes free with Inpaint Canvas:
cd ComfyUI/custom_nodes
git clone https://github.com/DenRakEiw/ComfyUI-InpaintCanvas
Restart ComfyUI. No extra dependencies.
Common issues
- Wrong
stitch_info. It must come from the same Inpaint Canvas node that owns the base image - the JSON references that node's stored canvas files. Grabbing it from another canvas node stitches against the wrong base. - Nothing appears to stitch. The canvas node has to have run and have an image loaded;
stitch_infois produced fresh on every run, and if the source isn't there the node can't know the region. - Don't double-stitch. If you wire the canvas node's
resultback and run a standalone Stitch from the same chain, you're doing the seam work twice and the layer you see may not match the image you save. Pick one: the back-link, or the explicit node.
For most people the standalone version never gets used - the invisible one just works. When you need the composite on a wire, though, it's the difference between saving a layer and saving a finished file.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| result | IMAGE | The inpainted crop (any size, it is resized to the region). | |
| stitch_info | STRING | stitch_info output of the Inpaint Canvas node. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |