Skip to main content
POST
/
v3
/
async
/
mj-inpaint
Midjourney Inpainting
curl --request POST \
  --url https://api.highwayapi.ai/v3/async/mj-inpaint \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "image_no": 123,
  "task_id": "<string>",
  "remix_prompt": "<string>",
  "mask": {
    "url": "<string>",
    "areas": [
      {
        "points": [
          {}
        ],
        "width": 123,
        "height": 123
      }
    ]
  },
  "area": {
    "points": [
      {}
    ],
    "width": 123,
    "height": 123
  }
}
'
{
  "task_id": "<string>"
}
Use Midjourney inpainting to redraw specified areas of a generated image. You can specify the inpainting area using polygon regions or a black-and-white mask image. This API uses asynchronous processing, and the client needs to query the final generated result via task_id.

Request Headers

Content-Type
string
required
Enum value: application/json
Authorization
string
required
Bearer authentication format: Bearer {{API key}}.

Request Body

image_no
integer
required
Image number, used to specify the image to inpaint.Value range: 0~3
task_id
string
required
Unique identifier of the original image generation task.
remix_prompt
string
Inpainting prompt, used to describe the desired content for the inpainted area.Length limit: 1-8192 characters.
mask
object
required
Inpainting area configuration. Replaces the area parameter and supports multi-region inpainting. Choose either areas or url.
area
object
required
Single polygon region configuration (use either this parameter or the mask parameter).

Response Parameters

task_id
string
required
The task_id of the asynchronous task. You should use this task_id to request the Query Task Result API to obtain the generated result.