ComfyUI > Nodes > ComfyUI-SAM3 > SAM3 BBox Collector 📦

ComfyUI Node: SAM3 BBox Collector 📦

Class Name

SAM3BBoxCollector

Category
SAM3
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 BBox Collector 📦 Description

SAM3BBoxCollector: Interactive node for collecting and normalizing bounding boxes for image segmentation.

SAM3 BBox Collector 📦:

The SAM3BBoxCollector is an interactive node designed to facilitate the collection and normalization of bounding boxes for image segmentation tasks within the SAM3 framework. This node allows you to visually interact with an image canvas, enabling the addition of both positive and negative bounding boxes through intuitive mouse actions. Positive bounding boxes, which are drawn with a left-click and drag, are represented by cyan rectangles, while negative bounding boxes, created with a Shift+Left-click or Right-click and drag, appear as red rectangles. The primary function of this node is to convert these user-defined bounding boxes into a format suitable for further processing by the SAM3Segmentation node. By normalizing the bounding box coordinates to the image dimensions and converting them into a center-based format, the SAM3BBoxCollector ensures that the bounding boxes are ready for accurate segmentation tasks. This node is particularly beneficial for AI artists and developers who require a straightforward method to define areas of interest or exclusion within an image, enhancing the precision and effectiveness of segmentation models.

SAM3 BBox Collector 📦 Input Parameters:

image

The image parameter is the visual canvas on which you can interactively draw bounding boxes. It serves as the backdrop for defining areas of interest or exclusion. The image should be in a format that can be displayed on the interactive canvas, allowing you to click and drag to create bounding boxes. This parameter is crucial as it provides the context for the bounding boxes and determines the dimensions for normalizing the coordinates. There are no specific minimum or maximum values for this parameter, but it should be a valid image file that can be processed by the node.

bboxes

The bboxes parameter is a string that contains a JSON array of positive bounding boxes. These are the areas you want to highlight or include in the segmentation process. The parameter accepts a JSON-formatted string, with each bounding box defined by its coordinates. The default value is an empty array ([]), indicating no initial bounding boxes. This parameter impacts the node's execution by determining which areas of the image are considered positive examples for segmentation.

neg_bboxes

The neg_bboxes parameter is similar to bboxes but is used for defining negative bounding boxes. These are areas you want to exclude from the segmentation process. Like bboxes, this parameter accepts a JSON-formatted string, with each bounding box defined by its coordinates. The default value is also an empty array ([]). This parameter is essential for refining the segmentation process by specifying areas that should not be included in the final output.

SAM3 BBox Collector 📦 Output Parameters:

positive_bboxes

The positive_bboxes output parameter provides a structured representation of the positive bounding boxes collected from the image. It outputs a dictionary in the SAM3_BOXES_PROMPT format, containing normalized coordinates and labels for each positive bounding box. This output is crucial for the segmentation process, as it defines the areas of interest that the SAM3Segmentation node will focus on.

negative_bboxes

The negative_bboxes output parameter offers a similar structured representation for the negative bounding boxes. It outputs a dictionary in the SAM3_BOXES_PROMPT format, containing normalized coordinates and labels for each negative bounding box. This output is important for excluding specific areas from the segmentation process, ensuring that the final segmentation results are accurate and aligned with your intentions.

SAM3 BBox Collector 📦 Usage Tips:

  • Ensure that the image provided is of high quality and clearly represents the areas you wish to segment, as this will improve the accuracy of the bounding boxes you draw.
  • Use the interactive canvas to carefully define positive and negative bounding boxes, as precise bounding box placement will lead to better segmentation results.
  • Regularly check the console output for messages about the number of bounding boxes collected to verify that your interactions are being correctly registered.

SAM3 BBox Collector 📦 Common Errors and Solutions:

JSONDecodeError

  • Explanation: This error occurs when the bboxes or neg_bboxes parameters contain invalid JSON strings that cannot be parsed.
  • Solution: Ensure that the input strings for bboxes and neg_bboxes are correctly formatted JSON arrays. Use a JSON validator to check the syntax if necessary.

Image Dimension Error

  • Explanation: This error might occur if the image dimensions cannot be determined, possibly due to an invalid image format.
  • Solution: Verify that the image provided is in a supported format and can be processed by the node. Convert the image to a standard format like JPEG or PNG if needed.

SAM3 BBox Collector 📦 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.