remove_background
Cut subjects out of images to create PNGs with transparent backgrounds. Batch-process up to 64 images, then trim, pad, square, resize, or flatten onto a solid color for compositing.
Instructions
Cut the subject out of one or more images: PNG cut-outs with a transparent background (BiRefNet).
images: 1 to 64 local image paths (PNG, JPEG, WebP, GIF, BMP or TIFF; the first frame of an animation). All are processed in one batch, so the model loads once; pass them together. With no other option each output is the same size as its input, the subject opaque and the background transparent, so it lines up with the original for compositing. trim=True crops to the subject's bounding box, plus padding on every side (a fraction of the subject's longer side, default 0.05; 0 is a tight crop). padding applies only with trim. square=True centres the result on a square transparent canvas (for icons and sprites). size: scale so the longer side is this many pixels (16 to 4096); with square, size x size. background: a colour like "#ffffff" to flatten onto instead of transparency (RGB PNG). Typical calls: UI icon trim=True, square=True, size=256; item sprite trim=True, padding=0; cut-out for compositing: no options. Returns per image the input, the output path, its size and the subject box found (x0, y0, x1, y1 in input pixels, with trim). A second, model free pass does the layout when any option is set. Default output folder: /ai/output/localgen/cutout//.
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": {
"images": "<images>"
},
"name": "remove_background"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | ||
| trim | No | ||
| images | Yes | ||
| square | No | ||
| padding | No | ||
| background | No | ||
| output_dir | No | ||
| idle_timeout_seconds | No |