Skip to content
Esta página ainda não está disponível no seu idioma, por isso é apresentada em inglês.

Inpaint

Region inpaint entry (Vary (Region)); after submission the task enters MODAL, then call modal with mask + prompt

Toda a documentação
POST/v1/midjourney/generations/inpaint
json
{
  "error": {
    "code": 500,
    "message": "Internal server error. Please try again later",
    "type": "server_error"
  }
}
json
{
  "error": {
    "code": 502,
    "message": "Bad gateway. The server is temporarily unavailable",
    "type": "bad_gateway"
  }
}

Entry point for region inpaint (equivalent to Vary (Region)). After submission the task enters the MODAL state; you must then call modal with a mask + prompt to finish.

ItemValue
actionINPAINT
Billingmidjourney@inpaint[-version][-speed]
Requiredtask_id, or task_id + custom_id
Optionalindex, speed, metadata

Exemplos de pedidos

curl --request POST \
  --url https://api.apisea.ai/v1/midjourney/generations/inpaint \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "task_id": "task_01KQW0D3WJ2QYJP9E3H7GZ4D2R",
    "speed": "fast"
  }'

Parameters

FieldDescription
task_idSource task ID (typically an Upscale single-image task)
nsfw_checkboolean — Optional; defaults to false. Run content moderation before submitting a Midjourney task. • true: use omni-moderation-latest to review prompts and input images • false: skip moderation without adding moderation cost or latency
custom_idOptional; button ID for the corresponding Vary (Region) action
indexOptional; which image of the parent task (1–4, default 1); usually unnecessary for a single image
speedrelax / fast / turbo
metadataOptional custom metadata

Auto matching

The service matches Vary (Region) from the source task buttons.

Request example

json
{
  "task_id": "task_01KQW0D3WJ2QYJP9E3H7GZ4D2R",
  "speed": "fast"
}

Follow-up

On success the response returns status: "modal" — this is a valid non-terminal state, not an error. Continue with the modal endpoint, where task_id is the local task ID returned by inpaint, plus prompt and optional mask_url.

json
{
  "task_id": "task_03_inpaint...",
  "status": "modal",
  "model": "midjourney"
}

Notes

  • The parent task must be a SUCCESS upscaled single image; inpainting a grid directly errors — call upscale first.
  • After entering MODAL you must call modal within 30 minutes, otherwise the backend auto-cancels and refunds.
  • Version metadata from the source task is inherited automatically. To price by speed, configure midjourney@inpaint-fast / midjourney@inpaint-turbo.

Respostas

{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KV52C0TEJSYZMCG0NCS4YWKK"
    }
  ]
}

Encontrou um problema nesta documentação? Envie um e-mail para support@apisea.ai.