Skip to content
Esta página aún no está disponible en tu idioma, así que se muestra en inglés.

Modal (submit parameters)

Supply mask + prompt to complete a MODAL-state inpaint task

Toda la documentación
POST/v1/midjourney/generations/modal
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"
  }
}

Complete a MODAL-state inpaint task by supplying a mask + prompt. The system auto-detects the mode by whether mask_url is present: with mask_url → inpaint (local repaint); without → outpaint (expand).

ItemValue
actionMODAL
Billingmidjourney@modal[-speed]
Requiredtask_id
Optionalprompt, mask_url, speed, metadata

Ejemplos de solicitudes

curl --request POST \
  --url https://api.apisea.ai/v1/midjourney/generations/modal \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "task_id": "task_01KQW1N9T6E3AHW6QZFDEK8M5C",
    "prompt": "replace the selected area with a red leather sofa",
    "mask_url": "https://example.com/mask.png",
    "speed": "fast"
  }'

Parameters

FieldDescription
task_idLocal task id returned by the inpaint step (must be in MODAL state)
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
promptInpaint prompt; if empty, inherits the parent task's prompt
mask_urlMask image URL or base64; required for inpaint (local repaint). Transparent = the area to repaint, white = keep the original
speedrelax / fast / turbo
metadataOptional custom metadata

Mask requirements

ItemRecommendation
FormatPNG with transparent background (also accepts data:image/png;base64,...)
ResolutionPreferably same as the parent image (the system also auto-resizes)
Transparent areaThe area to repaint; white areas keep the original
Size≤ 12 MiB per image
URLMust be publicly reachable (private addresses are blocked by SSRF)

Request example

json
{
  "task_id": "task_01KQW1N9T6E3AHW6QZFDEK8M5C",
  "prompt": "replace the selected area with a red leather sofa",
  "mask_url": "https://example.com/mask.png",
  "speed": "fast"
}

Response

The task_id stays the same (same task); its status goes from MODAL → SUBMITTED. Poll GET /v1/tasks/{task_id}; on SUCCESS image_urls holds 4 inpaint candidates. Billing settles on this endpoint's SUCCESS and is not double-charged with the inpaint step.

To price by speed, configure midjourney@modal-fast / midjourney@modal-turbo.

Respuestas

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

¿Has encontrado un problema en esta documentación? Escribe a support@apisea.ai.