Remove image background
remove_backgroundRemove the background from an image and return the cutout. Provide exactly one of image_url or image_base64. Returns a transparent PNG by default, or the subject on a solid colour when bg_color is set. When several objects or a person and a product appear together, the model may keep or drop some of them (for example a hand holding a product); use roi to restrict the subject area. Parts of a subject hidden behind something else cannot be recovered.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "remove_background"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| roi | No | Region of interest as 'x1 y1 x2 y2' in px or %, e.g. '20% 10% 80% 95%'. Only the subject inside this box is kept. | |
| crop | No | Crop the output to the subject. | |
| size | No | Output resolution: preview ≈ 0.25 MP, medium 1.5 MP, hd 4 MP. Use the HTTP API for larger outputs. | medium |
| format | No | png | |
| bg_color | No | Optional background colour, e.g. ffffff or white. | |
| image_url | No | Public http(s) URL of the source image (max 12 MB). | |
| clean_edges | No | Remove coloured fringes from the old background in hair, fur, and soft edges. | |
| image_base64 | No | Base64-encoded source image (max 12 MB decoded). |