Unmerge
v1.0.3Split a flat image into up to 100 transparent PNG layers.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
split_into_layers Split an image into layers
Split a flat image (PNG, JPG or WebP, at least 512 × 512 px) into named transparent layers, with the hidden parts behind objects filled in. Costs 1 credit per layer returned (up to 17 by default, or up to 100 when prompt lists or asks for more parts); the account needs at least 5 credits to start. Pass the image as a public https URL or as base64. Waits up to 50 seconds; if it is still processing, call get_layers later.
| Parameter | Type | Description |
|---|---|---|
image_base64 | string | The image as base64, with or without a data: prefix. Use when there is no URL. |
image_url | string | Public https URL of the image. |
prompt | string | Optional: what to separate, in plain words, e.g. "the cat, the sofa and the background". Leave empty to let the model decide (up to 17 layers), or list/ask for more parts to allow up to 100 layers. |
wait_seconds | integer | How long to wait for the result before returning, 0 to 50 seconds. |
get_layers Get the layers of a split
Status of a split. When ready, returns every layer with its name, position and a PNG download URL valid for one hour. Free.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | The id returned by split_into_layers. |
wait_seconds | integer | How long to wait for the result before returning, 0 to 50 seconds. |
unlock_layers Unlock layers
For a split with status needs_credits: pay the extra credits owed (shown as credits.owed) so the layer files become available. Charges once even if called again.
| Parameter | Type | Description |
|---|---|---|
project_id * | string | The id returned by split_into_layers. |
get_credits Credits left
Credits available on this Unmerge account. One credit is one layer returned.