Skip to main content
POST
/
v3
/
async
/
mj-inpaint
Midjourney Inpaint
curl --request POST \
  --url https://api.myrouter.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 the Midjourney Inpaint feature to repaint a specified region of a generated image. Supports specifying the repaint region via polygon areas or black-and-white mask images. This endpoint uses async processing; the client needs to query the final result using the task_id.

Request Headers

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

Request Body

image_no
integer
required
Image number, used to specify which image to inpaint.Range: 0~3
task_id
string
required
The unique identifier of the original image generation task.
remix_prompt
string
Inpaint region prompt, used to describe the desired content for the repainted region.Length limit: 1-8192 characters.
mask
object
required
Repaint region 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 or the mask parameter).

Response

task_id
string
required
The task_id of the async task. Use the task_id to call the Get Async Task Result API to retrieve the generated result.