ComfyUI > Nodes > ComfyUI-WithAnyone > WithAnyone BBox Calculator

ComfyUI Node: WithAnyone BBox Calculator

Class Name

WithAnyoneBBoxNode

Category
None
Author
okdalto (Account age: 3465days)
Extension
ComfyUI-WithAnyone
Latest Updated
2025-12-18
Github Stars
0.02K

How to Install ComfyUI-WithAnyone

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

WithAnyone BBox Calculator Description

Calculates normalized bounding boxes for precise object localization in images, with debug visualization.

WithAnyone BBox Calculator:

The WithAnyoneBBoxNode is designed to calculate bounding boxes (BBoxes) in a format that is relative to the dimensions of an image, with coordinates ranging from 0 to 1. This node is particularly useful for tasks that require precise localization of objects within an image, such as face detection or object tracking. By providing a flexible and intuitive way to define bounding boxes, the node allows you to specify the position and size of the box in a normalized format, making it adaptable to images of varying sizes. The node's primary function is to convert these specifications into a string format that can be easily interpreted and used in subsequent image processing tasks. Additionally, it can generate a debug image to visually represent the bounding box, aiding in the verification and adjustment of the bounding box parameters.

WithAnyone BBox Calculator Input Parameters:

box_pos_x

This parameter specifies the horizontal position of the center of the bounding box as a ratio of the image width, ranging from 0.0 to 1.0. A value of 0.5, which is the default, places the center of the box at the midpoint of the image width. Adjusting this value will shift the bounding box left or right across the image.

box_pos_y

This parameter defines the vertical position of the center of the bounding box as a ratio of the image height, with a range from 0.0 to 1.0. The default value is 0.5, positioning the center of the box at the midpoint of the image height. Modifying this value will move the bounding box up or down within the image.

box_width

This parameter determines the width of the bounding box as a fraction of the image width, with possible values between 0.0 and 1.0. The default value is 0.5, meaning the box will occupy half of the image's width. Changing this value will increase or decrease the width of the bounding box accordingly.

box_height

This parameter sets the height of the bounding box as a fraction of the image height, also ranging from 0.0 to 1.0. With a default value of 0.5, the box will cover half of the image's height. Adjusting this parameter will alter the height of the bounding box.

WithAnyone BBox Calculator Output Parameters:

bbox_string

This output is a string that represents the calculated bounding box in the format "x1_ratio,y1_ratio,x2_ratio,y2_ratio". These values are relative coordinates that range from 0 to 1, indicating the top-left and bottom-right corners of the bounding box. This format is useful for integrating with other systems that require normalized bounding box coordinates.

debug_img

The debug image is an optional output that visually represents the bounding box on a blank image. This image can be used to verify the accuracy and placement of the bounding box, ensuring that it aligns with the intended area of interest within the image.

WithAnyone BBox Calculator Usage Tips:

  • To ensure the bounding box is centered within the image, set both box_pos_x and box_pos_y to 0.5. This will place the center of the box at the midpoint of the image.
  • Use the debug_img output to visually confirm the placement and size of your bounding box, especially when fine-tuning the box_width and box_height parameters.

WithAnyone BBox Calculator Common Errors and Solutions:

"BBox must have exactly 4 values: x1_ratio,y1_ratio,x2_ratio,y2_ratio"

  • Explanation: This error occurs when the bounding box string does not contain exactly four comma-separated values.
  • Solution: Ensure that the input string for the bounding box is formatted correctly with four values, each representing a coordinate ratio.

"BBox values must be in range [0, 1]"

  • Explanation: This error indicates that one or more of the bounding box coordinates are outside the acceptable range of 0 to 1.
  • Solution: Check the input values for the bounding box and adjust them to ensure they fall within the 0 to 1 range.

WithAnyone BBox Calculator Related Nodes

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

WithAnyone BBox Calculator