Перейти до основного вмісту
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.

Використовуйте цей endpoint, щоб запустити основний процес Midjourney. Кожен наступний крок, включно з upscale, variation і custom zoom, починається з успішного imagine task.

Що дає вам перша відповідь

  • result — це id task, який ви будете опитувати далі
  • code все одно може бути кодом успіху, навіть якщо це не HTTP-стиль 200

Основний процес

1

Надішліть imagine task

Надішліть prompt і збережіть повернений id task.
2

Опитуйте, доки task не завершиться

Використовуйте Fetch Single Task, доки task не досягне SUCCESS, MODAL або FAILURE.
3

Продовжуйте post-processing

Коли з’являться кнопки, використовуйте Action для upscale, variation, reroll, zoom та інших подібних подальших операцій.

Необов’язковий шаблон video prompt

Якщо ви хочете рух із вихідного зображення, додайте URL зображення та Midjourney video flags у prompt, наприклад --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