Midjourney
Modal (submit parameters)
Supply mask + prompt to complete a MODAL-state inpaint task
POST
mask_url is present: with mask_url → inpaint (local repaint); without → outpaint (expand).
| Item | Value |
|---|---|
| action | MODAL |
| Billing | midjourney@modal[-speed] |
| Required | task_id |
| Optional | prompt, mask_url, speed, metadata |
Parameters
| Field | Description |
|---|---|
task_id | Local task id returned by the inpaint step (must be in MODAL state) |
prompt | Inpaint prompt; if empty, inherits the parent task’s prompt |
mask_url | Mask image URL or base64; required for inpaint (local repaint). White = the area to repaint, transparent = keep the original |
speed | relax / fast / turbo |
metadata | Optional custom metadata |
Mask requirements
| Item | Recommendation |
|---|---|
| Format | PNG with transparent background (also accepts data:image/png;base64,...) |
| Resolution | Preferably same as the parent image (the system also auto-resizes) |
| White area | The area to repaint; transparent areas keep the original |
| Size | ≤ 12 MiB per image |
| URL | Must be publicly reachable (private addresses are blocked by SSRF) |
Request example
Response
Thetask_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.