Chuyển đến nội dung chính
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>"
  }
}
Sử dụng endpoint này sau khi một tác vụ Midjourney trả về các nút hành động. Endpoint này sẽ bắt đầu một tác vụ tiếp theo như upscale, variation, reroll, zoom hoặc pan.

Bạn cần hai giá trị

  • taskId từ tác vụ Midjourney gốc hoặc gần nhất
  • customId từ mảng buttons mới nhất được trả về bởi Fetch Single Task
customId không ổn định. Tuyệt đối không hardcode giá trị này. Luôn đọc nó từ phản hồi polling mới nhất.

Các hành động phổ biến

  • U1 đến U4: upscale một hình ảnh từ lưới
  • V1 đến V4: tạo các variation từ một vị trí hình ảnh
  • Reroll: tạo lại toàn bộ lưới
  • Zoom và Pan: mở rộng bố cục hiện có

Sau khi bạn gửi một action

1

Tạo tác vụ tiếp theo

Gửi taskIdcustomId, sau đó lưu task id mới được trả về.
2

Poll tác vụ mới

Truy vấn Fetch Single Task lần nữa cho đến khi action hoàn tất.
3

Xử lý các action chỉ dành cho modal

Nếu tác vụ mới đạt trạng thái MODAL, tiếp tục với Modal để cung cấp dữ liệu đầu vào bổ sung.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Nội dung

application/json
customId
string
bắt buộc

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

taskId
string
bắt buộc

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.

Phản hồi

200 - application/json

Action task accepted.

code
integer
bắt buộc
description
string
bắt buộc
result
string
bắt buộc

New Midjourney task id created for the action.

properties
object