跳转到主要内容
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 是你接下来要轮询的任务 id
  • description 是一条包装消息,可能会被本地化
  • code 即使不是 HTTP 风格的 200,也仍然可能表示成功

核心工作流

1

提交 imagine 任务

发送 prompt 并保存返回的任务 id。
2

轮询直到任务完成

使用 获取单个任务 直到任务达到 SUCCESSMODALFAILURE
3

继续进行后处理

当按钮出现后,使用 Action 执行放大、变体、重绘、缩放以及类似的后续操作。

可选的视频 prompt 模式

如果你希望基于源图像生成动态效果,可以在 prompt 中添加图像 URL 以及 Midjourney 视频标志,例如 --video--motion
2026-03-12 的实时验证确认,一个 FAST imagine 请求会立即返回任务 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