跳转到主要内容
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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

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

首次响应会返回什么

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

核心工作流

1

提交 imagine 任务

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

轮询直到任务完成

使用 Fetch Single Task 直到任务状态达到 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
必填
description
string
必填
result
string
必填

Task id returned after submission.

properties
object