Skip to main content
POST
cURL
使用這個端點來啟動 Midjourney 的主要工作流程。後續的每個步驟,包括放大、變化和自訂縮放,都始於成功的 imagine 任務。

第一個回應會提供什麼

  • result 是你接下來要輪詢的 task id
  • code 即使不是 HTTP 樣式的 200,仍然可能是成功代碼

核心工作流程

1

提交 imagine 任務

傳送 prompt 並儲存回傳的 task id。
2

輪詢直到任務完成

使用 擷取單一任務,直到任務狀態達到 SUCCESSMODALFAILURE
3

繼續進行後處理

按鈕出現後,使用 Action 執行放大、變化、重新生成、縮放,以及其他類似的後續操作。

可選的影片 prompt 模式

如果你想讓來源圖片產生動態效果,可在 prompt 中加入圖片 URL 與 Midjourney 的影片旗標,例如 --video--motion

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

application/json
prompt
string
必填

Text prompt for the generation. Supports standard Midjourney parameters such as --v, --ar, --stylize, etc.

範例:

"a paper boat floating on calm water at sunrise --v 6.1"

botType
enum<string>
預設值:MID_JOURNEY

Bot type to use. MID_JOURNEY for Midjourney (default), NIJI_JOURNEY for Niji.

可用選項:
MID_JOURNEY,
NIJI_JOURNEY
accountFilter
object

Filter which Midjourney account modes may be used for this task.

base64Array
string[]

Base64-encoded reference images. Each item should be a data URI such as data:image/png;base64,xxx.

state
string

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

回應

200 - application/json

Task accepted.

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
必填

Task id returned after submission.

properties
object