> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novita.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ming Image Layer Decoupling

`ming-image-0.1-design-layer` only supports layer decoupling, using the OpenAI Image edits protocol.

## Request Headers

**Content-Type** `string` *required*

Supports: `multipart/form-data`

**Authorization** `string` *required*

Bearer authentication format, for example: Bearer \{\{API Key}}.

## Request Body

**model** `enum` *required*

The model name. Available values: `ming-image-0.1-design-layer`

**image** `Files` *required*

The input image, 1 image. It is `image[]` in the form.

`ming-image-0.1-design-layer` only supports 1 image input.

**prompt** `string` *required*

The text description of the image.

**output\_format** `string` (default: png)

The output image format. Must be one of `png` or `webp`.

**response\_format** `string` (default: b64\_json)

The form in which the image is returned, default is `b64_json`. Available values: `url`, `b64_json`. Note: `url` is valid for 24 hours.

**size** `string` (default: auto)

The output image size, default `auto` selects automatically based on the model. Format `"{w}x{h}"`, e.g. `"1024x1024"`.

**watermark** `boolean` (default: false)

Controls whether a watermark is added to the AI-generated image. `true`: enables the explicit watermark and implicit digital watermark on AI-generated images, complying with policy requirements. `false`: disables all watermarks.

## Response

**created** `integer` *required*

The Unix timestamp (seconds) when the response was created.

**data** `array` *required*

The array of returned images, containing multiple layers (e.g. foreground layer, background layer, etc.), one element per layer.

**properties**

**b64\_json** `string`

The base64-encoded layer image data.

**data\[0].revised\_prompt** `string`

A JSON string describing the layer structure, indicating the canvas size and the information of each region.

**properties**

**revised\_prompt.canvas** `array`

The canvas size `[width, height]`.

**revised\_prompt.regions** `array`

The list of layer regions.

**properties**

**revised\_prompt.regions\[].category** `string`

The layer category, e.g. `Image` (foreground layer), `BackgroundImage` (background layer).

**revised\_prompt.regions\[].bbox** `array`

The bounding box of the layer on the canvas `[x1, y1, x2, y2]`.

**output\_format** `string` *required*

The output image format (layers are always output as png).

**size** `string`

`null`

**usage** `object` *required*

Token usage statistics.

**properties**

**input\_tokens** `integer`

Total input tokens (including the tokens of the uploaded image).

**input\_tokens\_details** `object`

Input token details.

**properties**

**image\_tokens** `integer`

The number of tokens consumed by the input image.

**text\_tokens** `integer`

The number of tokens consumed by the input text.

**output\_tokens** `integer`

Total output tokens (the sum across multiple layers, e.g. 3 layers × 4096 = 12288).

**total\_tokens** `integer`

The total of input + output tokens.

**model** `string` *required*

The name of the model that actually processed the request.

**id** `string` *required*

The unique identifier ID of this request.

## Example

`Request:`

```bash theme={"system"}
curl --location --request POST 'https://api.novita.ai/openai/v1/images/edits' \
--header 'Authorization: Bearer {{API Key}}' \
--form 'model="ming-image-0.1-design-layer"' \
--form 'prompt="Split into three layers"' \
--form 'image[]=@"{The Path of Your Image File}"' \
--form 'size="1024x1024"'
```

`Response:`

```js theme={"system"}
{
  "created": 1789642431,
  "data": [
    {
      "b64_json": "...",
      "revised_prompt": "{\"canvas\": [1024, 1024], \"regions\": [{\"category\": \"Image\", \"bbox\": [1.4, 3.3, 1023.0, 1022.0]}, {\"category\": \"BackgroundImage\", \"bbox\": [1.4, 3.3, 1023.0, 1022.0]}]}"
    },
    {
      "b64_json": "..."
    },
    {
      "b64_json": "..."
    }
  ],
  "output_format": "png",
  "size": null,
  "usage": {
    "input_tokens": 4096,
    "input_tokens_details": {
      "image_tokens": 4096,
      "text_tokens": 0
    },
    "output_tokens": 12288,
    "total_tokens": 16384
  },
  "model": "Ming-Image-0.1-Design-Layer-StressTest",
  "id": "218edba617896423893976485e4f35"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.