Nodes/ComfyUI-Pixel-Forge/Paste Image Batch by BBox
ComfyUI Node

Paste Image Batch by BBox

Paste a Whole Batch of Crops Back Onto the Canvas — Edges Blended, Not Butchered

By ThunderBolt4931·Created 12 months ago·Updated 9 months ago· 6
Paste Image Batch by BBox
  • image
  • crop_images
  • bounding_boxes
  • IMAGE
crop_blending0.25
crop_sharpening0

"Paste Image Batch by BBox" is the stitch-back half of Pixel-Forge's crop-and-stitch pipeline. You give it a base image, a batch of crops, and the bounding boxes that say where each crop belongs, and it pastes them all down - with optional edge blending and sharpening so the result looks composited instead of collaged. This is the step the inpainting crowd calls "crop, fix at full resolution, stitch back," and this node is the stitch.

Inputs

  • image (IMAGE) - the base canvas. Must be a batch of exactly 1, or it errors.
  • crop_images (IMAGE) - the batch of crops to paste, in order.
  • bounding_boxes (BOX) - one box per crop. These are exactly the bounding_boxes output from Crop Disjoint Mask Regions - that pairing is the whole intended workflow. Crop count must match box count.
  • crop_blending (FLOAT, default 0.25) - how soft the paste edges are, 0 to 1. 0 is a hard cut (sharp edge, possible seam), higher values feather the boundary so the crop melts into the base. Note the feathering scales with crop size - bigger crops get softer edges at the same setting, which is usually what you want.
  • crop_sharpening (INT, default 0, max 3) - passes of a sharpen filter applied to each crop before pasting. 0 is off. Handy when your crops went through an upscale or inpainting pass that softened the detail.

How the paste works

Mechanically, each crop is resized to its box size (LANCZOS, so it stretches or shrinks to fit), optionally sharpened, pasted onto a transparent layer, then composited through a feathered alpha mask. The blur radius of that feather is proportional to crop_blending and the crop dimensions, so edges fade rather than pop. Nothing fancy, but it's the difference between "obviously pasted in" and "looks like it was always there," and it's the reason this beats a bare ImageCompositeMasked for batch paste jobs.

Wiring it into the pack

The designed flow: CropDisjointRegions → process the crops (inpaint, upscale, or match with Image Similarity) → PasteByBoundingBoxBatch with the original boxes. The similarity nodes even pass their matched_bounding_boxes through untouched, so a filtered subset of crops pastes back at their correct spots. It's a clean loop, and it's the most genuinely useful thing this pack offers.

Install

ComfyUI Manager → search "ComfyUI-Pixel-Forge" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ThunderBolt4931/comfyui_pixel_forge

restart, and it's under Pixel_Forge/Batch. No model downloads - pure PIL compositing.

The traps

  • Base image batch must be 1 - the node raises if you feed it a batch. Select a single frame first.
  • Crop/box count mismatch raises immediately. If a filter upstream dropped some crops (like the similarity nodes replacing no-matches with black frames), you still get one paste per box - just check what you're actually pasting.
  • Black frame gotcha: the similarity nodes emit black images for below-threshold candidates, not skipped entries. If you paste those, you'll stamp black rectangles onto your canvas. Filter them out before this node.

The usual new-pack warning applies: December 2025, no community footprint, scaffolding README that documents nothing. The code is small and readable if you want to confirm the blending math, and you probably should before running this on an important composite.

CategoryPixel-Forge/Batch

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
crop_imagesIMAGE
bounding_boxesBOX
crop_blendingFLOAT0.250–1
crop_sharpeningINT00–3

Outputs (1)

NameTypeDescription
IMAGEIMAGE