Stitch Inpaint π
The other half of the only inpaint pattern that guarantees nothing else moves
- stitcher
- inpainted
- image
- blend_mask
If Crop For Inpaint π is the front half of the crop-and-stitch pattern, Stitch Inpaint π is the payoff. It takes the inpainted crop, pastes it back into the original image, and - this is the whole point - every pixel outside the blend region comes back bit-identical. Those pixels never pass through a resize, never touch a VAE, never even get re-encoded. What was there is what remains, to the byte.
That's a stronger guarantee than the older ImageCompositeMasked approach, and it's why the crop-and-stitch pattern beat it. The knowledge base puts it plainly: compositing after inpainting went from a discipline you had to remember to a property of the graph itself.
What it takes in
Two required inputs, and that's basically it:
stitcher- from Crop For Inpaint'sstitcheroutput. It carries the canvas, the rectangle the crop came from, the feathered blend mask, and the scale.inpainted- the crop your sampler produced. If the sampler changed its size, the node resizes it back to the crop window before pasting.
One output: image, the original-size result with the inpainted crop blended in. A stitcher built from a single image broadcasts across a whole inpainted frame batch, so the one-crop-serves-a-clip trick from the crop node pays off here - paste a whole video back in one node.
The one optional flag that matters
fix_edge_halo (default off) is aimed at the rim that appears when a feathered seam gets blended twice: half-transparent edge pixels blend their background in twice and leave a dark or light line. When enabled, the node recovers the true color under the seam before pasting. The catch: it needs the optional pymatting package. Without it, the node notes it once in the console and pastes unchanged - no crash, just no halo fix. If you're seeing rims on feathered seams, that's the knob, and you'll want:
cd ComfyUI/custom_nodes/ComfyUI-AusBoss
pip install pymatting
Install
cd ComfyUI/custom_nodes
git clone https://github.com/ausboss/ComfyUI-AusBoss.git
Restart ComfyUI and search for AusBoss (also in Manager under ComfyUI-AusBoss). The pack core has no extra dependencies beyond what ComfyUI ships; only the halo fix wants pymatting. Minimum ComfyUI 0.27.1.
Troubleshooting
A hard seam when you expected a blend means blend_pixels on the crop node was 0 - the stitcher records that paste mask, so check the crop side, not this node. A visible halo with feathering on means either fix_edge_halo is off, or it's on but pymatting isn't installed (check the console for the one-time note). And if the pasted region looks shifted, the stitcher and the inpainted crop came from different graphs - re-run the crop side, or at least don't mix stitchers between branches.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| stitcher | AUSBOSS_STITCHER | The stitcher output of Crop For Inpaint π. | |
| inpainted | IMAGE | Inpainted crop to paste back. It is resized to the crop window if the sampler changed its size. | |
| fix_edge_haloopt | BOOLEAN | false | Recover the true color under the feathered seam before pasting, so half-transparent edge pixels stop blending their background in twice and leaving a dark or light rim. Needs the optional pymatting package; without it the paste is unchanged and the console notes it once. |
| color_matchopt | FLOAT | 0.000β1 | Pull the inpainted region's tone onto the original's before pasting. The shift is measured in the feathered band, where the sampler's version and the true pixels overlap, so it reads the model's own drift - the lighter or warmer bands an outpaint often comes back with. 1 applies the full measured shift, 0 is off. Needs a feather (an overlap) to measure; with none it does nothing. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Original-size image with the inpainted crop blended in; pixels outside the blend region are untouched. |
| blend_mask | MASK | The feathered paste mask in the stitched image's coordinates - white where the inpaint blended in, zero where the original survived. Wire it to a color-match or compositing node to treat exactly the pasted region without rebuilding the mask. |