Skip to main content
POST
cURL
使用此端点启动 Midjourney 的主工作流。后续每一步,包括放大、变体和自定义缩放,都从一个成功的 imagine 任务开始。

首次响应会返回什么

  • result 是你接下来要轮询的任务 id
  • 即使不是 HTTP 风格的 200code 也仍然可能是成功状态码

核心工作流

1

提交 imagine 任务

发送 prompt 并保存返回的任务 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