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:
Image Preprocessing,Single-Label Classification Model,Anthropic Claude,Image Slicer,Dynamic Crop,Bounding Box Visualization,Object Detection Model,Absolute Static Crop,SIFT Comparison,Stitch Images,Stitch OCR Detections,OpenAI,Instance Segmentation Model,Email Notification,Stability AI Inpainting,Frame Delay,Cosine Similarity,EasyOCR,Llama 3.2 Vision,Florence-2 Model,Gaze Detection,Roboflow Custom Metadata,Dynamic Zone,Auto Rotate on Edges,Keypoint Detection Model,Stability AI Outpainting,Model Comparison Visualization,Slack Notification,Line Counter Visualization,Camera Calibration,Single-Label Classification Model,Clip Comparison,PLC Reader,VLM As Detector,CogVLM,Camera Focus,Corner Visualization,Ellipse Visualization,PP-OCR,Morphological Transformation,Detections List Roll-Up,Anthropic Claude,Roboflow Visual Search,Color Visualization,Instance Segmentation Model,OpenAI,Triangle Visualization,Detection Event Log,Object Detection Model,Image Contours,Image Threshold,Current Time,Roboflow Visual Search Classifier,QR Code Generator,OpenAI-Compatible LLM,Qwen2.5-VL,Florence-2 Model,Semantic Segmentation Model,SmolVLM2,Polygon Zone Visualization,Stitch OCR Detections,Roboflow Asset Library Attributes,GeoTag Detection,Microsoft SQL Server Sink,VLM As Classifier,Camera Focus,Image Convert Grayscale,Label Visualization,Llama 3.2 Vision,Stability AI Image Generation,VLM As Detector,Instance Segmentation Model,MQTT Writer,Roboflow Dataset Upload,Local File Sink,Identify Outliers,VLM As Classifier,Semantic Segmentation Model,Google Gemini,Event Writer,Depth Estimation,Google Gemini,OpenAI,Trace Visualization,Twilio SMS Notification,PLC EthernetIP,LMM For Classification,Object Detection Model,Webhook Sink,Halo Visualization,Buffer,Mask Visualization,Pixelate Visualization,Twilio SMS/MMS Notification,MoonshotAI Kimi,Dot Visualization,Multi-Label Classification Model,Image Stack,OPC UA Writer Sink,Google Gemini,Keypoint Visualization,Dimension Collapse,LMM,Image Slicer,PTZ Tracking (ONVIF),OCR Model,Circle Visualization,Contrast Enhancement,Relative Static Crop,Morphological Transformation,Email Notification,Halo Visualization,Clip Comparison,Cosmos 3,Polygon Visualization,Qwen-VL,PLC Writer,Google Gemma,Crop Visualization,Qwen 3.5 API,Model Monitoring Inference Aggregator,Qwen3-VL,Qwen3.5,Keypoint Detection Model,Size Measurement,Icon Visualization,Heatmap Visualization,Single-Label Classification Model,Motion Detection,Multi-Label Classification Model,Google Gemma API,Instance Segmentation Model,Detections Consensus,CSV Formatter,Image Blur,Background Color Visualization,Grid Visualization,Blur Visualization,GLM-OCR,Anthropic Claude,Reference Path Visualization,Classification Label Visualization,Google Vision OCR,Perspective Correction,Background Subtraction,Polygon Visualization,Contrast Equalization,SIFT,Qwen 3.6 API,Text Display,JSON Parser,MoonshotAI Kimi,OpenRouter,Qwen3.5-VL,Roboflow Vision Events,Identify Changes,Keypoint Detection Model,OpenAI,SIFT Comparison,PLC ModbusTCP,Multi-Label Classification Model,S3 Sink,Roboflow Dataset Upload - outputs:
Roboflow Dataset Upload,Trace Visualization,SAM 3 Interactive,Time in Zone,Dynamic Crop,Detections Filter,Mask Area Measurement,BoT-SORT Tracker,Bounding Box Visualization,Mask Edge Snap,Velocity,Halo Visualization,Mask Visualization,Path Deviation,Pixelate Visualization,Dot Visualization,Stability AI Inpainting,Frame Delay,Distance Measurement,OC-SORT Tracker,Track Class Lock,Florence-2 Model,Roboflow Custom Metadata,Dynamic Zone,Detections Combine,Detections Transformation,PTZ Tracking (ONVIF),Time in Zone,Byte Tracker,Circle Visualization,Model Comparison Visualization,Detections Classes Replacement,Byte Tracker,SAM2 Video Tracker,ByteTrack Tracker,Per-Class Confidence Filter,Halo Visualization,Polygon Visualization,SORT Tracker,Ellipse Visualization,Corner Visualization,Camera Focus,Crop Visualization,Model Monitoring Inference Aggregator,Detections List Roll-Up,Size Measurement,Heatmap Visualization,Icon Visualization,Color Visualization,Detections Consensus,Overlap Analysis,Triangle Visualization,Time in Zone,Background Color Visualization,Detection Event Log,Detections Stitch,Segment Anything 2 Model,Detections Stabilizer,Blur Visualization,Detections Merge,Florence-2 Model,Path Deviation,GeoTag Detection,Perspective Correction,Polygon Visualization,Label Visualization,Detection Offset,Line Counter,Roboflow Dataset Upload,Roboflow Vision Events,Bounding Rectangle,Overlap Filter,Event Writer,Line Counter,Byte Tracker
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:
Image Preprocessing,Single-Label Classification Model,Anthropic Claude,Image Slicer,Dynamic Crop,Bounding Box Visualization,Object Detection Model,Absolute Static Crop,SIFT Comparison,Stitch Images,Stitch OCR Detections,OpenAI,Instance Segmentation Model,Email Notification,Stability AI Inpainting,Frame Delay,Cosine Similarity,EasyOCR,Llama 3.2 Vision,Florence-2 Model,Gaze Detection,Roboflow Custom Metadata,Dynamic Zone,Auto Rotate on Edges,Keypoint Detection Model,Stability AI Outpainting,Model Comparison Visualization,Slack Notification,Line Counter Visualization,Camera Calibration,Single-Label Classification Model,Clip Comparison,PLC Reader,VLM As Detector,CogVLM,Camera Focus,Corner Visualization,Ellipse Visualization,PP-OCR,Morphological Transformation,Detections List Roll-Up,Anthropic Claude,Roboflow Visual Search,Color Visualization,Instance Segmentation Model,OpenAI,Triangle Visualization,Object Detection Model,Image Contours,Image Threshold,Current Time,Roboflow Visual Search Classifier,QR Code Generator,OpenAI-Compatible LLM,Florence-2 Model,Semantic Segmentation Model,Polygon Zone Visualization,Stitch OCR Detections,Roboflow Asset Library Attributes,GeoTag Detection,Microsoft SQL Server Sink,VLM As Classifier,Camera Focus,Image Convert Grayscale,Label Visualization,Llama 3.2 Vision,Stability AI Image Generation,VLM As Detector,Instance Segmentation Model,MQTT Writer,Roboflow Dataset Upload,Local File Sink,Identify Outliers,VLM As Classifier,Semantic Segmentation Model,Google Gemini,Event Writer,Depth Estimation,Google Gemini,OpenAI,Trace Visualization,Twilio SMS Notification,PLC EthernetIP,LMM For Classification,Object Detection Model,Webhook Sink,Halo Visualization,Buffer,Mask Visualization,Pixelate Visualization,Twilio SMS/MMS Notification,MoonshotAI Kimi,Dot Visualization,Multi-Label Classification Model,Image Stack,OPC UA Writer Sink,Google Gemini,Keypoint Visualization,Dimension Collapse,LMM,Image Slicer,PTZ Tracking (ONVIF),OCR Model,Circle Visualization,Contrast Enhancement,Relative Static Crop,Morphological Transformation,Email Notification,Halo Visualization,Clip Comparison,Cosmos 3,Polygon Visualization,Qwen-VL,PLC Writer,Google Gemma,Crop Visualization,Qwen 3.5 API,Model Monitoring Inference Aggregator,Keypoint Detection Model,Size Measurement,Icon Visualization,Heatmap Visualization,Single-Label Classification Model,Motion Detection,Multi-Label Classification Model,Google Gemma API,Instance Segmentation Model,Detections Consensus,CSV Formatter,Image Blur,Background Color Visualization,Grid Visualization,Blur Visualization,GLM-OCR,Anthropic Claude,Reference Path Visualization,Classification Label Visualization,Google Vision OCR,Perspective Correction,Background Subtraction,Polygon Visualization,Contrast Equalization,SIFT,Qwen 3.6 API,Text Display,JSON Parser,MoonshotAI Kimi,OpenRouter,Qwen3.5-VL,Roboflow Vision Events,Identify Changes,Keypoint Detection Model,OpenAI,SIFT Comparison,PLC ModbusTCP,Multi-Label Classification Model,S3 Sink,Roboflow Dataset Upload - outputs:
Roboflow Dataset Upload,Trace Visualization,SAM 3 Interactive,Time in Zone,Dynamic Crop,Detections Filter,Mask Area Measurement,BoT-SORT Tracker,Bounding Box Visualization,Mask Edge Snap,Velocity,Halo Visualization,Mask Visualization,Path Deviation,Pixelate Visualization,Dot Visualization,Stability AI Inpainting,Frame Delay,Distance Measurement,OC-SORT Tracker,Track Class Lock,Florence-2 Model,Roboflow Custom Metadata,Dynamic Zone,Detections Combine,Detections Transformation,PTZ Tracking (ONVIF),Time in Zone,Byte Tracker,Circle Visualization,Model Comparison Visualization,Detections Classes Replacement,Byte Tracker,SAM2 Video Tracker,ByteTrack Tracker,Per-Class Confidence Filter,Halo Visualization,Polygon Visualization,SORT Tracker,Ellipse Visualization,Corner Visualization,Camera Focus,Crop Visualization,Model Monitoring Inference Aggregator,Detections List Roll-Up,Size Measurement,Icon Visualization,Heatmap Visualization,Color Visualization,Detections Consensus,Overlap Analysis,Time in Zone,Detection Event Log,Detections Stitch,Background Color Visualization,Segment Anything 2 Model,Triangle Visualization,Detections Stabilizer,Blur Visualization,Detections Merge,Florence-2 Model,Path Deviation,GeoTag Detection,Perspective Correction,Polygon Visualization,Label Visualization,Detection Offset,Line Counter,Roboflow Dataset Upload,Roboflow Vision Events,Bounding Rectangle,Overlap Filter,Event Writer,Line Counter,Byte Tracker
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:
Image Preprocessing,Single-Label Classification Model,Anthropic Claude,Image Slicer,Dynamic Crop,Bounding Box Visualization,Object Detection Model,Absolute Static Crop,SIFT Comparison,Stitch Images,Stitch OCR Detections,OpenAI,Instance Segmentation Model,Email Notification,Stability AI Inpainting,Cosine Similarity,EasyOCR,Llama 3.2 Vision,Florence-2 Model,Gaze Detection,Roboflow Custom Metadata,Dynamic Zone,Auto Rotate on Edges,Keypoint Detection Model,Stability AI Outpainting,Model Comparison Visualization,Slack Notification,Line Counter Visualization,Camera Calibration,Single-Label Classification Model,Clip Comparison,VLM As Detector,CogVLM,Camera Focus,Corner Visualization,Ellipse Visualization,PP-OCR,Morphological Transformation,Detections List Roll-Up,Anthropic Claude,Roboflow Visual Search,Color Visualization,Instance Segmentation Model,OpenAI,Triangle Visualization,Object Detection Model,Image Contours,Image Threshold,Current Time,Roboflow Visual Search Classifier,QR Code Generator,OpenAI-Compatible LLM,Florence-2 Model,Semantic Segmentation Model,Polygon Zone Visualization,Stitch OCR Detections,Roboflow Asset Library Attributes,GeoTag Detection,Microsoft SQL Server Sink,VLM As Classifier,Camera Focus,Image Convert Grayscale,Label Visualization,Llama 3.2 Vision,Stability AI Image Generation,Instance Segmentation Model,MQTT Writer,Roboflow Dataset Upload,Local File Sink,Semantic Segmentation Model,Google Gemini,Event Writer,Depth Estimation,Google Gemini,OpenAI,Trace Visualization,Twilio SMS Notification,PLC EthernetIP,LMM For Classification,Object Detection Model,Webhook Sink,Halo Visualization,Buffer,Mask Visualization,Pixelate Visualization,Twilio SMS/MMS Notification,MoonshotAI Kimi,Dot Visualization,Multi-Label Classification Model,Image Stack,OPC UA Writer Sink,Google Gemini,Keypoint Visualization,Dimension Collapse,LMM,Image Slicer,OCR Model,Circle Visualization,Contrast Enhancement,Relative Static Crop,Morphological Transformation,Email Notification,Halo Visualization,Clip Comparison,Cosmos 3,Polygon Visualization,Qwen-VL,PLC Writer,Google Gemma,Crop Visualization,Qwen 3.5 API,Model Monitoring Inference Aggregator,Keypoint Detection Model,Size Measurement,Icon Visualization,Heatmap Visualization,Single-Label Classification Model,Motion Detection,Multi-Label Classification Model,Google Gemma API,Instance Segmentation Model,CSV Formatter,Image Blur,Background Color Visualization,Grid Visualization,Blur Visualization,GLM-OCR,Anthropic Claude,Reference Path Visualization,Classification Label Visualization,Google Vision OCR,Perspective Correction,Background Subtraction,Polygon Visualization,Contrast Equalization,SIFT,Qwen 3.6 API,Text Display,MoonshotAI Kimi,OpenRouter,Qwen3.5-VL,Roboflow Vision Events,Identify Changes,Keypoint Detection Model,OpenAI,PLC ModbusTCP,Multi-Label Classification Model,S3 Sink,Roboflow Dataset Upload - outputs:
Roboflow Dataset Upload,Trace Visualization,SAM 3 Interactive,Time in Zone,Dynamic Crop,Detections Filter,Mask Area Measurement,BoT-SORT Tracker,Bounding Box Visualization,Mask Edge Snap,Velocity,Halo Visualization,Mask Visualization,Path Deviation,Pixelate Visualization,Dot Visualization,Stability AI Inpainting,Frame Delay,Distance Measurement,OC-SORT Tracker,Track Class Lock,Florence-2 Model,Roboflow Custom Metadata,Dynamic Zone,Detections Combine,Detections Transformation,PTZ Tracking (ONVIF),Time in Zone,Byte Tracker,Circle Visualization,Model Comparison Visualization,Detections Classes Replacement,Byte Tracker,SAM2 Video Tracker,ByteTrack Tracker,Per-Class Confidence Filter,Halo Visualization,Polygon Visualization,SORT Tracker,Ellipse Visualization,Corner Visualization,Camera Focus,Crop Visualization,Model Monitoring Inference Aggregator,Detections List Roll-Up,Size Measurement,Icon Visualization,Heatmap Visualization,Color Visualization,Detections Consensus,Overlap Analysis,Time in Zone,Detection Event Log,Detections Stitch,Background Color Visualization,Segment Anything 2 Model,Triangle Visualization,Detections Stabilizer,Blur Visualization,Detections Merge,Florence-2 Model,Path Deviation,GeoTag Detection,Perspective Correction,Polygon Visualization,Label Visualization,Detection Offset,Line Counter,Roboflow Dataset Upload,Roboflow Vision Events,Bounding Rectangle,Overlap Filter,Event Writer,Line Counter,Byte Tracker
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
}