Remove image background
remove_backgroundRemove the background from a local image file or image URL and save the cut-out result to disk as a transparent or colour-filled file. Returns the saved path.
Instructions
Remove the background from a local image file or an image URL and save the result to disk. Returns the saved file path. Provide exactly one of input_path or image_url. 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 | preview ≈ 0.25 MP, medium 1.5 MP, hd 4 MP, full up to 25 MP. | full |
| format | No | png | |
| bg_color | No | Background colour such as ffffff or white. Omit for transparency. | |
| image_url | No | Public http(s) URL of the source image. | |
| overwrite | No | Replace output_path if it already exists. | |
| input_path | No | Path to a local JPG, PNG or WebP image (max 12 MB). | |
| clean_edges | No | Remove coloured fringes from the old background in hair, fur, and soft edges. | |
| output_path | No | Where to save the result. Defaults to '<input name>-no-bg.<ext>' next to the input, or the current directory for URLs. |