Nodes/comfy_Pond_Nodes/🐳YOLO图像拼接
ComfyUI Node

🐳YOLO图像拼接

Put the refined crops back where they came from

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳YOLO图像拼接
  • original_image
  • paste_images
  • bboxes
  • 拼接图像
  • 合成遮罩
paste_mode全部粘贴
target_index0
feather_amount20
blend_alpha1.0

YOLO Image Paste (🐳YOLO图像拼接) is the other half of the pack's detection loop: the crop node finds the objects, you do something to those crops (inpaint them, detail them, upscale them), and this node pastes the results back onto the original image at the exact positions they came from. It's the "paste back" step that makes the whole detect→crop→refine→paste loop composable - the KB's masking/detection doc's core loop, implemented in Pond's own nodes instead of Impact Pack's SEGS machinery.

Inputs are the three things you'd expect from that handshake: original_image (the untouched base), paste_images (the processed crops - this one receives a list, so wire the crop node's 裁剪图像 output straight in), and bboxes (the BBOXES output from the crop node, which records where each crop was cut from). Then three controls shape the compositing:

  • paste_mode - 全部粘贴 (paste every crop in order), 指定索引 (only the crop at target_index), or 循环使用 (if you have fewer crops than detections, reuse them round-robin)
  • feather_amount (0-100 pixels) - how soft the edge of each pasted patch is
  • blend_alpha (0-1) - how strongly the pasted content blends into the original (1 is a hard overwrite)

The feather is the important knob, because it's the difference between a seamless fix and a visible rectangle. The node builds a gradient feather mask per patch - a solid core that fades to transparent at the edges (with rounded corners, to avoid the tell-tale square). In the classic use case this hides the seam where a re-rendered face meets the original hair and background. Crank feather_amount for broad softness on skin; drop it toward 0 if you're pasting something that needs hard edges (text, UI elements).

Outputs are 拼接图像 (the composited IMAGE) and 合成遮罩 (the MASK of everything that was pasted) - that mask is useful if you want to know where work happened, or to feed a final subtle blend pass.

The workflow it completes

The realistic pipeline: YOLO Smart Crop → save or re-render each crop (inpaint, a face detailer, an upscale) → YOLO Image Paste. Since paste_images is a list input, you can also paste different content than what was detected - e.g. crop people out of image A and paste new characters from image B onto the same coordinates. That's a legitimate use for 循环使用 and target_index: you control exactly which replacement goes where.

Honest limitations: paste is positional - if your processed crops changed size or aspect ratio, they'll be resized back to the bbox, which can distort them. And there's no automatic color matching in this v8-era node - the V11 version adds that. If your refined crops have noticeably different brightness or tint than the original, the seam will read even with feathering, and you'll want a color-match node (or the V11 paste) in between.

Install

Part of Pond Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes
pip install -r requirements.txt

Restart after (or Manager → "comfy_Pond_Nodes"). Needs the BBOXES type from the pack's own crop node - they ship together, so no extra deps. Uses torchvision transforms (covered by requirements) and PIL. Pack caveat: console spam if comfyui_HiDream-Sampler is installed alongside.

Category🐳Pond/yolo

Inputs (7)

NameTypeDefaultDescription
original_imageIMAGE
paste_imagesIMAGE
bboxesBBOXES
paste_modeCOMBO全部粘贴3 options: 全部粘贴, 指定索引, 循环使用
target_indexINT00–100
feather_amountINT200–100
blend_alphaFLOAT1.00–1

Outputs (2)

NameTypeDescription
拼接图像IMAGE
合成遮罩MASK