Nodes/Atlas Camera/Atlas Composite Crop πŸ“Œ
ComfyUI Node

Atlas Composite Crop πŸ“Œ

Paste the repaired ROI back without losing the matte

By mikejamesvfxΒ·Created 3 months agoΒ·Updated a day agoΒ· 1
Atlas Composite Crop πŸ“Œ
  • image
  • fill
  • crop
  • mask
  • prior_mask
  • image
  • report
  • pasted_mask

The ROI repair chain works like this: AtlasCropROI cuts a generation-ready crop out of the frame, a model fills the holes in that crop, and then - the boring but essential step - the filled crop has to go back into the frame at exactly the right place with exactly the right shape. Atlas Composite Crop πŸ“Œ is that paste step, and it does it with a discipline most simple paste nodes lack: it tracks which pixels were actually filled.

What it does

Three required inputs:

  • image - the full frame (or the previous slot's paste, if you're chaining multiple crops).
  • fill - the corrected crop fill that came out of the generator.
  • crop - the ATLAS_CROP handle from AtlasCropROI, which carries the native rect so the paste-back is exact. No manual x/y/w/h wiring, no off-by-one drift.

The node pastes the fill back through that crop's rect. Straightforward on the surface, and the details are where it gets interesting.

The matte that makes it work

The optional mask input is the crop's HOLE mask (i.e. AtlasCropROI's mask output). Here's why that matters: when it's wired, the node's pasted_mask output accumulates exactly the filled hole pixels at plate coordinates - not the whole crop rectangle. That distinction is what the matte-patch re-entry loop depends on: a repaired frame contributes only its fills, never a second full-frame copy of the scene, and never the sentinel still pixels marking holes that weren't filled. Without the mask, the whole crop rect accumulates.

And prior_mask is the previous slot's pasted_mask, unioned in - so a chain of pastes emits one accumulated matte at the end, ready for the patch node's patch_mask input.

Where it sits

This node is the tail of the fill loop, usually wired: AtlasCropROI β†’ generator β†’ this node β†’ (optionally) the next crop slot. It's filed under Atlas/advanced because the plain single-crop case doesn't need the matte discipline - but if you're doing the occlusion-fill loop across a camera move, the pasted_mask is the whole point. An unused AtlasCropROI slot degrades to a no-op here too: its empty crop passes through and the node returns its input unchanged.

Outputs: image (the composite), report, and pasted_mask. Install is the pack's clone-and-go; this is pure tensor math, no extras, no GPU. Small node, but the exact-fill tracking is one of those details you only miss once you've lost it.

CategoryAtlas/advanced

Inputs (5)

NameTypeDefaultDescription
imageIMAGEThe full frame (or the previous slot's paste).
fillIMAGEThe corrected crop fill.
cropATLAS_CROPβ€”
maskoptMASKThe crop's HOLE mask (AtlasCropROI's mask output). When wired, pasted_mask accumulates exactly the filled hole pixels at plate coordinates β€” the matte patch re-entry needs so a repaired frame contributes only its fills. Without it the whole crop rect accumulates.
prior_maskoptMASKThe previous slot's pasted_mask; unioned in, so a chain of pastes emits one matte.

Outputs (3)

NameTypeDescription
imageIMAGEβ€”
reportSTRINGβ€”
pasted_maskMASKβ€”