Nodes/Atlas Camera/Atlas Inpaint Stitch ✂
ComfyUI Node

Atlas Inpaint Stitch ✂

Paste your inpainted crop back into the plate without seams or misalignment

By mikejamesvfx·Created 3 months ago·Updated a day ago· 1
Atlas Inpaint Stitch ✂
  • original_image
  • inpainted_crop
  • crop_region
  • mask
  • image
feather_px0

AtlasInpaintStitch is the other half of AtlasInpaintCrop - the paste-back step that completes the crop→inpaint→stitch loop. You hand it the original image, the inpainted crop, and the crop_region the crop node gave you, and it puts the fill back in exactly the right place. It sounds trivial, but "exactly the right place" is the part that usually breaks: inpainted crops come back at odd sizes (an upscale model on the inpaint node, a generative inpainter snapping to multiples of 8), and hand-pasting a misaligned crop is how you get a fill that's shifted by a few pixels and a seam you'll fight for an hour.

The node resizes the crop to the region before pasting, so size drift doesn't become misalignment. And it handles the two very different inpainter behaviours correctly.

How it works

By default the whole crop rectangle is pasted back. That's exact for LaMa/MAT-class inpainters, because those nodes already return the original pixels outside the mask - the fill is the only thing that changed, so pasting the whole rectangle is pixel-perfect. But generative inpainters re-render the entire crop, background included, and pasting all of that back would replace good original pixels with regenerated ones. For those, you wire the same mask you used for the crop into the mask input, and only masked pixels land back on the plate.

The optional feather_px softens the mask edge (box blur) when a mask is wired - worth a few pixels for generative fills, whose edges are rarely as clean as their interiors.

The inputs

original_image, inpainted_crop, and crop_region are required. Then:

  • mask - optional. Only needed for inpainters that re-render the whole crop; for LaMa/MAT leave it unwired and the whole-rect paste is already exact.
  • feather_px (default 0) - softens the mask edge when a mask is wired, to hide seams from generative fills.

The single output is the stitched image.

Install and gotchas

Ships with atlas-camera - install the pack once (ComfyUI Manager → search atlas-camera, or git clone https://github.com/mikejamesvfx/atlas-camera.git into custom_nodes, restart). It's pure tensor orchestration; no dependencies, no models, no GPU.

The gotcha to internalise is which inpainter you're using. Wire a mask when you shouldn't (a LaMa that already returns exact outside pixels) and you risk introducing a faint boundary where none existed; skip the mask when you shouldn't (a generative inpainter) and you paste the regenerated background over your original plate. The tooltip is unusually clear about this - read it once and you're set. And keep the crop→stitch pair together: the crop_region from AtlasInpaintCrop is what guarantees the paste lands where the crop was taken.

It's a small, mechanical node. In a pipeline where the alternative is manual pasting and praying, that mechanics is the whole value.

CategoryAtlas/07 · Clean Plate & Inpaint

Inputs (5)

NameTypeDefaultDescription
original_imageIMAGE
inpainted_cropIMAGE
crop_regionATLAS_CROP_REGION
maskoptMASKOptional: restrict the paste to these pixels (full-frame mask, same one the crop used). Needed only for inpainters that re-render the whole crop; LaMa/MAT return original pixels outside the mask, so the default whole-rect paste is already exact.
feather_pxoptINT00–256Soften the mask edge by this many pixels when a mask is wired (box blur) — hides seams from generative inpainters. 0 = hard.

Outputs (1)

NameTypeDescription
imageIMAGE