Evf Sam
Usage-based pricing
ae_evf_sam
Create a mask or cutout for objects or areas in an image using a text description, with options to refine the mask.
Usage-based pricing
Pricing
The charge per call is (max(6 × billable usage, 0)) AE credits. All applicable conditions are combined to calculate the total.
Requests with a negative prompt incur twice the billable usage.
Parameters
Optional parameters use the platform defaults when omitted.
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
request_body | object | Yes | No parameter description. | — |
request_body.prompt | string | Yes | The prompt to generate segmentation from. | — |
request_body.blur_mask | integer | No | Apply Gaussian blur to the mask. Value determines kernel size (must be odd number) | 0 |
request_body.image_url | string | Yes | URL of the input image | — |
request_body.mask_only | boolean | No | Output only the binary mask instead of masked image | true |
request_body.fill_holes | boolean | No | Fill holes in the mask using morphological operations | false |
request_body.expand_mask | integer | No | Expand/dilate the mask by specified pixels | 0 |
request_body.revert_mask | boolean | No | Invert the mask (background becomes foreground and vice versa) | false |
request_body.semantic_type | boolean | No | Enable semantic level segmentation for body parts, background or multi objects | false |
request_body.negative_prompt | string | unknown | No | Areas to exclude from segmentation (will be subtracted from prompt results) | — |
request_body.use_grounding_dino | boolean | No | Use GroundingDINO instead of SAM for segmentation | false |
Invocation example
Copy the request and explore its response example.
POST
/agent-api/v1/tool/executeX-Api-KeySubmit first, then query with the returned task_id until the task completes.
Request coderequest.sh
curl --request POST \
--url 'https://agentearth.ai/agent-api/v1/tool/execute?tool_name=ae_evf_sam' \
--header "X-Api-Key: $AGENTEARTH_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"params": {
"request_body": {
"fill_holes": true,
"image_url": "https://agentearth.ai/fileserver/file/a0267fff-74ae-466b-a9b8-a578e25f2c67.png",
"mask_only": true,
"prompt": "humanoid robot"
}
}
}'Response exampleresponse.json
{
"description": "task accepted; poll the result via query_tool with this task_id",
"query_tool": "ae_get_result",
"status": "created",
"task_id": "d5721224-bcd9-46e3-91b4-05cb821f9e52"
}



