---
title: "Edit Image with a Prompt"
method: POST
path: "/painting/edit"
tags: ["Image2Image / Inpainting"]
---

# Edit Image with a Prompt

`POST /painting/edit`

## Request

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

Edit any image with a prompt. Apply any transformation, any type of detail you can imaging and the AI will apply it to the image.
Choose from the big range of models if you have preferences or to take control of the output quality.

## 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.)
  - `prompt` string, required: The prompt.
  - `width` integer, nullable: Desired output width. When unset, derived from the input image dimensions.
  - `height` integer, nullable: Desired output height. When unset, derived from the input image dimensions.
  - `count` integer: The number of images to generate.
  - `format` 'JPG' | 'PNG' | 'WEBP': Optionally select one of the image formats (JPG is default). Options are as follows: * JPG * PNG * WEBP
  - `mode` 'sync' | 'async': 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. * REMOVED - auto: the processing mode decision is made by the service, which depends upon the expected processing time.
  - `watermark_enabled` boolean, nullable: Enables the watermark. This is primarily used to show that the image is AI-generated, but this can be used for other use cases as well. When enabled, the default watermark will be added. When customization is needed, follow other "watermark**" parameters. For more advanced watermarking, you can also check out the [Add Watermark](https://docs.picsart.io/reference/image-add-watermark) service.
  - `watermark_url` string, uri, nullable: URL of the watermark image. If omitted or empty and watermark_enabled is true, a default watermark is applied.
  - `watermark_anchor_point` 'left-top' | 'left-middle' | 'left-bottom' | 'center-top' | 'center-middle' | 'center-bottom' | 'right-top' | 'right-middle' | 'right-bottom' | 'pattern'
  - `watermark_width` union: Width of watermark. A pixel value like `100` (>= 1), or a percentage of the canvas width like `"10%"` / `"12.5%"` (> 0, <= 100).
    - integer, nullable
    - string
  - `watermark_height` union: Height of watermark. A pixel value like `100` (>= 1), or a percentage of the canvas height like `"10%"` / `"12.5%"` (> 0, <= 100).
    - integer, nullable
    - string
  - `watermark_opacity` integer, nullable: Define the opacity of the watermark. Takes values from 0 to 100. Default is 100 (opaque). Set to 0 to make it transparent.
  - `watermark_angle` integer, nullable: Define the angle of the watermark. Takes values from 0 to 360. Default 45 for pattern case, otherwise 0.
  - `watermark_padding_x` union: Define the horizontal padding of the watermark. A pixel value like `20` (>= 0), or a percentage of the canvas width like `"2%"` (>= 0, <= 100).
    - integer, nullable
    - string
  - `watermark_padding_y` union: Define the vertical padding of the watermark. A pixel value like `20` (>= 0), or a percentage of the canvas height like `"2%"` (>= 0, <= 100).
    - integer, nullable
    - string
  - `model` 'urn:air:sdxl:model:fluxai:flux_kontext_max@1' | 'urn:air:sdxl:model:fluxai:flux_kontext_pro@1' | 'urn:air:fluxai:model:fluxai:flux-2-flex@1' | 'urn:air:fluxai:model:fluxai:flux-2-pro@1' | 'urn:air:fluxai:model:fluxai:flux-2-max@1' | 'urn:air:fluxai:model:fluxai:flux-2-pro-preview@1' | 'urn:air:seedream:model:seedream:seedream@4.0' | 'urn:air:seedream:model:seedream:seedream@4.5' | 'urn:air:seedream:model:seedream:seedream@4.7' | 'urn:air:seedream:model:seedream:seedream@5.0-lite' | 'urn:air:seedream:model:seedream:seedream@5.0-pro' | 'urn:air:seedream:model:seedream:seedream@5.0-flash' | 'urn:air:google:model:google:gemini-3-pro-image-preview@1' | 'urn:air:google:model:google:gemini-3.1-flash-image-preview@1' | 'urn:air:google:model:google:gemini-3-pro-image@1' | 'urn:air:google:model:google:gemini-3.1-flash-image@1' | 'urn:air:google:model:google:gemini-3.1-flash-lite-image@1' | 'urn:air:google:model:google:gemini-nano-banana-2.1@1' | 'urn:air:openai:model:openai:gpt-image-1@1' | 'urn:air:reve:model:reve:reve-edit@1' | 'urn:air:runway:model:runway:gen4-image-ref@1' | 'urn:air:qwen:model:qwen:qwen-image@1' | 'urn:air:qwen:model:qwen:qwen-image-2.0-pro@1' | 'urn:air:qwen:model:qwen:qwen-image-3.0@1' | 'urn:air:qwen:model:qwen:qwen-image-3.0-pro@1' | 'urn:air:picsart:model:picsart:qwen-image-edit@1' | 'urn:air:xai:model:xai:grok-imagine-image-edit@1' | 'urn:air:xai:model:xai:grok-imagine-image-2.0-edit@1' | 'urn:air:kling:model:kling:kling-v3@1' | 'urn:air:kling:model:kling:kling-image-o1@1' | 'urn:air:kling:model:kling:kling-v3-omni@1' | 'urn:air:meta:model:meta:muse-image-1.0@1' | 'urn:air:fluxai:model:fluxai:flux-3-image@1' | 'urn:air:fluxai:model:fluxai:flux-3-image-klein@1' | 'urn:air:ideogram:model:ideogram:ideogram@4.5' | 'urn:air:luma:model:luma:uni-1@1' | 'urn:air:luma:model:luma:uni-1-max@1' | 'urn:air:wan:model:wan:wan-2.6-image@1', nullable: Optionally choose a specific AI model to use for this request. If not specified, a default model will be applied. Please note that the default model may change over time as Picsart continues to improve performance and accuracy. Any change to the default will be made only after thorough testing and validation to ensure it delivers better results. If you require consistent behavior or wish to evaluate different models on your own, we recommend explicitly setting this parameter.

## Response `200`

Success.

- object
  - `status` string
  - `data` object[]
    - `id` string, nullable
    - `url` 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)
