Skip to main content
POST
cURL
使用此端點可透過遮罩編輯 Midjourney 圖像,或根據 prompt 加上來源圖像產生透明背景結果。

兩種常見模式

  • 遮罩編輯:傳送 maskBase64prompt,並可選擇性附上原始 image
  • 透明繪製:當你想在沒有額外遮罩的情況下取得透明背景結果時,傳送 imageprompt

任務流程

1

提交編輯器任務

選擇編輯模式,傳送 prompt 與來源資料,然後儲存回傳的 task id。
2

輪詢任務

使用 Fetch Single Task 直到任務進入終態。
3

從結果繼續

直接使用最終資產,或在編輯結果提供後續按鈕時觸發 Action

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

application/json
prompt
string
預設值:Change to white background
必填

Text prompt describing the desired edit.

image
string
預設值:https://your-image-host/source.png
必填

Image to edit. Pass a public URL or a base64-encoded data URI.

state
string

Custom state string. Returned as-is in the task result and webhook callback for your own tracking.

notifyHook
string

Webhook URL to receive task status updates. Falls back to your account-level webhook if omitted.

noStorage
boolean

When true, return the original provider image URL instead of a CometAPI-proxied link.

回應

200 - application/json

Success

code
integer

Submission status code. 1 = submitted successfully (result carries the task id). 21 = the action opened a confirmation modal; continue with /mj/submit/modal using the returned task id. 4 = parameter error; description explains the cause.

description
string
result
string