ComfyUI Node: String to BBOX

Class Name

StringToBbox

Category
image/caption
Author
WingeD123 (Account age: 1221days)
Extension
ComfyUI_QwenVL_PromptCaption
Latest Updated
2026-03-23
Github Stars
0.04K

How to Install ComfyUI_QwenVL_PromptCaption

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

String to BBOX Description

Converts string bounding box data into structured format for image processing and object detection.

String to BBOX:

The StringToBbox node is designed to convert a string representation of bounding box coordinates into a structured format that can be used for image processing tasks. This node is particularly useful for AI artists who need to extract and utilize bounding box data from textual descriptions, such as JSON strings. By parsing the input string, the node identifies and extracts valid bounding box coordinates, ensuring they are in the correct format for further processing. This functionality is essential for tasks that involve object detection or image annotation, where precise bounding box data is crucial. The node simplifies the process of handling complex string inputs, making it easier for users to work with bounding box data without needing to manually parse and validate the input.

String to BBOX Input Parameters:

string

The string parameter is a multiline text input that contains the bounding box data in a string format, typically JSON. This parameter is crucial as it provides the raw data that the node will parse and convert into structured bounding box coordinates. The input string should include arrays of numbers representing the bounding box coordinates, and it can handle both simple arrays and JSON objects. There are no explicit minimum or maximum values for this parameter, but the string should be formatted correctly to ensure successful parsing.

width

The width parameter specifies the actual width of the image in pixels. It is used to convert the bounding box coordinates from a relative format (e.g., percentages) to absolute pixel values. The default value is 1024, with a minimum of 1 and a maximum of 10000. This parameter is essential for ensuring that the bounding box coordinates are accurately mapped to the image's dimensions.

height

Similar to the width parameter, the height parameter defines the actual height of the image in pixels. It plays a crucial role in converting the bounding box coordinates to absolute values, ensuring they align correctly with the image's dimensions. The default value is 1024, with a minimum of 1 and a maximum of 10000.

index

The index parameter allows you to specify which bounding boxes to extract from the input string. You can provide multiple indices separated by commas to extract specific bounding boxes. If left empty, all bounding boxes will be extracted. This parameter is useful for focusing on particular bounding boxes within a larger dataset.

String to BBOX Output Parameters:

center_coordinates

The center_coordinates output provides the center points of the extracted bounding boxes in JSON string format. Each center point is represented by its x and y coordinates, calculated as the midpoint of the bounding box. This output is valuable for tasks that require the central position of objects within an image.

bboxes

The bboxes output is a list of bounding box coordinates, each represented as a list of four integers. These integers correspond to the top-left and bottom-right corners of the bounding box in pixel values. This output is essential for image processing tasks that involve object detection or annotation, as it provides the precise location of each bounding box within the image.

String to BBOX Usage Tips:

  • Ensure that the input string is correctly formatted, with bounding box coordinates enclosed in brackets and separated by commas, to facilitate accurate parsing.
  • Use the index parameter to focus on specific bounding boxes when working with large datasets, which can help streamline processing and analysis.
  • Adjust the width and height parameters to match the actual dimensions of your image, ensuring that the bounding box coordinates are accurately converted to pixel values.

String to BBOX Common Errors and Solutions:

未从输入字符串中提取到有效的bbox坐标(需包含长度为4的数值数组)

  • Explanation: This error occurs when the input string does not contain any valid bounding box coordinates, or the coordinates are not in the expected format.
  • Solution: Verify that the input string is correctly formatted and includes arrays of four numerical values representing bounding box coordinates.

索引<idx>超出范围(有效范围:0-<len(all_bboxes)-1>

  • Explanation: This error indicates that the specified index is out of range, meaning it does not correspond to any available bounding box in the input string.
  • Solution: Check the indices provided in the index parameter to ensure they are within the valid range of available bounding boxes. Adjust the indices as necessary.

String to BBOX Related Nodes

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

String to BBOX