Skip to content

SAM 3 Interactive

Class: SegmentAnything3InteractiveBlockV1

Source: inference.core.workflows.core_steps.models.foundation.segment_anything3_interactive.v1.SegmentAnything3InteractiveBlockV1

Run the interactive (promptable visual segmentation) head of Segment Anything 3 (SAM3) on an image.

Unlike the SAM 3 concept segmentation block (which takes text or exemplar prompts and returns ALL instances of a concept), this block performs SAM2-style interactive segmentation: each prompt targets ONE object and the model returns a single mask for it.

Two prompt inputs are supported (at least one must be provided): - points: a list of labeled 2D points defining a single object. Positive points mark the object to segment, negative points mark regions to exclude (useful to refine the mask). - boxes: detections from another model. Each bounding box becomes a separate prompt and the model segments the object inside it. Class names of the boxes are forwarded to the predicted masks.

Type identifier

Use the following identifier in step "type" field: roboflow_core/sam3_interactive@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str Enter a unique identifier for this step..
points List[Any] Labeled points defining a single object to segment. Each point is {'x': ..., 'y': ..., 'positive': ...} in absolute pixel coordinates - positive points mark the object, negative points mark regions to exclude. Plain (x, y) or (x, y, positive) sequences are also accepted..
threshold float Minimum confidence threshold for predicted masks.
multimask_output bool Flag to determine whether to use SAM3 internal multimask or single mask mode. For ambiguous prompts (like a single point) setting to True is recommended..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Runtime compatibility

hard — runtime self_hosted_cpu; execution local
Requires a GPU; run_locally() loads a model that needs CUDA.

Available Connections

Compatible Blocks

Check what blocks you can connect to SAM 3 Interactive in version v1.

Input and Output Bindings

The available connections depend on its binding kinds. Check what binding kinds SAM 3 Interactive in version v1 has.

Bindings
  • input

    • images (image): The image to infer on..
    • points (labeled_points): Labeled points defining a single object to segment. Each point is {'x': ..., 'y': ..., 'positive': ...} in absolute pixel coordinates - positive points mark the object, negative points mark regions to exclude. Plain (x, y) or (x, y, positive) sequences are also accepted..
    • boxes (Union[instance_segmentation_prediction, keypoint_detection_prediction, object_detection_prediction]): Bounding boxes (from another model) to use as prompts - the model segments the object inside each box.
    • threshold (float): Minimum confidence threshold for predicted masks.
    • multimask_output (boolean): Flag to determine whether to use SAM3 internal multimask or single mask mode. For ambiguous prompts (like a single point) setting to True is recommended..
  • output

Example JSON definition of step SAM 3 Interactive in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/sam3_interactive@v1",
    "images": "$inputs.image",
    "points": [
        {
            "positive": true,
            "x": 320,
            "y": 240
        }
    ],
    "boxes": "$steps.object_detection_model.predictions",
    "threshold": 0.3,
    "multimask_output": true
}