Skip to content
Trang này chưa có bản dịch sang ngôn ngữ của bạn, nên hiện đang được hiển thị bằng tiếng Anh.

Edits (image edit)

Rewrite the whole image from an existing image + prompt. Good for background replacement, style transfer, content changes

Toàn bộ tài liệu
POST/v1/midjourney/generations/edits
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"
  }
}

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

Ví dụ request

curl --request POST \
  --url https://api.apisea.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"
  }'

Parameters

FieldTypeRequiredNotes
promptstringYesEdit instruction
nsfw_checkbooleanNoDefaults 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
image_urlsstring[]YesImage to edit; each ≤ 12 MiB
speedstringNoDefault: relax; relax / 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--styleStyle presets depend on the version; for Raw mode in v8.2, use raw: true, not style: "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 mode (v5.1+); in v8.2, set to true, equivalent to --raw
draftbool--draftDraft mode (v7+)
hdbool--hdHD mode (v8.1 / v8.2 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

Note

Raw mode in v8.2: --style raw is not accepted. Use --v 8.2 --raw in the prompt, or "version": "8.2", "raw": true in the body. Remove any --style raw from the prompt and style: "raw" from the body; do not combine them with --raw / raw: true.

Request example

json
{
  "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.

Phản hồi

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

Phát hiện lỗi trong tài liệu này? Gửi email đến support@apisea.ai.