跳转到主要内容
POST
/
mj
/
submit
/
action
Create a Midjourney follow-up action task
curl --request POST \
  --url https://api.cometapi.com/mj/submit/action \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customId": "MJ::JOB::variation::3::example",
  "taskId": "1773314942177684"
}
'
{
  "code": 123,
  "description": "<string>",
  "result": "<string>",
  "properties": {
    "numberOfQueues": 123,
    "discordInstanceId": "<string>",
    "discordChannelId": "<string>"
  }
}
当 Midjourney 任务返回操作按钮后,使用此端点。它会启动一个新的下游任务,例如放大、变体、重抽、缩放或平移。

你需要两个值

  • 来自原始或最近一次 Midjourney 任务的 taskId
  • 来自 获取单个任务 返回的最新 buttons 数组中的 customId
customId 并不稳定。绝不要将其硬编码。始终从最新的轮询响应中读取它。

常见操作

  • U1U4:从网格中放大一张图像
  • V1V4:基于某个图像位置生成变体
  • 重抽:重新生成整个网格
  • 缩放和平移:扩展现有构图

提交操作后

1

创建后续任务

发送 taskIdcustomId,然后保存新返回的任务 id。
2

轮询新任务

再次查询 获取单个任务,直到操作完成。
3

处理仅限模态框的操作

如果新任务进入 MODAL,继续使用 Modal 提供额外输入。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

application/json
customId
string
必填

Action id taken from the latest buttons array returned by the fetch endpoint.

taskId
string
必填

Midjourney task id you want to continue from.

state
string

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

enableRemix
boolean

Whether to force remix mode when the current action supports it.

chooseSameChannel
boolean

Whether to prefer the same channel account used by the current task.

响应

200 - application/json

Action task accepted.

code
integer
必填
description
string
必填
result
string
必填

New Midjourney task id created for the action.

properties
object