Midjourney Imagine API
POSThttps://api.acedata.cloud/midjourney/imagine
Midjourney image generation API, text-to-image with iterative refinement.
Related Products
Midjourney - Ace Data Cloud
Midjourney image painting platform, directly connected to this API, fast and stable available.
Request Headers
acceptstring
Specify the response format returned by the server.
Please select
authorizationstring
Bearer token
Request Body
modestring
API running mode, optional values are `fast` (quick), `relax` (relaxed), or `turbo` (super fast), corresponding to different image generation modes of Midjourney.
Please select
actionstring
Operation type. Use `generate` for the first generation, and for subsequent operations, use the action values returned in the `actions` field of the response. You can also specify specific operations to process the generated image.
promptstring
English descriptive words (prompts) for generating images.
timeoutnumber
The timeout duration for API response data (seconds).
image_idstring
The ID of the generated image has been created for continuing subsequent operations based on it.
translationboolean
Is automatic translation enabled for non-English prompts, as Midjourney officially only supports English?
Please select
maskstring
URL of the mask image for operation, which can be used for the specific operation `variation_region` (local repainting).
split_imagesboolean
Whether to split the generated image into multiple single images, and return them through the `sub_image_urls` field after splitting. The default is `false`.
Please select
callback_urlstring
Webhook callback URL for asynchronous notifications.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select
versionstring
Midjourney model versions, such as `'8.1'`, `'8'`, `'7'`, `'6.1'`. It is recommended to use the latest version `'8.1'`. This parameter is used to calculate the billing amount for specific version features.
hdboolean
Whether to enable HD high-definition output (2K resolution, supported only by V8 and V8.1). It requires 4 times the GPU time on V8; in V8.1, the HD mode is about 3 times cheaper and faster than V8 HD.
Please select
qualitystring
The quality levels for image generation are selectable values: `'.25'`, `'.5'`, `'1'`, `'2'`, `'4'`. Quality `'4'` is only supported in V8/V8.1, and it requires 4 times the GPU time on V8 (cheaper on V8.1).
style_referenceboolean
Is a style reference (`--sref`) used in the prompt? It will consume 4 times the GPU time in V8; in V8.1, the cost of style reference (sref) and moodboard has significantly decreased and is more stable.
Please select
moodboardboolean
Whether moodboard references are used in the prompt. In V8, image references are considered moodboards and consume 4 times the GPU time; in V8.1, the moodboard effect is more stable and costs less.
Please select
Response
Midjourney generation
Allow Use General Balance
When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.
Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.
