Split Bboxes(SplitBboxes)
This node takes a list of type BBOX as input and accepts an integer index value.
Split Bboxes
The Split Bboxes node receives a list of type BBOX as input and accepts an integer index value.
The Split Bboxes node is a utility node for processing lists of bounding boxes. Its core function is to split an input list of bounding boxes into two separate sub-lists based on a specified index position. This operation is straightforward and facilitates grouping or selective processing of detected objects within a workflow.
Node Function
This node receives a list of type BBOX as input and accepts an integer index value. Internally, it uses Python's list slicing operation to split the original list at the specified index: elements before the index (excluding the element at the index) form the first output list, while elements from the index onward form the second output list. It supports BBOX lists of any length, and the index value must be within the valid range of the list.
Node Parameter Description - Split Bboxes
Connection Inputs (Inputs)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
bboxes | BBOX | Yes | - | - | bboxes (Input Parameter): The input list of bounding boxes containing all the bounding box information to be split. |
Control Parameters (Parameters)
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
index | INT | Yes | 0 | 0 - 99999999 (Step: 1) | index (Input Parameter): The index position for splitting, ranging from 0 to 99999999 with a step of 1. The list will be split at this index. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| bboxes_a | BBOX | bboxes_a (Output Parameter): The first sub-list obtained after splitting, containing all bounding boxes from the original list before the specified index. |
| bboxes_b | BBOX | bboxes_b (Output Parameter): The second sub-list obtained after splitting, containing all bounding boxes from the specified index to the end of the original list. |
Usage Scenarios
In practical applications, you can connect it after the output of an object detection model (e.g., YOLO). For example, when multiple people and objects are detected, you can use this node to separate the bounding boxes of "people" from "background objects" by setting an appropriate index. These separated lists can then be passed to different downstream nodes for differentiated processing, such as applying high-definition restoration to people and stylization to objects.
Notes
Please note that if the provided index value is greater than or equal to the length of the input list, the first output list will contain all elements, while the second output list will be empty. Conversely, if the index is 0, the first list will be empty, and the second list will contain all elements.
Split Bboxes Node Source Code Link
The Split Bboxes node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.