메인 콘텐츠로 건너뛰기
POST
/
midjourney
/
imagine
Midjourney Imagine
curl --request POST \
  --url https://api.acedata.cloud/midjourney/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mask": "<string>",
  "mode": "fast",
  "action": "generate",
  "prompt": "A cat sitting on a table",
  "timeout": 480,
  "image_id": "<string>",
  "translation": false,
  "callback_url": "<string>",
  "split_images": false
}
'
{
  "actions": [
    "upscale1",
    "upscale2",
    "upscale3",
    "upscale4",
    "reroll",
    "variation1",
    "variation2",
    "variation3",
    "variation4"
  ],
  "success": true,
  "task_id": "27a1128f-14b5-440e-a82d-510c81e6fcd4",
  "image_id": "1211290228438868029",
  "progress": 100,
  "image_url": "https://midjourney.cdn.acedata.cloud/attachments/1219474225119887443/1211290228438868029/lwilson_A_cat_sitting_on_a_table_id2079872_dbe8e8a2-cec8-4e54-bd9d-4c2f8bfb919f.png?ex=65eda8ef&is=65db33ef&hm=2cec373068f121f3d2ecf43280810fe17b641527b87716e100401d299c8e0845&width=1024&height=1024",
  "image_width": 1024,
  "image_height": 1024,
  "raw_image_url": "https://midjourney.cdn.acedata.cloud/attachments/1219474225119887443/1211290228438868029/lwilson_A_cat_sitting_on_a_table_id2079872_dbe8e8a2-cec8-4e54-bd9d-4c2f8bfb919f.png?ex=65eda8ef&is=65db33ef&hm=2cec373068f121f3d2ecf43280810fe17b641527b87716e100401d299c8e0845&",
  "raw_image_width": 2048,
  "raw_image_height": 2048
}

인증

Authorization
string
header
필수

헤더

accept
enum<string>

Specifies the format of the response from the server.

사용 가능한 옵션:
application/json,
application/x-ndjson

본문

application/json
mask
string

Mask image URL for the operation, it can be used for specific action - variation_region

mode
enum<string>
기본값:fast

The mode of the API. It can be 'fast', 'relax' or 'turbo', which corresponds to different mode of Midjourney.

사용 가능한 옵션:
fast,
relax,
turbo
action
string
기본값:generate

Operation type. Use 'generate' for the first time and actions values for subsequent operations, and you can specify specific action to perform on the generated image.

prompt
string

Image description in English for generating the preview image.

예시:

"A cat sitting on a table"

timeout
number
기본값:480

Timeout in seconds for the API to return data.

image_id
string

Image ID for continue operations on an already generated image.

translation
boolean
기본값:false

Enable automatic translation for non-English prompts, because Midjourney only supports English officially.

callback_url
string

Webhook callback URL for asynchronous notifications.

split_images
boolean
기본값:false

Split the generated image into multiple images, return by sub_image_urls field. By default, it is false.

응답

Image generated successfully or operation performed successfully.

actions
string[]

List of allowed actions that can be performed on the generated image.

success
boolean

Indicates if the task was successful executed.

task_id
string

The ID of the imagine task.

image_id
string

The unique identifier of the generated image.

progress
number

The progress of the task.

image_url
string

The URL of the generated thumbnail image, if you want to get the raw image use the raw_image_url field.

image_width
string

The width of the generated thumbnail image.

image_height
string

The height of the generated thumbnail image.

raw_image_url
string

The raw URL of the generated raw image.

raw_image_width
string

The height of the generated raw image.

raw_image_height
string

The height of the generated raw image.