ComfyUI > Nodes > ComfyUI > CropByBBoxes

ComfyUI Node: CropByBBoxes

Class Name

CropByBBoxes

Category
image/preprocessors
Author
ComfyAnonymous (Account age: 763days)
Extension
ComfyUI
Latest Updated
2026-05-13
Github Stars
112.77K

How to Install ComfyUI

Install this extension via the ComfyUI Manager by searching for ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI 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

CropByBBoxes Description

Extract specific image regions using bounding boxes for focused analysis and processing, enhancing efficiency and accuracy.

CropByBBoxes:

The CropByBBoxes node is designed to facilitate the extraction of specific regions from an image based on bounding boxes. This node is particularly useful for tasks that require focused analysis or processing of certain areas within an image, such as object detection or pose estimation. By leveraging bounding boxes, the node allows you to isolate and crop parts of an image, ensuring that only the relevant sections are processed further. This targeted approach not only enhances the efficiency of image processing workflows but also improves the accuracy of subsequent analyses by reducing noise and irrelevant data. The node's ability to handle multiple bounding boxes and adjust crops dynamically makes it a versatile tool in any image processing pipeline.

CropByBBoxes Input Parameters:

bboxes

The bboxes parameter is a crucial input that defines the regions of interest within the image. It is expected to be a list of dictionaries, where each dictionary specifies the coordinates and dimensions of a bounding box. The bounding boxes guide the node in determining which parts of the image to crop. If the input is not a list, it is normalized to ensure compatibility. This parameter directly impacts the node's execution by dictating the areas that will be extracted from the image. There are no explicit minimum or maximum values for this parameter, but it should be structured correctly to ensure accurate cropping.

image

The image parameter represents the input image from which regions will be cropped. This parameter is essential as it provides the source data for the cropping operation. The image should be in a format that the node can process, typically a tensor with dimensions corresponding to the number of frames, height, width, and channels. The quality and resolution of the input image can affect the precision of the cropping and the subsequent analysis.

CropByBBoxes Output Parameters:

crops

The crops output parameter contains the cropped regions extracted from the input image based on the specified bounding boxes. Each crop corresponds to a bounding box and is returned as a separate image segment. This output is vital for further processing steps, as it isolates the areas of interest, allowing for more focused and efficient analysis. The crops are typically returned as tensors, maintaining the original image's data type and device settings.

CropByBBoxes Usage Tips:

  • Ensure that the bounding boxes are correctly defined and correspond to the areas you wish to crop from the image. Incorrect bounding box coordinates can lead to unexpected results or empty crops.
  • Consider the resolution and quality of the input image, as these factors can influence the clarity and detail of the cropped regions. High-resolution images generally yield better results.

CropByBBoxes Common Errors and Solutions:

Invalid bounding box format

  • Explanation: This error occurs when the bounding boxes are not provided in the expected list of dictionaries format.
  • Solution: Ensure that the bboxes parameter is a list of dictionaries, with each dictionary containing the keys x, y, width, and height.

Empty or degenerate crops

  • Explanation: This issue arises when the bounding box coordinates result in a crop with zero or negative dimensions.
  • Solution: Verify that the bounding box coordinates are valid and that x2 is greater than x1 and y2 is greater than y1. Adjust the coordinates if necessary to ensure they define a valid region.

CropByBBoxes Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI
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.

CropByBBoxes