Skip to main content
POST
/
v1
/
midjourney
/
generations
/
edits
curl --request POST \
  --url https://api.apimart.ai/v1/midjourney/generations/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "replace the background with a modern kitchen, keep the product unchanged --ar 1:1",
    "image_urls": [
      "https://example.com/product.png"
    ],
    "version": "8.1",
    "speed": "fast"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KV52C0TEJSYZMCG0NCS4YWKK"
    }
  ]
}
curl --request POST \
  --url https://api.apimart.ai/v1/midjourney/generations/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "replace the background with a modern kitchen, keep the product unchanged --ar 1:1",
    "image_urls": [
      "https://example.com/product.png"
    ],
    "version": "8.1",
    "speed": "fast"
  }'
{
  "code": 200,
  "data": [
    {
      "status": "submitted",
      "task_id": "task_01KV52C0TEJSYZMCG0NCS4YWKK"
    }
  ]
}
Rewrites the whole image from an existing image + prompt. Good for background replacement, style transfer, and content changes.
ItemValue
actionEDITS
Billingmidjourney@edits[-speed]
Requiredprompt + image_urls

Parameters

FieldTypeRequiredDefaultNotes
promptstringYesEdit instruction
image_urlsstring[]YesImage to edit; each ≤ 12 MiB
speedstringNorelaxrelax / fast / turbo
metadataobjectNoCustom metadata

Structured fields (optional)

Same as Imagine — set them in the body or in prompt (e.g. --ar 16:9). Body values take priority, are appended to the prompt, and override same-name flags written by hand.
FieldTypeMJ equivalentNotes
sizestring--are.g. "16:9", "1:1", "9:16"
qualitystring--q"0.25", "0.5", "1", "2"
stylestring--stylee.g. "raw"
versionstring--vVersion. Main MJ versions append --v <version>; when used with niji: true and "7" / "6", it is normalized as a Niji version
seedint--seedSeed
negative_promptstring--noe.g. "ugly, blurry"
stylizeint--s0–1000
chaosint--c0–100
weirdint--w0–3000
tilebool--tileTile mode
nijibool--nijiNiji switch. Recommended: niji: true + version: "7" / "6"
iwfloat--iw0–3, image weight
cwint--cw0–100
swint--sw0–1000
crefstring--crefCharacter ref URL
srefstring--srefStyle ref URL
drefstring--drefDepth reference image URL
dwfloat--dwDepth weight (0–100)
repeatint--repeat2–40
rawbool--rawRaw style (v5.1+)
draftbool--draftDraft mode (v7+)
hdbool--hdHD mode (v8 / v8.1 only; backend auto-injects --v 8.1 when version is unspecified)
stopint--stopEarly stop (10–100; v5–6.1 / niji 5–6 only)
extrastringany --xxxEscape hatch; appended to prompt verbatim

Request example

{
  "prompt": "replace the background with a modern kitchen, keep the product unchanged --ar 1:1",
  "image_urls": ["https://example.com/product.png"],
  "version": "8.1",
  "speed": "fast"
}

Response

Submission returns a task_id; on SUCCESS the result includes edited image_urls (may be 1–4) plus grid_image_url.

Notes

  • Difference from imagine image-guidance: edits “rewrites the whole image”, while imagine + reference images “borrows the style”.
  • Missing prompt or image_urls returns 400; a single image over 12 MiB returns 400.