---
title: "Remove Object from an Image"
method: POST
path: "/painting/remove-object"
tags: ["Image2Image / Inpainting"]
---

# Remove Object from an Image

`POST /painting/remove-object`

## Request

- Base URL: `https://genai-api.picsart.io/v1`
- URL: `https://genai-api.picsart.io/v1/painting/remove-object`
- Auth: API key in header `X-Picsart-API-Key`

This service allows to remove objects from the original image by providing a mask.
Even though the same type of a result can also achieved via the [Inpainting](https://docs.picsart.io/reference/genai-image-inpainting) service, this service uses a specially trained model to provide fine tuned results.

## Request body `multipart/form-data`

- object
  - `image` string, binary: Source image file (binary). (If this parameter is present, the other image source parameters must be empty.)
  - `image_url` string, uri: Source image URL. (If this parameter is present, the other image source parameters must be empty.)
  - `image_id` string: Deprecated. Source image ID of an image previously uploaded to Picsart or result image ID from a different API. (If this parameter is present, the other image source parameters must be empty.)
  - `mask_image` string, binary: Source mask file (binary). (If this parameter is present, the other mask source parameters must be empty.)
  - `mask_image_url` string, uri: Source mask URL. (If this parameter is present, the other mask source parameters must be empty.)
  - `mask_image_id` string: Deprecated. Source mask ID of an mask previously uploaded to Picsart or result mask ID from a different API. (If this parameter is present, the other mask source parameters must be empty.)
  - `format` 'JPG' | 'PNG' | 'WEBP': Optionally select one of the image formats (JPG is default). Options are as follows: * JPG * PNG * WEBP
  - `mode` 'sync' | 'async' | 'auto': Deprecated. The mode parameter is now deprecated. To control synchronous vs asynchronous execution, use the standard HTTP Prefer header (RFC 7240). If both mode and Prefer are provided, Prefer takes precedence. For migration guidance and examples, see the [Sync and Async Execution guide](https://docs.picsart.io/docs/sync-async-execution). Use this query parameter to establish the processing mode. Acceptable values are sync, async and auto (sync is default): * sync: issues a synchronous request, response is given when the result is ready. * async: forces an asynchronous request, the response, which is instantaneous, contains a "transaction_id" which is used to poll for the result. * auto: the processing mode decision is made by the service, which depends upon the expected processing time.

## Response `200`

Success.

- object
  - `data` object
    - `id` string, nullable
    - `url` string
  - `status` string

## Other responses

- `202`: Processing.
- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `413`: Request Entity Too Large
- `415`: Unsupported Media Type
- `429`: Too Many Requests
- `431`: Request Header Fields Too Large
- `500`: Internal Server Error
- `503`: Service Unavailable
- `529`: Overloaded. The model provider is overloaded and could not complete this request. Please retry shortly, or switch to a different model.

---

[API](https://skmtc.dev/picsart/apis/picsart-genai-api.md) - [All operations](https://skmtc.dev/picsart/apis/picsart-genai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/picsart/apis/picsart-genai-api/revisions/f36fdc4033ee?raw)
