TBG SAM3 Selector:
The TBGSAM3PromptCollector is a versatile node designed to streamline the process of collecting and managing interactive prompts for image segmentation tasks. It unifies the collection of points and boxes into a single node, allowing for a more efficient and organized approach to prompt management. This node is particularly beneficial for AI artists who need to specify regions of interest within an image, as it supports both positive and negative prompts, enabling precise control over the segmentation process. By toggling between point and box selection modes, users can easily annotate images with positive or negative labels, enhancing the accuracy and effectiveness of the segmentation model. The TBGSAM3PromptCollector is an essential tool for those looking to optimize their image processing workflows, providing a user-friendly interface for prompt collection and integration into the SAM3 segmentation pipeline.
TBG SAM3 Selector Input Parameters:
image
The image parameter is the primary input for the node, representing the image on which interactive selection will be performed. Users can toggle between point and box selection modes using the 'B' key, with left-clicks indicating positive selections and right-clicks or shift-clicks indicating negative selections. This parameter is crucial as it serves as the canvas for all subsequent prompt annotations. There are no specific minimum or maximum values for this parameter, as it is dependent on the image data provided by the user.
positive_points
The positive_points parameter is a string that contains a list of coordinates representing points on the image that are positively labeled. These points are used to indicate areas of interest that should be included in the segmentation. The default value is an empty list ([]), and it is not multiline, meaning it should be formatted as a single line of text. This parameter directly impacts the segmentation results by specifying which regions are considered important.
negative_points
The negative_points parameter is similar to positive_points, but it contains coordinates for points that are negatively labeled. These points indicate areas that should be excluded from the segmentation. Like positive_points, the default value is an empty list ([]), and it is not multiline. This parameter helps refine the segmentation by clearly defining regions that are not of interest.
positive_boxes
The positive_boxes parameter is a string that contains a list of coordinates defining rectangular boxes on the image that are positively labeled. These boxes are used to highlight larger areas of interest for inclusion in the segmentation. The default value is an empty list ([]), and it is not multiline. This parameter allows users to quickly annotate significant regions without needing to specify individual points.
negative_boxes
The negative_boxes parameter functions like positive_boxes, but it defines boxes that are negatively labeled. These boxes mark areas that should be excluded from the segmentation. The default value is an empty list ([]), and it is not multiline. This parameter is useful for excluding large, irrelevant areas from the segmentation process.
TBG SAM3 Selector Output Parameters:
sam3_selectors_pipe
The sam3_selectors_pipe is the output of the node, representing the collected prompts in a format suitable for integration into the SAM3 segmentation pipeline. This output is crucial as it encapsulates all the user-defined points and boxes, both positive and negative, and prepares them for further processing by the segmentation model. The sam3_selectors_pipe ensures that the collected prompts are efficiently utilized, enhancing the overall segmentation accuracy and performance.
TBG SAM3 Selector Usage Tips:
- To maximize the effectiveness of the
TBGSAM3PromptCollector, ensure that you accurately label points and boxes as positive or negative based on their relevance to the segmentation task. This will significantly improve the model's ability to distinguish between areas of interest and irrelevant regions. - Utilize the toggle feature to switch between point and box selection modes, allowing for flexible and precise annotations. This can be particularly useful when dealing with complex images that require both detailed and broad annotations.
TBG SAM3 Selector Common Errors and Solutions:
Invalid JSON format for points or boxes
- Explanation: This error occurs when the input strings for points or boxes are not properly formatted as JSON arrays.
- Solution: Ensure that the input strings for
positive_points,negative_points,positive_boxes, andnegative_boxesare correctly formatted as JSON arrays. For example, use"[{"x": 10, "y": 20}]"for a single point.
Image dimensions not matching prompt coordinates
- Explanation: This error arises when the coordinates specified in the prompts exceed the dimensions of the input image.
- Solution: Verify that all point and box coordinates are within the bounds of the image dimensions. Adjust the coordinates or resize the image as necessary to ensure compatibility.
