Op den Inhalt sprangen

Segment Anything Model 3

Integréieren

Modell-ID sam-3/image
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/sam-3/image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Dës Ufro: ≈0,005 $ 5 API-Kreditter · ≈ 0,53 ₽ Op dëser Säit ausféieren

API-Schlëssel kréien
Meta Bildbearbechtung #segmentation#mask#real-time

Bildsegmentéierung mat Text-, Punkt- oder Box-Prompten, déi Maskebiller mat optionalen Scores a Boxe zeréckgëtt

Meta · Bild

Äin éischt Resultat kënnt hei hin

Baut hei drënner eng Ufro a féiert se mat Ärem API-Schlëssel aus. Output gëtt an eis Späicherung kopéiert, fir ëmmer oder 7 Deeg gratis gespäichert.

Eng Ufro erstellen

D'Kontrolle ginn aus dem Modellschema generéiert. De Code an de Präis aktualiséiere sech, wann s du se ännerst.

Standard wheel

Textinstruktioun, déi d'Segmentéierung steiert.

•obligatoresch image_url
Fichier erofzéien, oder

URL vum Bild fir d'Segmentéierung.

Erweidert text_prompt · output_format · max_masks · apply_mask · return_multiple_masks · include_scores · include_boxes · point_prompts · box_prompts

[DEPRECATED] Legacy-Input fir Réckkompatibilitéit behalen; benotzt amplaz 'prompt'.

output_format Standard png

Dateiformat vum resultéierende Bild.

Standard 3

Uewergrenz fir zréckginn Masken, wann `return_multiple_masks` aktivéiert ass.

Standard []

Sammlung vu punktbaséierte Prompts.

Standard []

Box-Prompts, deenen hiren object_id d'Gruppéierung bestëmmt: Iwwerstëmmend IDs verknëppen d'Boxe mat engem Objet, wärend eidel IDs separat Objeter representéieren. Méi Boxe kënnen ugi ginn, all mat Koordinaten (x_min, y_min, x_max, y_max).

POST /run/sam-3/image?wait=20 Präis → 0,005 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/sam-3/image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Dës Ufro ausféieren

Äre Schlëssel bleift an dësem Browser: e gëtt nëmmen un d'Doitong API geschéckt an nëmme gespäichert (localStorage), wann s du „Erënneren“ aktivéiers. En API-Schlëssel kréien

Iwwer Segment Anything Model 3

Segmentéiert e Bild mat SAM 3 mat engem Text-`prompt`, `point_prompts` oder `box_prompts`. Mat aktivéiertem `return_multiple_masks` ginn bis zu `max_masks` Masken zeréckginn (1 bis 32). Optional Confidence-Scores a Bounding-Boxe kënnen abegraff ginn. D'Outputformat ass jpeg, png oder webp.

Parameteren

Schéck entweder den kanoneschen Numm oder den natierlechen Numm, net béid. Kanonesch Nimm

