ComfyUI Node: Canvas BBox

Class Name

ycCanvasBBox

Category
YCNode/utils
Author
yichengup (Account age: 774days)
Extension
ComfyUI-YCNodes_Toolkit
Latest Updated
2026-03-23
Github Stars
0.05K

How to Install ComfyUI-YCNodes_Toolkit

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

Canvas BBox Description

Processes bounding box data on a canvas for object detection and spatial analysis tasks.

Canvas BBox:

The ycCanvasBBox node is designed to process bounding box data within a canvas context, allowing you to manage and manipulate spatial data effectively. This node is particularly useful for tasks that involve object detection or spatial analysis within a defined canvas area. By parsing bounding box data formatted as strings, it enables you to extract and utilize coordinates and dimensions of various objects or regions of interest on a canvas. The node ensures that you have a consistent output format, even if the input data is incomplete, by providing a fixed number of bounding box outputs. This feature is beneficial for maintaining a uniform data structure, which can be crucial for downstream processing or integration with other systems.

Canvas BBox Input Parameters:

canvas_width

The canvas_width parameter specifies the width of the canvas on which the bounding boxes are defined. It is an integer value that determines the horizontal extent of the canvas, impacting how the bounding box coordinates are interpreted in relation to the overall canvas size.

canvas_height

The canvas_height parameter defines the height of the canvas. Similar to canvas_width, it is an integer value that sets the vertical extent of the canvas, influencing the interpretation of bounding box coordinates in the vertical dimension.

bbox_data

The bbox_data parameter is a string that contains the bounding box information in a specific format: "x1,y1,w1,h1;x2,y2,w2,h2;...". Each segment represents a bounding box with x and y coordinates for the top-left corner, and width and height for the dimensions. This parameter is crucial as it provides the raw data that the node processes to extract bounding box details.

Canvas BBox Output Parameters:

canvas_width

The output canvas_width is the same as the input parameter, representing the width of the canvas. It is returned to maintain consistency and provide context for the bounding box data.

canvas_height

Similar to canvas_width, the output canvas_height is the same as the input parameter, representing the height of the canvas. It ensures that the bounding box data is interpreted correctly in relation to the canvas dimensions.

bbox_strings

The bbox_strings output consists of up to ten strings, each representing a bounding box in the format "x,y,width,height". If fewer than ten bounding boxes are provided in the input, the remaining outputs are empty strings. This output ensures a consistent number of bounding box entries, facilitating easier integration with other processes or systems that require a fixed data structure.

Canvas BBox Usage Tips:

  • Ensure that the bbox_data string is correctly formatted with semicolons separating each bounding box and commas separating the coordinates and dimensions within each box.
  • Use the node to preprocess bounding box data before feeding it into other nodes or systems that require a fixed number of bounding box entries.

Canvas BBox Common Errors and Solutions:

Invalid bbox format

  • Explanation: This error occurs when the bbox_data string does not conform to the expected format of "x,y,width,height".
  • Solution: Verify that each bounding box in the bbox_data string is correctly formatted with four comma-separated values and that each box is separated by a semicolon.

Empty bbox_data

  • Explanation: If the bbox_data string is empty or contains only whitespace, the node will not be able to parse any bounding boxes.
  • Solution: Ensure that the bbox_data string contains valid bounding box information before passing it to the node.

Canvas BBox Related Nodes

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

Canvas BBox