Batch Uncrop(BatchUncrop)
This node takes the original image, the cropped image, and the corresponding bounding box (BBOX) data as inputs.
Batch Uncrop
The Batch Uncrop node receives the original image, the cropped image, and the corresponding bounding box (BBOX) data as input.
The Batch Uncrop node is a tool for image composition. Its core function is to precisely place cropped images back into specified locations within the original background image. It uses bounding box coordinates for positioning and supports smooth blending at the seam edges to achieve a seamless visual integration effect.
Node Function
This node receives the original image, the cropped image, and the corresponding bounding box (BBOX) data as input. Its internal mechanism is to recomposite the cropped image back into the corresponding area of the original image based on the coordinates defined by the bounding box. It supports scaling adjustments for the repositioned image and handles seam edges with an adjustable blend strength to reduce harsh transitions. All input images must be in batch format, and their quantities must match each other.
Node Parameter Description - Batch Uncrop
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
original_images | IMAGE | Yes | - | - | original_images (Input Parameter): The batch of original, complete background images. The cropped images will be fused back into these. |
cropped_images | IMAGE | Yes | - | - | cropped_images (Input Parameter): The batch of cropped images that need to be repositioned back into the original background. The quantity must match the original images. |
bboxes | BBOX | Yes | - | - | bboxes (Input Parameter): The batch of bounding box coordinates defining the position of the cropped images within the original images, used for precise positioning. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
border_blending | FLOAT | Yes | 0.25 | 0.0 - 1.0 (Step: 0.01) | border_blending (Input Parameter): Controls the blending strength at the seam edges. Range 0.0 to 1.0. Higher values result in smoother blending. |
crop_rescale | FLOAT | Yes | 1.0 | 0.0 - 10.0 (Step: 0.01) | crop_rescale (Input Parameter): The scaling factor applied to the cropped image before fusion. Range 0.0 to 10.0. |
border_top | BOOLEAN | Yes | True | - | border_top (Input Parameter): Boolean value controlling whether to apply blending to the top edge of the repositioned image. |
border_bottom | BOOLEAN | Yes | True | - | border_bottom (Input Parameter): Boolean value controlling whether to apply blending to the bottom edge of the repositioned image. |
border_left | BOOLEAN | Yes | True | - | border_left (Input Parameter): Boolean value controlling whether to apply blending to the left edge of the repositioned image. |
border_right | BOOLEAN | Yes | True | - | border_right (Input Parameter): Boolean value controlling whether to apply blending to the right edge of the repositioned image. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| IMAGE | IMAGE | IMAGE (Output Parameter): Outputs the final batch of composited images. |
Usage Scenario
A typical usage scenario is in a portrait restoration workflow: First, use a detection node to frame the facial area, crop and enlarge it for detail restoration (e.g., removing blemishes, enhancing resolution). Then, use the Batch Uncrop node to seamlessly fuse the restored facial image back into the corresponding position of the original photo, resulting in an overall image with locally enhanced details.
Notes
When using this node, ensure that the quantities of the input original_images and cropped_images batches are strictly consistent. If more bounding boxes (bboxes) are provided than there are images, the node will automatically discard the excess bounding boxes.
Batch Uncrop Node Source Code Link
The Batch Uncrop node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.