Model API'si
SAM 3.1 Image
SAM 3.1 ile görseldeki nesneleri seçip maske çıkar.
Model kimliği
sam-3-1/imageÇalıştır
Girdiye ücret teklifi al, bu teklifle üretimi başlat, ardından işin durumunu sorgula. Önce RAYWAKE_API_KEY değişkenini ayarla; ayrıntılar için Kimlik doğrulama sayfasına bak.
# 1. Price the exact input (quotes are valid for up to 10 minutes)
curl -s https://api.raywake.com/v1/quotes \
-H "Authorization: Bearer $RAYWAKE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sam-3-1/image",
"input": {
"image_url": "https://example.com/input.png",
"prompt": "A red ceramic cup on a wooden table, soft morning light"
}
}'
# 2. Start the generation with the quote_id from step 1
curl -s https://api.raywake.com/v1/generate \
-H "Authorization: Bearer $RAYWAKE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"model": "sam-3-1/image", "quote_id": "QUOTE_ID", "input": {"image_url":"https://example.com/input.png","prompt":"A red ceramic cup on a wooden table, soft morning light"}}'
# 3. Poll until the status is terminal
curl -s https://api.raywake.com/v1/jobs/JOB_ID \
-H "Authorization: Bearer $RAYWAKE_API_KEY"Girdi
| Alan | Tür | Açıklama |
|---|---|---|
image_urlzorunlu | string (image URL) | URL of the image to be segmented |
prompt | string | Text prompt for segmentation |
point_prompts | array of objects | List of point prompts |
box_prompts | array of objects | Box 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_mask | boolean | Apply the mask on the image. |
sync_mode | boolean | If True, the media will be returned as a data URI. |
output_format | string (enum) | The format of the generated image. |
return_multiple_masks | boolean | If True, upload and return multiple generated masks as defined by `max_masks`. |
max_masks | number (enum) | Maximum number of masks to return when `return_multiple_masks` is enabled. |
include_scores | boolean | Whether to include mask confidence scores. |
include_boxes | boolean | Whether to include bounding boxes for each mask (when available). |
Çıktı
Başarılı bir iş, sonuçlarını outputs altında listeler; dosyalar bizim tarafımızda saklanır. Tüm alanlar için İşler sayfasına bak.
"outputs": [
{ "type": "image", "url": "https://…", "mime_type": "image/png", "thumbnail_url": "https://…" }
]Fiyatlandırma
- 1 istek$0,02/ istek
Girdinin kesin ücreti ücret teklifinden gelir. Bakiye nasıl kesinleşir?