ComfyUI > Nodes > ComfyUI-SAM3 > SAM3 Create Box

ComfyUI Node: SAM3 Create Box

Class Name

SAM3CreateBox

Category
SAM3/prompts
Author
PozzettiAndrea (Account age: 2240days)
Extension
ComfyUI-SAM3
Latest Updated
2025-12-22
Github Stars
0.32K

How to Install ComfyUI-SAM3

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

SAM3 Create Box Description

Creates box prompts in SAM3 for image segmentation by defining center, size, and label.

SAM3 Create Box:

The SAM3CreateBox node is designed to facilitate the creation of box prompts within the SAM3 framework, which is part of a segmentation and annotation toolset. This node allows you to define a rectangular region, or "box," by specifying its center coordinates, width, and height. Additionally, you can label the box as positive or negative, which can be useful for distinguishing between different types of objects or areas within an image. The primary goal of this node is to provide a straightforward method for generating box prompts that can be used in various image processing and segmentation tasks, enhancing the flexibility and precision of your AI-driven projects.

SAM3 Create Box Input Parameters:

center_x

The center_x parameter specifies the x-coordinate of the center of the box. This value determines the horizontal position of the box within the image. It is crucial for accurately placing the box in the desired location. The value should be a floating-point number representing the position in the image's coordinate system. There are no explicit minimum or maximum values provided, but it should be within the bounds of the image dimensions.

center_y

The center_y parameter specifies the y-coordinate of the center of the box. Similar to center_x, this value determines the vertical position of the box within the image. It is essential for ensuring the box is correctly positioned. The value should be a floating-point number, and while no specific range is given, it should be within the image's height.

width

The width parameter defines the width of the box. This value is crucial for determining how wide the box will be, impacting the area it covers. The width should be a positive floating-point number, and it should be chosen based on the size of the object or region you wish to enclose.

height

The height parameter defines the height of the box. This value determines how tall the box will be, affecting the vertical coverage of the area. Like the width, the height should be a positive floating-point number, selected according to the dimensions of the target object or region.

is_positive

The is_positive parameter is a boolean that indicates whether the box is labeled as positive or negative. A positive label might be used to signify an area of interest, while a negative label could denote an area to be excluded or ignored. This parameter is essential for classification tasks and should be set to True for positive boxes and False for negative ones.

SAM3 Create Box Output Parameters:

box_prompt

The box_prompt output is a dictionary containing the details of the created box, including its position, dimensions, and label. This output is crucial for further processing in segmentation tasks, as it provides a structured representation of the box that can be used by other nodes or components within the SAM3 framework. The box_prompt includes the box's center coordinates, width, height, and whether it is labeled as positive or negative, making it a versatile tool for various image analysis applications.

SAM3 Create Box Usage Tips:

  • Ensure that the center_x and center_y values are within the image's dimensions to avoid placing the box outside the visible area.
  • Use the is_positive parameter strategically to differentiate between areas of interest and those to be excluded, which can enhance the accuracy of your segmentation tasks.
  • Adjust the width and height parameters based on the size of the object or region you want to enclose, ensuring that the box accurately represents the target area.

SAM3 Create Box Common Errors and Solutions:

Box dimensions out of bounds

  • Explanation: This error occurs when the specified box dimensions exceed the image boundaries.
  • Solution: Verify that the center_x, center_y, width, and height parameters are set within the image's dimensions and adjust them accordingly.

Invalid box label

  • Explanation: This error arises when the is_positive parameter is not set to a valid boolean value.
  • Solution: Ensure that the is_positive parameter is either True or False to correctly label the box as positive or negative.

SAM3 Create Box Related Nodes

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