imagestringwajib
URL of the image to be segmented
meta/sam-3/imageSAM 3 Image is Meta's segmentation model. It finds objects in an image from a text, point, or box prompt and returns masks and the masked image, with optional confidence scores.
Coba model ini
PNG, JPEG, WebP, atau GIF · maksimum 20 MiB
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
SAM 3 segments objects in an image from a text, point, or box prompt and returns masks.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | wheel | What to segment, e.g. “the red car”. |
image | image URL, required | — | Image to segment. JPEG, PNG, or WebP URL. |
output_format | jpeg / png | png | Output file format. |
box_prompts | item[] | [] | Optional boxes. |
text_prompt | string | — | [DEPRECATED] Use 'prompt' instead. |
include_scores | boolean | false | Whether to include mask confidence scores. |
apply_mask | boolean | true | Return the masked image. |
point_prompts | item[] | [] | Optional points. |
return_multiple_masks | boolean | false | If True, upload and return multiple generated masks as defined by max_masks. |
max_masks | integer 1–32 | 3 | Maximum masks to return. |
include_boxes | boolean | false | Whether to include bounding boxes for each mask (when available). |
$0.005 per image.
| Request | Price |
|---|---|
| One image | $0.005 |
Failed runs are not charged.
Related: meta/sam-3/3d-objects.
Mulai membangun
Kirim model ini melalui SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "meta/sam-3/image",
"image": "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg",
"prompt": "wheel",
"max_masks": 3,
"apply_mask": true,
"box_prompts": [],
"include_boxes": false,
"output_format": "png",
"point_prompts": [],
"include_scores": false,
"return_multiple_masks": false
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Buat SandBase API key dan atur di environment server Anda. Semua permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key di server. Jangan tampilkan di kode browser atau commit ke repository.
POST ke /v1/run dengan ID model ini dan inputnya. Contoh permintaan di atas mencakup pengiriman dan polling.
Gunakan run ID yang dikembalikan untuk polling sampai status completed, failed, atau timeout. Baca output hanya setelah completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Kirim URL file yang dapat diakses publik di field image, video, atau audio model. Format dan batas yang didukung ditampilkan di samping setiap input Playground.
Gunakan kontrol upload atau replace pada field gambar yang didukung di Playground. Field URL video menerima video driving yang di-host; ini tidak berarti dukungan upload video.
imagestringwajibURL of the image to be segmented
promptstringwajibText prompt for segmentation
Default: "wheel"
max_masksintegerMaximum number of masks to return when `return_multiple_masks` is enabled.
Default: 3
Minimum: 1
Maksimum: 32
apply_maskbooleanApply the mask on the image.
Default: true
box_promptsarrayBox 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.
Default: []
text_promptstring[DEPRECATED] Use 'prompt' instead. Kept for backward compatibility.
include_boxesbooleanWhether to include bounding boxes for each mask (when available).
Default: false
output_formatstringThe format of the generated image.
Default: "png"
Nilai yang mungkin: "jpeg", "png"
point_promptsarrayList of point prompts
Default: []
include_scoresbooleanWhether to include mask confidence scores.
Default: false
return_multiple_masksbooleanIf True, upload and return multiple generated masks as defined by `max_masks`.
Default: false
{
"model": "meta/sam-3/image",
"image": "https://raw.githubusercontent.com/facebookresearch/segment-anything-2/main/notebooks/images/truck.jpg",
"prompt": "wheel",
"max_masks": 3,
"apply_mask": true,
"box_prompts": [],
"include_boxes": false,
"output_format": "png",
"point_prompts": [],
"include_scores": false,
"return_multiple_masks": false
}Run yang selesai menampilkan hasilnya di output. Berikut adalah contoh tersimpan model ini, bukan generasi baru.
Belum ada contoh output yang dipublikasikan. Gunakan Playground → Result → JSON setelah run selesai untuk melihat respons Anda.