NummTyp StandardErlaabt Beschreiwung
image_urlobligatoresch image
Typurl · image
URL vum Bild fir d'Segmentéierung.
promptoptional
Typstring
Standardwheel
Textinstruktioun, déi d'Segmentéierung steiert.
text_promptoptional
Typstring | null
[DEPRECATED] Legacy-Input fir Réckkompatibilitéit behalen; benotzt amplaz 'prompt'.
point_promptsoptional
Typobject[]
Standard[]
Sammlung vu punktbaséierte Prompts.
point_prompts[].xoptional
Typinteger | null
Prompt-Positioun op der X-Achs.
point_prompts[].yoptional
Typinteger | null
Prompt-Positioun op der Y-Achs.
point_prompts[].labeloptional
Typenum
01
Label fir Virder- oder Hannergrond: 1 bedeit Virdergrond; 0 bedeit Hannergrond.
point_prompts[].object_idoptional
Typinteger | null
Optionalen Identifikator, deen Prompts gruppéiert, déi een eenzegen Objet verfeineren. Wann och Text als Prompt geliwwert gëtt, bestëmmt dësen Identifikator, wéi en detektéierten Objet dës Punkten verfeineren.
point_prompts[].frame_indexoptional
Typinteger | null
Index, deen de Frame fir d'Interaktioun identifizéiert.
box_promptsoptional
Typobject[]
Standard[]
Box-Prompts, deenen hiren object_id d'Gruppéierung bestëmmt: Iwwerstëmmend IDs verknëppen d'Boxe mat engem Objet, wärend eidel IDs separat Objeter representéieren. Méi Boxe kënnen ugi ginn, all mat Koordinaten (x_min, y_min, x_max, y_max).
box_prompts[].x_minoptional
Typinteger | null
Minimum-x-Koordinate vun der Këscht.
box_prompts[].y_minoptional
Typinteger | null
Minimum-y-Koordinate vun der Këscht.
box_prompts[].x_maxoptional
Typinteger | null
Maximal X-Koordinat vun der Box.
box_prompts[].y_maxoptional
Typinteger | null
Maximal Y-Koordinat vun der Box.
box_prompts[].object_idoptional
Typinteger | null
Optionalen Identifikator, deen Boxe gruppéiert, déi een eenzegen Objet verfeineren.
box_prompts[].frame_indexoptional
Typinteger | null
Index, deen de Frame fir d'Interaktioun identifizéiert.
apply_maskoptional
Typboolean
Standardtrue
Steiert, ob d'Bild mat der Mask applizéiert gëtt.
output_formatoptional
Typenum
Standardpng
jpegpngwebp
Dateiformat vum resultéierende Bild.
return_multiple_masksoptional
Typboolean
Standardfalse
Optioun fir méi Masken zréckzeginn: wann aktivéiert, bestëmmt `max_masks`, wéi vill generéiert Masken eropgeluede ginn an an d'Äntwert agebonne ginn.
max_masksoptional
Typinteger
Standard3
1 – 32
Uewergrenz fir zréckginn Masken, wann `return_multiple_masks` aktivéiert ass.
include_scoresoptional
Typboolean
Standardfalse
Steiert, ob Confidence-Scores fir d'Masken abegraff ginn.
include_boxesoptional
Typboolean
Standardfalse
Steiert, ob fir all Mask eng Bounding Box abegraff gëtt, wa verfügbar.
obligatoresch Kanoneschen Numm, och akzeptéiert

Fichierparameter akzeptéieren eng ëffentlech https:// URL, eng data: URI bis zu 10 MB oder de file_url vun engem Upload. Fichieren

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-3/image",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 5,
    "usd": "0.005",
    "charged": 5,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "image": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768
    },
    "masks": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "metadata": [
      {
        "index": 1,
        "score": 1.0,
        "box": [
          1.0
        ]
      }
    ],
    "scores": [
      1.0
    ],
    "boxes": [
      [
        1.0
      ]
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Är Fichieren, Är WielAll outputs[].url ass eng Kopie an eiser Späicherung: fir ëmmer gespäichert (bezuelbar pro GB-Mount) oder 7 Deeg gratis, jee no Ärer Kontastellung oder ?storage=.
D'selwecht Struktur bei all Modelltype, url, content_type, width, height an duration, fir Biller, Video an Audio gläichermoossen. output ass dem Modell säin eegent Resultatobjet.
Output-Felder
image
object {url, content_type, file_name, file_size, width, height} | nullVirschau mat der primärer Segmentéierungsmaske.
masks
array of object {url, content_type, file_name, file_size, width, height}Biller mat Segmentéierungsmasken.
metadata
array of object {index, score, box} | nullMetadate fir all Mask, inklusiv hirem Score a Box.
scores
array of number | nullConfidence-Score fir all Mask, wann ugefrot.
boxes
array of array of number | nullNormaliséiert Boxe fir all Mask, ausgedréckt als [cx, cy, w, h], wann ugefrot.

Méi Modeller: Bildbearbechtung

Fir AI-Agenten: dës Säit als Markdown ass ënner https://doitong.com/lb/developers/models/sam-3/image.md. All Modeller a Guiden: https://doitong.com/developers/llms.txt