Florence-2 Phrase Grounding
Image editing
Starting price $0.60 / run
Meta's SAM 3.1 finds the objects you name or point at in an image and cuts each one out as a mask.
sam-3-1/imageQuote the input, start the generation with the quote, then poll the job. Set RAYWAKE_API_KEY first; see Authentication.
# 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": "the striped umbrellas on the beach"
}
}'
# 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":"the striped umbrellas on the beach"}}'
# 3. Poll until the status is terminal
curl -s https://api.raywake.com/v1/jobs/JOB_ID \
-H "Authorization: Bearer $RAYWAKE_API_KEY"| Name | Type | Description |
|---|---|---|
image_urlrequired | 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). |
A succeeded job lists its results under outputs, stored on our side. See Jobs for every field.
"outputs": [
{ "type": "image", "url": "https://…", "mime_type": "image/png", "thumbnail_url": "https://…" }
]The exact charge for your input comes from a quote. How charges settle
Fields marked * are required. Review the price before generating.
Upload an image and say what to select, in a few words such as "wheel" or "yellow taxi". It finds every match. You can also mark objects with points (on the object or on the background) or with boxes, and give points and boxes the same object number to refine one object.
By default the mask is applied to the image. You can also ask for several masks, a confidence score per mask and a box around each one.
Inspect thin edges, holes and nearby objects included in the mask.