SnapEditDocs
API Reference

Erase objects from image

remove-object-ganremove-object-sdremove-object-qwen

Remove objects from an image using a manual mask, selected detected objects, or both. To erase detected objects, first call the Detect Objects API, then provide original_session_id plus mask_objects.

Provide at least one erase target: input_mask, or original_session_id + mask_objects.

post/v1/images/remove-objects

Credit cost: 3 (normal), 4 (super), 13 (ultra)

AuthorizationThis endpoint requires an API key. Pass it in the api-key header on every request. See the quickstart

Body

NameTypeStatusDescription
input_image
fileRequiredImage file or URL to erase objects from.
original_session_id
stringOptionalSession ID returned by the Detect Objects API. Needed when using mask_objects.
input_mask
fileOptionalManual brush mask image file or URL. Can be combined with mask_objects.
mask_objects
stringOptionalSelected object item or JSON array from detected_objects. Provide with original_session_id.
erase_mode
stringOptionalErase mode.
normalsuperultra
(default: normal)

Responses

Objects erased successfullySingleImageResponse

NameTypeDescription
createdintegerUnix timestamp of when the response was created
dataobject[]
urlstringURL to download the result image
curl -X POST "https://api.snapapi.ai/v1/images/remove-objects" \
  -H "api-key: YOUR_API_KEY" \
  -F "input_image=@./image.jpg" \
  -F "input_mask=@./image.png" \
  -F "erase_mode=normal"
Response
{
  "created": 1745827200,
  "data": [
    {
      "url": "https://outputs.snapapi.ai/outputs/abc123.png"
    }
  ]
}

Examples

(3 examples)

Input

Input 1Input 2

Output

Output