Nodes/Remade_nodes/REMADE Batch Image Composite Masked
ComfyUI Node

REMADE Batch Image Composite Masked

The batch version of ComfyUI's ImageCompositeMasked you keep re-wiring

By Pheat-AI·Created 2 years ago·Updated 2 years ago· 5
REMADE Batch Image Composite Masked
  • destinations
  • sources
  • mask
  • IMAGE
x0
y0
resize_sourcefalse

If you've ever pasted an inpainted region back onto the original image - which is the final step of basically every inpainting workflow - you've met ComfyUI's core ImageCompositeMasked node. REMADE Batch Image Composite Masked is that node, generalized to batches: instead of one destination and one source, it takes destinations and sources batches, composites each pair at an x/y offset (with an optional mask), and returns a batch of composited frames. Same operation, done for a whole set in one node.

That's genuinely useful for the "candidate batch" pattern this pack keeps circling: you inpainted a scene fifty ways, you have fifty candidate sources (the edited regions) and one destinations image (the original), and you want all fifty pasted back onto the original at the same offset. Core ComfyUI forces you to loop or copy nodes; this does the zip in one pass.

How it works

The node is essentially a re-export of ComfyUI core's own composite() helper, called per frame: the source is pasted into the destination at the x,y offset, optionally masked, optionally resized to fit (bilinear) via resize_source. The core logic handles edge clamping so negative offsets and overflow don't crash - coordinates are clamped against the destination's bounds at ±8192. The optional mask is a real MASK tensor (not an image, unlike some other nodes here), interpolated to the source's size. Alpha isn't involved; this is a straight masked paste.

Inputs and outputs

  • destinations (IMAGE) - what gets pasted into, usually the original. Batch length must equal sources (asserted).
  • sources (IMAGE) - what gets pasted in.
  • x, y (INT, −8192 to 8192, default 0) - paste offset.
  • resize_source (BOOLEAN, default false) - resize the source to the destination's size (bilinear). Usually you want this on if your inpainted crop is smaller than the original.
  • mask (MASK, optional) - where the source is allowed to land.
  • Output: IMAGE - one composited frame per pair.

Things to watch

  • Batch counts must match - the assert fires if you try to paste one source into fifty destinations.
  • resize_source defaults to false, and if your source is a different size than the destination with no mask, the paste will be offset weirdly or just sit at the top-left. If the result looks wrong, that boolean is the first suspect.
  • The mask, when used, softens edges via bilinear interpolation - handy for hiding seams, but it also means the mask's hard edges get slightly blurred. For crisp paste-backs you may want to skip the mask and rely on exact source dimensions.

Installing it

It's one of 12 nodes in Remade_nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Pheat-AI/Remade_nodes

Restart ComfyUI, or search Remade_nodes in ComfyUI Manager. No models to download; numpy is the declared dependency (and remember the pack-wide OpenCV requirement from the color-blend node - pip install opencv-python if the pack fails to load).

If your workflow already knows core ImageCompositeMasked, this is a drop-in that finally handles the batch. One node pastes your whole set of inpaint candidates back onto the original - that's the whole appeal, and it's the cleanest node in the pack.

CategoryREMADE/Image

Inputs (6)

NameTypeDefaultDescription
destinationsIMAGE
sourcesIMAGE
xINT0-8192–8192
yINT0-8192–8192
resize_sourceBOOLEANfalse
maskoptMASK

Outputs (1)

NameTypeDescription
IMAGEIMAGE