cut_out
Extracts a product from its source photo as a transparent PNG using concept-guided segmentation, then provides mask overlay and review details to verify the selection.
Instructions
Cut the product out of its photo as a transparent PNG.
Args: image: The product photo — an asset handle (asset://), an http(s) URL, or a base64 data URI. It is ingested and normalized first. concept: Optional noun-phrase concept naming what to segment ("brown leather wallet"). When omitted, the identify planning step runs internally to produce the concept and alternates.
Calls SAM 3.1 with the concept phrase and decodes the returned mask (Meta's official parser, behind the sam_masks boundary). The mask is quality-checked — coverage sane (not empty, not ~the whole frame) and dominated by one connected region — and on a zero-match or a poor mask, all fixed identify phrases are evaluated and bounded phrase; every attempt is traced in the result. The foreground is the source pixels through the accepted mask, nothing regenerated. Storage is a lineage chain — mask parented to the source photo, foreground parented to the mask — so draw's fidelity receipt pins the exact mask asset the cut used. The input must be a source photo: handing cut_out a generated asset (a composite, a plate) is refused with NOT_A_SOURCE_PHOTO before any billing, because cutting generated pixels out would launder them into a protected foreground. Because a fidelity receipt can only vouch for the pixels a mask selected, the result also carries the selection's own review surface: mask_overlay_asset (the source photo with the mask's outline drawn on it) and mask_review (the mask's bounding box, fill, frame-edge contact, and any sanity warnings).
Failures return a structured error: NOT_CONFIGURED (no META_API_KEY; checked before billing, so no ledger write), NO_MATCH / POOR_MASK (no usable mask after the bounded attempts; the attempts' spend stays counted), BAD_MODEL_RESPONSE (SAM output unusable; spend counted). A planning failure inside the chain (concept omitted and identify failed) surfaces as that step's error code with plan_error attached.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image": "<image>"
},
"name": "cut_out"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | ||
| concept | No |