remove_object
AI: removes an object and fills in the background (AI). Say what to remove with word (e.g. "dog", "sign"; the server finds it), box [x1,y1,x2,y2] in image pixels, or channel (an existing selection channel, e.g. from any selection tool). The server grows the object's mask a little (grow_px, default about 0.5% of the object's long side, at most 50), cuts out a square of the photo around it at full resolution, has the AI fill the hole, and adds the result as a NEW layer "Removed: ..." directly above the layer it was cut from (the top of the stack when no layer is given), covering only the filled area. Nothing else is changed: delete that layer to undo. Check the result with preview or compare. The AI is shown a square of the photo around the object (about 2x its long side, at most 4000 px), so large objects work. One is refused before anything is sent when it is longer than that square allows, or when its hole would be more than a quarter of what the AI works on (an object that fills most of the photo): select a smaller part, or remove it in pieces. Takes about 5 to 15 s (longer the first time). Do NOT use for small blemishes or dust (retouch spot_heal is faster).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box | No | The object's box [x1, y1, x2, y2] in image pixels. | |
| word | No | What to remove, e.g. "dog" or "red car". Letters, digits, spaces. | |
| image | Yes | Image id, as returned by open_photo. | |
| layer | No | Work on this layer alone (and add the fill directly above it), not the whole picture. | |
| channel | No | An existing selection channel that holds the object; it is left untouched. | |
| grow_px | No | Pixels to grow the object's mask before filling, so its edge and shadow go too. Default: about 0.5% of the object's long side. | |
| layer_id | No | Layer id (takes priority over `layer`). |