コンテンツへスキップ

Sam 3 · Image RLE

統合

モデルID sam-3/image-rle
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-3/image-rle?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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

このリクエスト: ≈$0.005 5 APIクレジット このページで実行

APIキーを取得
Meta 画像編集 #segmentation#rle#real-time

マスクを画像ではなくランレングス符号化データとして返す画像セグメンテーション

Meta · データ (JSON)

最初の結果がここに表示されます

以下でリクエストを作成し、APIキーで実行してください。出力はストレージにコピーされ、永久保存または無料で7日保存されます。

リクエストを作成

コントロールはモデルスキーマから生成されます。値を変更するとコードと価格が更新されます。

デフォルト wheel

セグメンテーションを誘導するテキスト指示。

•必須 image_url
ファイルをドロップ、または

セグメンテーション対象の画像を指すURL。

詳細設定 text_prompt · output_format · max_masks · apply_mask · return_multiple_masks · include_scores · include_boxes · point_prompts · box_prompts

[DEPRECATED] 後方互換性のために残されている従来の入力。代わりに 'prompt' を使用してください。

output_format デフォルト png

結果の画像のファイル形式。

デフォルト 3

`return_multiple_masks` が有効な場合に返すマスク数の上限。

デフォルト []

点ベースのプロンプトのコレクション。

デフォルト []

object_idでグループ化を決めるボックスプロンプト。一致するIDはボックスを1つのオブジェクトに関連付け、空のIDは別々のオブジェクトを表します。複数のボックスを指定でき、それぞれに座標 (x_min, y_min, x_max, y_max) を使用します。

POST /run/sam-3/image-rle?wait=20 見積もり → $0.005
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-3/image-rle?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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

このリクエストを実行

キーはこのブラウザ内に保持されます。Doitong APIにのみ送信され、「記憶する」にチェックを入れた場合のみlocalStorageに保存されます。 APIキーを取得

Sam 3 · Image RLEについて

テキスト `prompt`、ポイント、ボックスを使って画像に SAM 3 のセグメンテーションを実行し、マスクをランレングス符号化(RLE)データとして返します。後処理用にコンパクトなマスクデータが必要な場合に便利です。`max_masks` を 1 から 32 に設定した `return_multiple_masks` に対応し、スコアとボックスも任意で取得できます。

パラメータ

正式名称またはネイティブ名のいずれか一方を送信してください。両方は送信しないでください。 正式名称

名前型 デフォルト許可される値 説明
image_url必須 image
型url · image
セグメンテーション対象の画像を指すURL。
prompt任意
型string
デフォルトwheel
セグメンテーションを誘導するテキスト指示。
text_prompt任意
型string | null
[DEPRECATED] 後方互換性のために残されている従来の入力。代わりに 'prompt' を使用してください。
point_prompts任意
型object[]
デフォルト[]
点ベースのプロンプトのコレクション。
point_prompts[].x任意
型integer | null
X軸上のプロンプト位置。
point_prompts[].y任意
型integer | null
Y軸上のプロンプト位置。
point_prompts[].label任意
型enum
01
前景または背景のラベル。1は前景、0は背景を示します。
point_prompts[].object_id任意
型integer | null
単一オブジェクトを改良するプロンプトをグループ化する任意の識別子。テキストもプロンプトとして指定した場合、この識別子により、点が改良する検出オブジェクトを決定します。
point_prompts[].frame_index任意
型integer | null
インタラクション対象のフレームを識別するインデックス。
box_prompts任意
型object[]
デフォルト[]
object_idでグループ化を決めるボックスプロンプト。一致するIDはボックスを1つのオブジェクトに関連付け、空のIDは別々のオブジェクトを表します。複数のボックスを指定でき、それぞれに座標 (x_min, y_min, x_max, y_max) を使用します。
box_prompts[].x_min任意
型integer | null
ボックスの最小 x 座標。
box_prompts[].y_min任意
型integer | null
ボックスの最小 y 座標。
box_prompts[].x_max任意
型integer | null
ボックスの最大X座標。
box_prompts[].y_max任意
型integer | null
ボックスの最大Y座標。
box_prompts[].object_id任意
型integer | null
単一オブジェクトを改良するボックスをグループ化する任意の識別子。
box_prompts[].frame_index任意
型integer | null
インタラクション対象のフレームを識別するインデックス。
apply_mask任意
型boolean
デフォルトtrue
画像にマスクを適用するかどうかを制御します。
output_format任意
型enum
デフォルトpng
jpegpngwebp
結果の画像のファイル形式。
return_multiple_masks任意
型boolean
デフォルトfalse
複数マスクの返却オプション。有効にすると、`max_masks` でアップロードしてレスポンスに含める生成マスク数を決定します。
max_masks任意
型integer
デフォルト3
1 – 32
`return_multiple_masks` が有効な場合に返すマスク数の上限。
include_scores任意
型boolean
デフォルトfalse
マスクの信頼度スコアを含めるかどうかを制御します。
include_boxes任意
型boolean
デフォルトfalse
利用可能な場合、各マスクのバウンディングボックスを含めるかどうかを制御します。
必須 正式名称(こちらも使用可能)

ファイルパラメータには、公開されたhttps:// URL、10 MBまでのdata: URI、またはアップロードしたファイルのfile_urlを指定します。 ファイル

出力

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-3/image-rle",
  "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": {
    "rle": "string",
    "boundingbox_frames_zip": {
      "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
    },
    "metadata": [
      {
        "index": 1,
        "score": 1.0,
        "box": [
          1.0
        ]
      }
    ],
    "scores": [
      1.0
    ],
    "boxes": [
      [
        1.0
      ]
    ]
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
ファイルの保存期間を選択すべてのoutputs[].urlはストレージ上のコピーです。アカウント設定または?storage=により、永久保存(GB・月単位で有料)または無料で7日保存できます。
すべてのモデルで同じ形式画像、動画、音声のいずれでも、type、url、content_type、width、height、durationが含まれます。outputはモデル独自の結果オブジェクトです。
出力フィールド
rle
string | array of stringランレングス符号化で表されたマスク。
boundingbox_frames_zip
object {url, content_type, file_name, file_size} | null各フレームのバウンディングボックスオーバーレイを含むZIPアーカイブ。
metadata
array of object {index, score, box} | nullレスポンスに複数のRLEが含まれる場合の各マスクのメタデータ。
scores
array of number | null要求時に提供される各マスクの信頼度スコア。
boxes
array of array of number | null要求時に、[cx, cy, w, h] として表される各マスクの正規化ボックス。

その他のモデル: 画像編集

AIエージェント向け:このページのMarkdown版はこちらです: https://doitong.com/ja/developers/models/sam-3/image-rle.md. すべてのモデルとガイド: https://doitong.com/developers/llms.txt