imagestringआवश्यक
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.
model को आज़माएँ
PNG, JPEG, WebP, या GIF · अधिकतम 20 MiB
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर 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.
बिल्डिंग शुरू करें
इस model को 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"एक SandBase API key बनाएँ और इसे अपने server environment में सेट करें। सभी requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"Key को सर्वर पर रखें। इसे browser code में expose न करें या repository में commit न करें।
इस model ID और इसके inputs के साथ /v1/run पर POST करें। ऊपर दिया गया request example submission और polling दोनों शामिल करता है।
Completed, failed या timeout होने तक poll करने के लिए लौटाए गए run ID का उपयोग करें। Output केवल completed होने के बाद पढ़ें।
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Model के image, video या audio field में सार्वजनिक रूप से उपलब्ध फ़ाइल URL पास करें। समर्थित formats और limits प्रत्येक Playground input के पास दिखाए गए हैं।
Playground में समर्थित image fields पर upload या replace control का उपयोग करें। Video URL fields hosted driving video स्वीकार करते हैं; इससे video-upload support का संकेत नहीं मिलता।
imagestringआवश्यकURL of the image to be segmented
promptstringआवश्यकText prompt for segmentation
डिफ़ॉल्ट: "wheel"
max_masksintegerMaximum number of masks to return when `return_multiple_masks` is enabled.
डिफ़ॉल्ट: 3
न्यूनतम: 1
अधिकतम: 32
apply_maskbooleanApply the mask on the image.
डिफ़ॉल्ट: 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.
डिफ़ॉल्ट: []
text_promptstring[DEPRECATED] Use 'prompt' instead. Kept for backward compatibility.
include_boxesbooleanWhether to include bounding boxes for each mask (when available).
डिफ़ॉल्ट: false
output_formatstringThe format of the generated image.
डिफ़ॉल्ट: "png"
संभावित मान: "jpeg", "png"
point_promptsarrayList of point prompts
डिफ़ॉल्ट: []
include_scoresbooleanWhether to include mask confidence scores.
डिफ़ॉल्ट: false
return_multiple_masksbooleanIf True, upload and return multiple generated masks as defined by `max_masks`.
डिफ़ॉल्ट: 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 अपना परिणाम output में दिखाता है। नीचे दिया गया model का सेव किया हुआ example है, नई generation नहीं।
अभी तक कोई example output प्रकाशित नहीं किया गया है। अपना response देखने के लिए completed run के बाद Playground → Result → JSON का उपयोग करें।