ComfyUI > Nodes > comfy_Pond_Nodes > 🐳bbox裁剪

ComfyUI Node: 🐳bbox裁剪

Class Name

CropByBBox

Category
🐳Pond/bbox
Author
Pondowner857 (Account age: 730days)
Extension
comfy_Pond_Nodes
Latest Updated
2026-01-28
Github Stars
0.04K

How to Install comfy_Pond_Nodes

Install this extension via the ComfyUI Manager by searching for comfy_Pond_Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter comfy_Pond_Nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🐳bbox裁剪 Description

Facilitates image cropping by bounding boxes with adjustable expansion and edge feathering.

🐳bbox裁剪:

The CropByBBox node is designed to facilitate the cropping of images based on specified bounding boxes (BBoxes). This node is particularly useful for isolating specific regions of interest within an image, allowing for focused analysis or processing of those areas. It supports independent expansion in four directions—top, bottom, left, and right—enabling you to adjust the cropped area beyond the original bounding box dimensions. Additionally, the node offers a feathering option to smooth the edges of the cropped region, providing a more natural transition between the cropped area and its surroundings. This functionality is essential for tasks that require precise image manipulation, such as object detection, image segmentation, or any application where specific image regions need to be highlighted or processed separately.

🐳bbox裁剪 Input Parameters:

image

The image parameter represents the input image that you wish to crop. It is the primary source from which the bounding box will extract a specific region. This parameter is crucial as it determines the content and context of the cropped output.

bbox

The bbox parameter is a list of bounding boxes that define the regions of the image to be cropped. Each bounding box is specified by its coordinates, which determine the area of interest within the image. This parameter is essential for directing the node to the exact regions that need to be isolated.

bbox_index

The bbox_index parameter allows you to specify which bounding box to use for cropping. A value of -1 indicates that all bounding boxes should be cropped and merged into a single image, while a non-negative integer specifies a particular bounding box from the list. This parameter provides flexibility in selecting specific regions for cropping.

expand_top

The expand_top parameter allows you to expand the top edge of the bounding box by a specified number of pixels. This expansion can be positive or negative, with a default value of 0. It provides control over the vertical cropping boundary, enabling you to include more or less of the image above the original bounding box.

expand_bottom

The expand_bottom parameter functions similarly to expand_top, but it affects the bottom edge of the bounding box. It allows for the expansion or contraction of the cropping area below the original bounding box, with a default value of 0.

expand_left

The expand_left parameter allows you to adjust the left edge of the bounding box. By specifying a positive or negative value, you can expand or contract the cropping area to the left of the original bounding box, with a default value of 0.

expand_right

The expand_right parameter provides control over the right edge of the bounding box. It allows for the expansion or contraction of the cropping area to the right of the original bounding box, with a default value of 0.

feather

The feather parameter determines the amount of feathering applied to the edges of the cropped region. Feathering smooths the transition between the cropped area and the surrounding image, with a default value of 0. A higher value results in a softer edge, which can be useful for blending the cropped region seamlessly into the background.

🐳bbox裁剪 Output Parameters:

cropped_image

The cropped_image output is the resulting image after the specified bounding box has been applied. It contains only the region of the original image that was defined by the bounding box and any specified expansions. This output is crucial for tasks that require focused analysis or processing of specific image areas.

crop_mask

The crop_mask output is a binary mask that corresponds to the cropped region of the image. It highlights the area that was extracted from the original image, providing a visual representation of the cropped region. This mask is useful for applications that require further processing or analysis of the cropped area.

crop_data

The crop_data output provides additional information about the cropping process, including the coordinates of the cropped region. This data is valuable for understanding the exact dimensions and position of the cropped area within the original image, which can be important for subsequent image processing tasks.

🐳bbox裁剪 Usage Tips:

  • To crop multiple regions from an image, set bbox_index to -1 to process all bounding boxes and merge them into a single output.
  • Use the expand_top, expand_bottom, expand_left, and expand_right parameters to adjust the cropping area beyond the original bounding box dimensions, allowing for more context around the region of interest.
  • Apply feathering by setting the feather parameter to a positive value to create a smooth transition between the cropped region and the surrounding image, which can enhance the visual quality of the output.

🐳bbox裁剪 Common Errors and Solutions:

"IndexError: list index out of range"

  • Explanation: This error occurs when the specified bbox_index is out of the range of available bounding boxes.
  • Solution: Ensure that the bbox_index is within the range of the bounding box list, or set it to -1 to process all bounding boxes.

"TypeError: 'NoneType' object is not subscriptable"

  • Explanation: This error may occur if the bbox parameter is not properly defined or is empty.
  • Solution: Verify that the bbox parameter is correctly specified and contains valid bounding box coordinates.

"ValueError: Invalid feather value"

  • Explanation: This error arises when the feather parameter is set to a negative value.
  • Solution: Ensure that the feather parameter is set to a non-negative integer to apply the desired amount of feathering.

🐳bbox裁剪 Related Nodes

Go back to the extension to check out more related nodes.
comfy_Pond_Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.