🐳裁剪贴回
The paste-back step of the detailer loop, as one clean node
- background
- cropped
- mask
- crop_data
- image
Every auto-detailing workflow is the same loop: detect a region, crop it out, upscale and re-render it, then paste it back onto the original. Most packs fold that last step into a monolithic "detailer" node - which is great until you want to do the paste yourself, with your own refined crop. 🐳裁剪贴回 (CropPasteBack) is that step as a standalone node: give it the original background, the cropped-and-refined image, a mask, and the crop coordinates, and it blends the refined patch back into place.
The mechanism is refreshingly explicit. It takes background (the original), cropped (your refined patch - the thing you re-generated at higher res), mask (what part of the patch should stick), and crop_data (where the patch belongs in the original). Inside, it parses the coordinates, resizes the cropped image and mask to exactly match the crop box (bilinear interpolation), clamps the paste region to the image bounds so it never writes off-canvas, and composites through the mask. That mask blend is what hides the seam - the whole reason you don't just hard-copy pixels.
The inputs
background/cropped/mask- the three IMAGE/MASK inputs, self-explanatory.crop_data- the interesting one. Its type is a grab-bag:BOX, CROP_DATA, BBOX, RECT, COORDS, LIST, TUPLE, DICT, INT, FLOAT, STRING. The node has a smart parser that tries to interpret whatever bbox format your detector emitted. If your detector node outputs a standard bbox, it should just work; if you're feeding it something exotic, expect to check the parse.
Output
One IMAGE output - the composited result. That's it. There's no mask output and no second chance, so keep your originals wired in parallel if you might want to redo the paste.
Where this fits
This is the "paste back" that the KB's detailing docs describe as step four of the automation loop. If you run a detection crop (like the Pond pack's own YOLO crop nodes, or Impact Pack detectors), refine the crop with a separate KSampler pass, then want full control over the composite - this is the node. It's also handy outside detailing: any workflow that crops a region, edits it, and needs it returned to its exact spot.
Install
From comfy_Pond_Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/Pondowner857/comfy_Pond_Nodes
cd comfy_Pond_Nodes && pip install -r requirements.txt
It's pure torch (no OpenCV import in the source), so it's light. Where people trip: feeding a crop_data in a format the parser doesn't recognize, and forgetting that the mask matters - paste the refined crop with a hard-edged mask and you'll see the box line. Feather the mask first and the seam disappears.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| background | IMAGE | — | |
| cropped | IMAGE | — | |
| mask | MASK | — | |
| crop_data | BOX,CROP_DATA,BBOX,RECT,COORDS,LIST,TUPLE,DICT,INT,FLOAT,STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |