SAM 3¶
v3¶
Class: SegmentAnything3BlockV3 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.models.foundation.segment_anything3.v3.SegmentAnything3BlockV3
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Run Segment Anything 3 (SAM3), a zero-shot instance segmentation model, on an image.
You can use text prompts for open-vocabulary segmentation - just specify class names and SAM3 will segment those objects in the image.
This block supports two output formats: - rle (default): Returns masks in RLE (Run-Length Encoding) format, which is more memory-efficient - polygons: Returns polygon coordinates for each mask
RLE format is recommended for high-resolution images or workflows with many detections.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/sam3@v3to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
model_id |
str |
model version. You only need to change this for fine tuned sam3 models.. | ✅ |
class_names |
Optional[List[str], str] |
List of classes to recognise. | ✅ |
class_mapping |
Dict[str, str] |
Maps class names in predictions to different output names. Applied after inference, e.g. {'cat': 'gato'} renames 'cat' predictions to 'gato'.. | ✅ |
confidence |
float |
Minimum confidence threshold for predicted masks. | ✅ |
per_class_confidence |
List[float] |
List of confidence thresholds per class (must match class_names length). | ✅ |
apply_nms |
bool |
Whether to apply Non-Maximum Suppression across prompts. | ✅ |
nms_iou_threshold |
float |
IoU threshold for cross-prompt NMS. Must be in [0.0, 1.0]. | ✅ |
output_format |
str |
'rle' returns efficient RLE encoding (recommended), 'polygons' returns polygon coordinates. | ❌ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
hard— runtimeself_hosted_cpu; executionlocal - Requires a GPU; run_locally() loads a model that needs CUDA.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to SAM 3 in version v3.
- inputs:
Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Blur Visualization,Reference Path Visualization,OpenAI,Anthropic Claude,Camera Focus,Instance Segmentation Model,Size Measurement,Model Comparison Visualization,Florence-2 Model,Trace Visualization,SmolVLM2,JSON Parser,Label Visualization,Image Convert Grayscale,Florence-2 Model,Text Display,Qwen-VL,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Absolute Static Crop,Gaze Detection,CSV Formatter,Keypoint Detection Model,LMM,Qwen 3.5 API,Qwen 3.6 API,Qwen2.5-VL,Camera Focus,VLM As Detector,Qwen3-VL,Multi-Label Classification Model,Clip Comparison,Google Gemma API,Contrast Enhancement,Halo Visualization,Color Visualization,Morphological Transformation,MoonshotAI Kimi,Stitch OCR Detections,Event Writer,Buffer,Stability AI Inpainting,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,OpenAI,Roboflow Vision Events,Identify Outliers,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Semantic Segmentation Model,Dynamic Crop,Bounding Box Visualization,Qwen3.5-VL,Clip Comparison,OpenAI,SIFT Comparison,OCR Model,Single-Label Classification Model,Slack Notification,OpenRouter,Detection Event Log,SIFT Comparison,Pixelate Visualization,Google Vision OCR,Dynamic Zone,Google Gemma,Halo Visualization,Stitch OCR Detections,GLM-OCR,Image Threshold,Stitch Images,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,Single-Label Classification Model,Google Gemini,Single-Label Classification Model,Webhook Sink,Instance Segmentation Model,QR Code Generator,MQTT Writer,Ellipse Visualization,Object Detection Model,Anthropic Claude,Keypoint Detection Model,Dot Visualization,Perspective Correction,Instance Segmentation Model,Roboflow Dataset Upload,PLC ModbusTCP,SIFT,Google Gemini,Dimension Collapse,EasyOCR,Local File Sink,Triangle Visualization,Contrast Equalization,Polygon Visualization,OpenAI,Heatmap Visualization,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Multi-Label Classification Model,Polygon Visualization,Image Stack,Email Notification,Mask Visualization,Anthropic Claude,Identify Changes,PTZ Tracking (ONVIF),Keypoint Visualization,Background Subtraction,Multi-Label Classification Model,Twilio SMS Notification,Email Notification,Semantic Segmentation Model,Image Slicer,Image Contours,Line Counter Visualization,Image Preprocessing,VLM As Classifier,Depth Estimation,Motion Detection,Current Time,Qwen3.5,Cosine Similarity,Corner Visualization,Polygon Zone Visualization,Camera Calibration,Roboflow Dataset Upload,Grid Visualization,Stability AI Image Generation,S3 Sink,Circle Visualization,Image Slicer,Roboflow Custom Metadata,Relative Static Crop,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Background Color Visualization - outputs:
Halo Visualization,Overlap Analysis,SAM 3 Interactive,Crop Visualization,Icon Visualization,Detections Transformation,Blur Visualization,ByteTrack Tracker,Detections Classes Replacement,Byte Tracker,Track Class Lock,Size Measurement,Mask Edge Snap,Model Comparison Visualization,Path Deviation,Florence-2 Model,Trace Visualization,Ellipse Visualization,BoT-SORT Tracker,Dot Visualization,Perspective Correction,Label Visualization,Florence-2 Model,Per-Class Confidence Filter,Roboflow Dataset Upload,Detections Stabilizer,Detections Merge,Velocity,OC-SORT Tracker,Triangle Visualization,Camera Focus,Time in Zone,SORT Tracker,Polygon Visualization,Line Counter,SAM2 Video Tracker,Heatmap Visualization,Detections Stitch,Detections List Roll-Up,Halo Visualization,Color Visualization,Event Writer,Polygon Visualization,Mask Visualization,Detections Filter,Distance Measurement,Stability AI Inpainting,Bounding Rectangle,PTZ Tracking (ONVIF),Time in Zone,Overlap Filter,Roboflow Vision Events,Mask Area Measurement,Detection Offset,Detections Consensus,Byte Tracker,Dynamic Crop,Path Deviation,Byte Tracker,Bounding Box Visualization,Detections Combine,Corner Visualization,Roboflow Dataset Upload,Segment Anything 2 Model,Circle Visualization,Time in Zone,Roboflow Custom Metadata,Model Monitoring Inference Aggregator,Detection Event Log,Pixelate Visualization,Background Color Visualization,Line Counter,Dynamic Zone
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
SAM 3 in version v3 has.
Bindings
-
input
images(image): The image to infer on..model_id(roboflow_model_id): model version. You only need to change this for fine tuned sam3 models..class_names(Union[string,list_of_values]): List of classes to recognise.class_mapping(dictionary): Maps class names in predictions to different output names. Applied after inference, e.g. {'cat': 'gato'} renames 'cat' predictions to 'gato'..confidence(float): Minimum confidence threshold for predicted masks.per_class_confidence(list_of_values): List of confidence thresholds per class (must match class_names length).apply_nms(boolean): Whether to apply Non-Maximum Suppression across prompts.nms_iou_threshold(float): IoU threshold for cross-prompt NMS. Must be in [0.0, 1.0].
-
output
predictions(Union[rle_instance_segmentation_prediction,instance_segmentation_prediction]): Prediction with detected bounding boxes and RLE-encoded segmentation masks in form of sv.Detections(...) object ifrle_instance_segmentation_predictionor Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object ifinstance_segmentation_prediction.
Example JSON definition of step SAM 3 in version v3
{
"name": "<your_step_name_here>",
"type": "roboflow_core/sam3@v3",
"images": "$inputs.image",
"model_id": "sam3/sam3_final",
"class_names": [
"car",
"person"
],
"class_mapping": {
"cat": "gato",
"dog": "perro"
},
"confidence": 0.3,
"per_class_confidence": [
0.3,
0.5,
0.7
],
"apply_nms": "<block_does_not_provide_example>",
"nms_iou_threshold": 0.5,
"output_format": "rle"
}
v2¶
Class: SegmentAnything3BlockV2 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.models.foundation.segment_anything3.v2.SegmentAnything3BlockV2
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Run Segment Anything 3, a zero-shot instance segmentation model, on an image.
You can pass in boxes/predictions from other models as prompts, or use a text prompt for open-vocabulary segmentation. If you pass in box detections from another model, the class names of the boxes will be forwarded to the predicted masks.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/sam3@v2to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
model_id |
str |
model version. You only need to change this for fine tuned sam3 models.. | ✅ |
class_names |
Optional[List[str], str] |
List of classes to recognise. | ✅ |
confidence |
float |
Minimum confidence threshold for predicted masks. | ✅ |
per_class_confidence |
List[float] |
List of confidence thresholds per class (must match class_names length). | ✅ |
apply_nms |
bool |
Whether to apply Non-Maximum Suppression across prompts. | ✅ |
nms_iou_threshold |
float |
IoU threshold for cross-prompt NMS. Must be in [0.0, 1.0]. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
hard— runtimeself_hosted_cpu; executionlocal - Requires a GPU; run_locally() loads a model that needs CUDA.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to SAM 3 in version v2.
- inputs:
Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Blur Visualization,Reference Path Visualization,OpenAI,Anthropic Claude,Camera Focus,Instance Segmentation Model,Size Measurement,Model Comparison Visualization,Florence-2 Model,Trace Visualization,JSON Parser,Label Visualization,Image Convert Grayscale,Florence-2 Model,Text Display,Qwen-VL,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Absolute Static Crop,Gaze Detection,CSV Formatter,Keypoint Detection Model,LMM,Qwen 3.5 API,Qwen 3.6 API,Camera Focus,VLM As Detector,Multi-Label Classification Model,Clip Comparison,Google Gemma API,Contrast Enhancement,Halo Visualization,Color Visualization,Morphological Transformation,MoonshotAI Kimi,Stitch OCR Detections,Event Writer,Buffer,Stability AI Inpainting,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,OpenAI,Roboflow Vision Events,Identify Outliers,CogVLM,Detections Consensus,Object Detection Model,OPC UA Writer Sink,Semantic Segmentation Model,Dynamic Crop,Bounding Box Visualization,Qwen3.5-VL,Clip Comparison,OpenAI,SIFT Comparison,OCR Model,Single-Label Classification Model,Slack Notification,OpenRouter,SIFT Comparison,Pixelate Visualization,Google Vision OCR,Dynamic Zone,Google Gemma,Halo Visualization,Stitch OCR Detections,GLM-OCR,Image Threshold,Stitch Images,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,Single-Label Classification Model,Google Gemini,Single-Label Classification Model,Webhook Sink,Instance Segmentation Model,QR Code Generator,MQTT Writer,Ellipse Visualization,Object Detection Model,Anthropic Claude,Keypoint Detection Model,Dot Visualization,Perspective Correction,Instance Segmentation Model,Roboflow Dataset Upload,PLC ModbusTCP,SIFT,Google Gemini,Dimension Collapse,EasyOCR,Local File Sink,Triangle Visualization,Contrast Equalization,Polygon Visualization,OpenAI,Heatmap Visualization,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Multi-Label Classification Model,Polygon Visualization,Image Stack,Email Notification,Mask Visualization,Anthropic Claude,Identify Changes,PTZ Tracking (ONVIF),Keypoint Visualization,Background Subtraction,Multi-Label Classification Model,Twilio SMS Notification,Email Notification,Semantic Segmentation Model,Image Slicer,Image Contours,Line Counter Visualization,Image Preprocessing,VLM As Classifier,Depth Estimation,Motion Detection,Current Time,Cosine Similarity,Corner Visualization,Polygon Zone Visualization,Camera Calibration,Roboflow Dataset Upload,Grid Visualization,Stability AI Image Generation,S3 Sink,Circle Visualization,Image Slicer,Roboflow Custom Metadata,Relative Static Crop,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Background Color Visualization - outputs:
Halo Visualization,Overlap Analysis,SAM 3 Interactive,Crop Visualization,Icon Visualization,Detections Transformation,Blur Visualization,ByteTrack Tracker,Detections Classes Replacement,Byte Tracker,Track Class Lock,Size Measurement,Mask Edge Snap,Model Comparison Visualization,Path Deviation,Florence-2 Model,Trace Visualization,Ellipse Visualization,BoT-SORT Tracker,Dot Visualization,Perspective Correction,Label Visualization,Florence-2 Model,Per-Class Confidence Filter,Roboflow Dataset Upload,Detections Stabilizer,Detections Merge,Velocity,OC-SORT Tracker,Triangle Visualization,Camera Focus,Time in Zone,Line Counter,SORT Tracker,SAM2 Video Tracker,Polygon Visualization,Heatmap Visualization,Detections Stitch,Detections List Roll-Up,Halo Visualization,Color Visualization,Event Writer,Polygon Visualization,Mask Visualization,Detections Filter,Distance Measurement,Stability AI Inpainting,Bounding Rectangle,PTZ Tracking (ONVIF),Time in Zone,Overlap Filter,Roboflow Vision Events,Mask Area Measurement,Detection Offset,Detections Consensus,Byte Tracker,Dynamic Crop,Path Deviation,Byte Tracker,Bounding Box Visualization,Detections Combine,Roboflow Dataset Upload,Corner Visualization,Segment Anything 2 Model,Circle Visualization,Time in Zone,Roboflow Custom Metadata,Model Monitoring Inference Aggregator,Detection Event Log,Pixelate Visualization,Background Color Visualization,Line Counter,Dynamic Zone
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
SAM 3 in version v2 has.
Bindings
-
input
images(image): The image to infer on..model_id(roboflow_model_id): model version. You only need to change this for fine tuned sam3 models..class_names(Union[string,list_of_values]): List of classes to recognise.confidence(float): Minimum confidence threshold for predicted masks.per_class_confidence(list_of_values): List of confidence thresholds per class (must match class_names length).apply_nms(boolean): Whether to apply Non-Maximum Suppression across prompts.nms_iou_threshold(float): IoU threshold for cross-prompt NMS. Must be in [0.0, 1.0].
-
output
predictions(instance_segmentation_prediction): Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object.
Example JSON definition of step SAM 3 in version v2
{
"name": "<your_step_name_here>",
"type": "roboflow_core/sam3@v2",
"images": "$inputs.image",
"model_id": "sam3/sam3_final",
"class_names": [
"car",
"person"
],
"confidence": 0.3,
"per_class_confidence": [
0.3,
0.5,
0.7
],
"apply_nms": "<block_does_not_provide_example>",
"nms_iou_threshold": 0.5
}
v1¶
Class: SegmentAnything3BlockV1 (there are multiple versions of this block)
Source: inference.core.workflows.core_steps.models.foundation.segment_anything3.v1.SegmentAnything3BlockV1
Warning: This block has multiple versions. Please refer to the specific version for details. You can learn more about how versions work here: Versioning
Run Segment Anything 3, a zero-shot instance segmentation model, on an image.
You can pass in boxes/predictions from other models as prompts, or use a text prompt for open-vocabulary segmentation. If you pass in box detections from another model, the class names of the boxes will be forwarded to the predicted masks.
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/sam3@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
model_id |
str |
model version. You only need to change this for fine tuned sam3 models.. | ✅ |
class_names |
Optional[List[str], str] |
List of classes to recognise. | ✅ |
threshold |
float |
Threshold for predicted mask scores. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Runtime compatibility¶
-
hard— runtimeself_hosted_cpu; executionlocal - Requires a GPU; run_locally() loads a model that needs CUDA.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to SAM 3 in version v1.
- inputs:
Morphological Transformation,Classification Label Visualization,Crop Visualization,Stability AI Outpainting,Blur Visualization,Reference Path Visualization,OpenAI,Anthropic Claude,Camera Focus,Instance Segmentation Model,Size Measurement,Model Comparison Visualization,Florence-2 Model,Trace Visualization,Label Visualization,Image Convert Grayscale,Florence-2 Model,Text Display,Qwen-VL,Llama 3.2 Vision,Image Blur,Keypoint Detection Model,Absolute Static Crop,Gaze Detection,CSV Formatter,Keypoint Detection Model,LMM,Qwen 3.5 API,Qwen 3.6 API,Camera Focus,Multi-Label Classification Model,Clip Comparison,Google Gemma API,Contrast Enhancement,Halo Visualization,Color Visualization,Morphological Transformation,MoonshotAI Kimi,Stitch OCR Detections,Event Writer,Buffer,Stability AI Inpainting,Roboflow Asset Library Attributes,Microsoft SQL Server Sink,OpenAI,Roboflow Vision Events,CogVLM,Object Detection Model,OPC UA Writer Sink,Semantic Segmentation Model,Dynamic Crop,Bounding Box Visualization,Qwen3.5-VL,Clip Comparison,OpenAI,OCR Model,Single-Label Classification Model,Slack Notification,OpenRouter,SIFT Comparison,Pixelate Visualization,Google Vision OCR,Dynamic Zone,Google Gemma,Halo Visualization,Stitch OCR Detections,GLM-OCR,Image Threshold,Stitch Images,Twilio SMS/MMS Notification,Icon Visualization,VLM As Classifier,MoonshotAI Kimi,Single-Label Classification Model,Google Gemini,Single-Label Classification Model,Webhook Sink,Instance Segmentation Model,QR Code Generator,MQTT Writer,Ellipse Visualization,Object Detection Model,Anthropic Claude,Keypoint Detection Model,Dot Visualization,Perspective Correction,Instance Segmentation Model,Roboflow Dataset Upload,PLC ModbusTCP,SIFT,Google Gemini,Dimension Collapse,EasyOCR,Local File Sink,Triangle Visualization,Contrast Equalization,Polygon Visualization,OpenAI,Heatmap Visualization,Detections List Roll-Up,Google Gemini,PLC EthernetIP,LMM For Classification,VLM As Detector,Llama 3.2 Vision,Multi-Label Classification Model,Polygon Visualization,Image Stack,Email Notification,Mask Visualization,Anthropic Claude,Identify Changes,Keypoint Visualization,Background Subtraction,Multi-Label Classification Model,Twilio SMS Notification,Email Notification,Semantic Segmentation Model,Image Slicer,Image Contours,Line Counter Visualization,Image Preprocessing,Depth Estimation,Motion Detection,Current Time,Cosine Similarity,Corner Visualization,Polygon Zone Visualization,Camera Calibration,Roboflow Dataset Upload,Grid Visualization,Stability AI Image Generation,S3 Sink,Circle Visualization,Image Slicer,Roboflow Custom Metadata,Relative Static Crop,Instance Segmentation Model,Model Monitoring Inference Aggregator,OpenAI-Compatible LLM,Object Detection Model,Background Color Visualization - outputs:
Halo Visualization,Overlap Analysis,SAM 3 Interactive,Crop Visualization,Icon Visualization,Detections Transformation,Blur Visualization,ByteTrack Tracker,Detections Classes Replacement,Byte Tracker,Track Class Lock,Size Measurement,Mask Edge Snap,Model Comparison Visualization,Path Deviation,Florence-2 Model,Trace Visualization,Ellipse Visualization,BoT-SORT Tracker,Dot Visualization,Perspective Correction,Label Visualization,Florence-2 Model,Per-Class Confidence Filter,Roboflow Dataset Upload,Detections Stabilizer,Detections Merge,Velocity,OC-SORT Tracker,Triangle Visualization,Camera Focus,Time in Zone,Line Counter,SORT Tracker,SAM2 Video Tracker,Polygon Visualization,Heatmap Visualization,Detections Stitch,Detections List Roll-Up,Halo Visualization,Color Visualization,Event Writer,Polygon Visualization,Mask Visualization,Detections Filter,Distance Measurement,Stability AI Inpainting,Bounding Rectangle,PTZ Tracking (ONVIF),Time in Zone,Overlap Filter,Roboflow Vision Events,Mask Area Measurement,Detection Offset,Detections Consensus,Byte Tracker,Dynamic Crop,Path Deviation,Byte Tracker,Bounding Box Visualization,Detections Combine,Roboflow Dataset Upload,Corner Visualization,Segment Anything 2 Model,Circle Visualization,Time in Zone,Roboflow Custom Metadata,Model Monitoring Inference Aggregator,Detection Event Log,Pixelate Visualization,Background Color Visualization,Line Counter,Dynamic Zone
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
SAM 3 in version v1 has.
Bindings
-
input
images(image): The image to infer on..model_id(roboflow_model_id): model version. You only need to change this for fine tuned sam3 models..class_names(Union[string,list_of_values]): List of classes to recognise.threshold(float): Threshold for predicted mask scores.
-
output
predictions(instance_segmentation_prediction): Prediction with detected bounding boxes and segmentation masks in form of sv.Detections(...) object.
Example JSON definition of step SAM 3 in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/sam3@v1",
"images": "$inputs.image",
"model_id": "sam3/sam3_final",
"class_names": [
"car",
"person"
],
"threshold": 0.3
}