跳轉到主要內容
POST
/
mj
/
submit
/
imagine
Create a Midjourney imagine task
curl --request POST \
  --url https://api.cometapi.com/mj/submit/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "a paper boat floating on calm water at sunrise --v 6.1"
}
'
{
  "code": 1,
  "description": "提交成功",
  "result": "1773314942177684",
  "properties": {
    "discordChannelId": "5e6ca8e1f40e4de6",
    "discordInstanceId": "5e6ca8e1f40e4de6"
  }
}
使用這個端點來啟動 Midjourney 的主要工作流程。之後的每個步驟,包括放大、變化與自訂縮放,都從成功的 imagine 任務開始。

第一個回應會提供什麼

  • result 是你下一步要輪詢的 task id
  • description 是包裝訊息,且可能已本地化
  • code 即使不是 HTTP 風格的 200,仍可能是成功代碼

核心工作流程

1

提交 imagine 任務

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

輪詢直到任務完成

使用 Fetch Single Task 直到任務達到 SUCCESSMODALFAILURE
3

繼續進行後處理

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

可選的影片 prompt 模式

如果你想讓來源圖片產生動態效果,請在 prompt 中加入圖片 URL 與 Midjourney 的影片旗標,例如 --video--motion
於 2026-03-12 的即時驗證確認,FAST imagine 請求會立即返回 task id,而後續的擷取請求則達到 SUCCESS,並附帶 imageUrl 與 9 個操作按鈕。

授權

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
必填
description
string
必填
result
string
必填

Task id returned after submission.

properties
object