Skip to main content
POST
/
mj
/
submit
/
modal
cURL
curl https://api.cometapi.com/mj/submit/modal \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "taskId": "<task_id>",
      "customId": "MJ::Inpaint::1::<custom_id_hash>::SOLO",
      "prompt": "a small red lantern on the boat",
      "maskBase64": "data:image/png;base64,<your-mask-base64>"
    }'
{
  "code": 123,
  "description": "<string>",
  "properties": {},
  "result": 123
}

Overview

Submit additional input when an Action task returns status: "MODAL". This is required for operations that need extra data, such as inpainting masks or custom zoom prompts.

When to use

OperationWhat to Submit
Vary (Region) / InpaintmaskBase64 (PNG mask) + prompt
Custom Zoomprompt (e.g., “your prompt —zoom 2”)
For a complete inpaint flow example, see Start with Midjourney API.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Body

application/json
taskId
string
default:<task_id>
required

Task id from the parent task whose modal action you are continuing.

customId
string
required

The button customId that opened the modal, such as MJ::Inpaint::1::xxxx::SOLO from the Vary (Region) button. Required.

maskBase64
string

Base64-encoded mask image for partial inpainting. White areas are repainted; black areas are preserved.

prompt
string

Text prompt describing the desired change for the selected region.

Response

200 - application/json

Success

code
integer
required

The status of the task

description
string
required
properties
object
required
result
integer
required

The task ID of the returned task