Przejdź do głównej treści
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>"
  }
}
Użyj tego endpointu po tym, jak zadanie Midjourney zwróci przyciski akcji. Uruchamia ono nowe zadanie podrzędne, takie jak upscale, variation, reroll, zoom lub pan.

Potrzebujesz dwóch wartości

  • taskId z oryginalnego lub najnowszego zadania Midjourney
  • customId z najnowszej tablicy buttons zwróconej przez Fetch Single Task
customId nie jest stałe. Nigdy nie wpisuj go na stałe w kodzie. Zawsze odczytuj je z najnowszej odpowiedzi z pollingu.

Typowe akcje

  • U1 do U4: upscale jednego obrazu z siatki
  • V1 do V4: generowanie wariantów z jednej pozycji obrazu
  • Reroll: ponowne wygenerowanie całej siatki
  • Zoom i Pan: rozszerzenie istniejącej kompozycji

Po wysłaniu akcji

1

Utwórz zadanie następcze

Wyślij taskId i customId, a następnie zapisz id nowo zwróconego zadania.
2

Sprawdzaj nowe zadanie

Ponownie wysyłaj zapytania do Fetch Single Task, aż akcja się zakończy.
3

Obsłuż akcje wymagające modalu

Jeśli nowe zadanie osiągnie stan MODAL, kontynuuj z Modal, aby podać dodatkowe dane wejściowe.

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Treść

application/json
customId
string
wymagane

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

taskId
string
wymagane

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.

Odpowiedź

200 - application/json

Action task accepted.

code
integer
wymagane
description
string
wymagane
result
string
wymagane

New Midjourney task id created for the action.

properties
object