Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates advanced image segmentation using SAM framework for precise masks in AI art tasks.
The SAMDetectorSegmented
node is designed to facilitate advanced image segmentation by leveraging the capabilities of the SAM (Segment Anything Model) framework. This node is particularly useful for AI artists who need to extract precise and detailed segments from images for further processing or artistic manipulation. By combining segmentation hints and various parameters, the node can generate highly accurate masks that delineate specific areas of interest within an image. This functionality is essential for tasks that require fine-grained control over image regions, such as object detection, background removal, and complex compositing.
This parameter specifies the SAM model to be used for segmentation. The SAM model is a pre-trained neural network designed to perform high-quality segmentation tasks. Selecting the appropriate model can significantly impact the accuracy and quality of the segmentation results.
This parameter represents the initial segments or regions of interest within the image. These segments serve as the starting point for the SAM model to refine and generate the final masks. Providing accurate initial segments can enhance the performance of the node.
This parameter is the input image on which the segmentation will be performed. The image should be in a compatible format and resolution that the SAM model can process effectively.
This parameter provides hints to the SAM model about the type of detection to perform. Options include "center-1", "horizontal-2", "vertical-2", "rect-4", "diamond-4", "mask-area", "mask-points", "mask-point-bbox", and "none". These hints guide the model in focusing on specific areas or patterns within the image, improving the segmentation accuracy.
This parameter controls the dilation applied to the segments. Dilation can expand or contract the segments, affecting the final mask's boundaries. The value ranges from -512 to 512, with a default of 0. Adjusting this parameter can help in fine-tuning the mask edges.
This parameter sets the confidence threshold for the segmentation. The value ranges from 0.0 to 1.0, with a default of 0.93. A higher threshold results in more confident but potentially fewer segments, while a lower threshold may include more segments with lower confidence.
This parameter determines the expansion of the bounding boxes around the segments. The value ranges from 0 to 1000, with a default of 0. Expanding the bounding boxes can help in capturing more context around the segments, which can be useful for certain types of segmentation tasks.
This parameter sets the threshold for using mask hints. The value ranges from 0.0 to 1.0, with a default of 0.7. Mask hints guide the SAM model in refining the segments, and adjusting this threshold can influence the model's sensitivity to these hints.
This parameter specifies whether to use negative mask hints. Options include "False", "Small", and "Outter". Negative mask hints can help in excluding certain areas from the segments, providing more control over the final mask.
This output parameter is the combined mask generated by the SAM model. The combined mask represents the final segmentation result, incorporating all the input parameters and hints provided. It is a binary mask where the segmented areas are highlighted.
This output parameter contains the batch of masks generated during the segmentation process. Each mask in the batch corresponds to a specific segment or region within the image. These masks can be used individually or combined for further processing.
detection_hint
options to see which one provides the best segmentation results for your specific image.threshold
parameter to balance between the number of segments and their confidence levels. A higher threshold may yield fewer but more accurate segments.dilation
parameter to fine-tune the edges of the segments. Positive values expand the segments, while negative values contract them.mask_hint_use_negative
option to exclude unwanted areas from the segmentation, especially when dealing with complex images.threshold
parameter is set outside the allowable range of 0.0 to 1.0.threshold
parameter to a value within the specified range.dilation
parameter is set outside the allowable range of -512 to 512.dilation
parameter to a value within the specified range.© Copyright 2024 RunComfy. All Rights Reserved.