Chuyển đến nội dung chính
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.

Sử dụng endpoint này để khởi động quy trình Midjourney chính. Mọi bước tiếp theo, bao gồm upscale, variation và custom zoom, đều bắt đầu từ một tác vụ imagine thành công.

Phản hồi đầu tiên cung cấp gì

  • result là id tác vụ mà bạn sẽ poll ở bước tiếp theo
  • code vẫn có thể là mã thành công ngay cả khi nó không phải kiểu HTTP 200

Quy trình cốt lõi

1

Gửi tác vụ imagine

Gửi prompt và lưu task id được trả về.
2

Poll cho đến khi tác vụ hoàn tất

Sử dụng Fetch Single Task cho đến khi tác vụ đạt SUCCESS, MODAL hoặc FAILURE.
3

Tiếp tục với hậu xử lý

Khi các nút xuất hiện, sử dụng Action cho các thao tác tiếp theo như upscale, variation, reroll, zoom và các thao tác tương tự.

Mẫu prompt video tùy chọn

Nếu bạn muốn tạo chuyển động từ một ảnh nguồn, hãy thêm URL hình ảnh cùng các cờ video của Midjourney vào prompt, chẳng hạn như --video--motion.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Nội dung

application/json
prompt
string
bắt buộc

Text prompt for the generation. Supports standard Midjourney parameters such as --v, --ar, --stylize, etc.

Ví dụ:

"a paper boat floating on calm water at sunrise --v 6.1"

botType
enum<string>
mặc định:MID_JOURNEY

Bot type to use. MID_JOURNEY for Midjourney (default), NIJI_JOURNEY for Niji.

Tùy chọn có sẵn:
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.

Phản hồi

200 - application/json

Task accepted.

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

Task id returned after submission.

properties
object