Runflow
Back to Gallery

meta/sam-3/image

SAM 3 is a unified foundation model for promptable segmentation in images and videos.

$0.005/image 2026-04-05

Install

pip install requests

Run the model

import requests

response = requests.post(
    "https://api.runflow.io/v1/run/sam-3/image",
    headers={"Authorization": "Bearer RUNFLOW_API_KEY"},
    json={
    "prompt": "keyboard",
    "image_url": "https://v3b.fal.media/files/b/0a92a995/fV5oYdcCV3NAmgWJISpIP_tmpdddcks4v.png",
    "apply_mask": false,
    "return_multiple_masks": true
    },
)

data = response.json()
print(data["image"]["url"])

Input schema

ParameterTypeDescription
promptstringText prompt for segmentation
include_boxesbooleanWhether to include bounding boxes for each mask (when available).
include_scoresbooleanWhether to include mask confidence scores.
return_multiple_masksbooleanIf True, upload and return multiple generated masks as defined by `max_masks`.
image_urlimageURL of the image to be segmented
sync_modebooleanIf True, the media will be returned as a data URI.
point_promptsstringList of point prompts
output_formatstringThe format of the generated image.
max_masksintegerMaximum number of masks to return when `return_multiple_masks` is enabled.
box_promptsstringBox prompt coordinates (x_min, y_min, x_max, y_max). Multiple boxes supported - use object_id to group boxes for the same object or leave empty for separate objects.
apply_maskbooleanApply the mask on the image.
text_promptstring[DEPRECATED] Use 'prompt' instead. Kept for backward compatibility.

Output schema

FieldTypeDescription
imagestringPrimary segmented mask preview.
metadatastringPer-mask metadata including scores and boxes.
masksjsonSegmented mask images.
scoresstringPer-mask confidence scores when requested.
boxesstringPer-mask normalized bounding boxes [cx, cy, w, h] when requested.

Related models

Start generating with SAM 3

Get API access in minutes. No GPU setup, no infrastructure to manage.