Midjourney generative API based on mobile device simulation. Actively maintained for my own projects. Highly scalable. For extensive scaling needs, reach me out on Telegram @vasia972. Perfect for developers.
The core of this API revolves around jobs. Each request instantiates a new job, initially set to a NEW
status. As processing unfolds, this status gets updated.
Here’s the job structure returned upon request submission:
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "NEW",
"progress": 0,
"result": "",
"parent_id": null,
"options": null,
"error_message": null
}
id
: Unique job identifierstatus
: Current job status (refer to the Statuses section)progress
: Generation progress (0-100%)result
: URL of the generated image.parent_id
: ID of the parent job (used with execute-option
endpoint).options
: Available options list for the job.error_message
: Description of any job failures (refer to Errors section).Typically, you’ll:
Average processing times:
Status represent current job state. Returned data depends on the job status. See examples additionally to get a better understanding.
NEW
: Job queued for processing.PREPARING
: Processing commenced; arguments under moderation.WAITING
: Job dispatched to midjourney.IN_PROGRESS
: Job currently underway.SUCCEEDED
: Job completed successfully. FINAL statusFAILED
: Job faced issues. FINAL statusPotential errors and their contexts:
OFFENSIVE_PROMPT
(Imagine): the prompt you given may offense someone. Midjourney filters are pretty hard and unpredictable. Even the word ‘military’ may be banned in several contexts. I additionally moderate the prompts to filter extreme cases.FAILED_TO_DOWNLOAD_IMAGE
(Blend): provided images are unreachableIMAGE_TOO_LARGE
(Blend): Images exceed the 25MB limitINVALID_CONTENT_TYPE
(Blend): Ensure submitted links are actual imagesOFFENSIVE_IMAGE
(Blend): One/more images might be flagged. Midjourney’s image filters can be strict; even innocuous images might get flagged. I additionally moderate images to filter extreme cases.DUPLICATE_IMAGES
(Blend): Identical images in the requestSLOW_DOWN
(Upsacle): Triggered when trying to upscale an image multiple times consecutivelyUNEXPECTED_ERROR
Infrequent errors when midjourney doesn’t fulfill requests. Ensure to accommodate this unpredictable error in your error-handling strategy.INVALID_ARGUMENT[{RAW_DESCRIPTION}]
(Imagine): Some of the parameters has invalid value. Examples may have contain markdown: INVALID_ARGUMENT[Invalid value provided for argument --stylize: ``invalid float value: '750,'``]
. Let me know if you want it to have it differentMIDJOURNEY_FAILED_TO_PROCESS_COMMAND
(Imagine): Midjourney replies “failed to process your command :c”. Retry may helpCreate images with midjourney.
Submit your prompt to the designated endpoint to initiate image creation. Example request:
{
"prompt": "women with black hair and glasses futurism style style of Carlo Carra dark blue background"
}
Upon successful completion, you’ll receive a response containing the generated image URL and available options for further actions:
Intermediate results are accessible while the job is IN_PROGRESS
.
Example result:
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "SUCCEEDED",
"progress": 100,
"result": "https://cdn.discordapp.com/attachments/1163560386306523148/1163928244232400958/residentsleeperessence_women_with_black_hair_and_glasses_futuri_e793801b-5834-48b3-b064-4056faef96a7.png?ex=65415ba6&is=652ee6a6&hm=909e04a690dd30e984dded5d6832427e087cc275ed532900a35b1f57c1131730&",
"parent_id": null,
"options": ["U1", "U2", "U3", "U4", "🔄", "V1", "V2", "V3","V4"],
"error_message": null
}
Blend images together seamlessly.
Example result for a man + golang logo (https://s.mj.run/7idgh2f1yDw, https://s.mj.run/_z2tqSb48so):
You would need to specify from 2 to 5 image urls for blend. The response will be a new job, following the standard flow.
Example request:
{
"images": [
"url_1", "url_2"
]
}
To further refine or manipulate your generated image, use the Execute Option. Send a request specifying the option and the associated job. The response will be a new job, following the standard flow.
Example request:
{
"option": 0,
"parent_id": "00000000-0000-0000-0000-000000000000"
}
Note: This triggers the first option. Options are presented in the order provided by Midjourney, but some have been omitted. Delisted options include:
Webhooks provide a mechanism to get notifications about job status updates. When making requests to the generative API groups, simply include your webhook_url
. Upon job status changes, our system will send updates to your specified callback URL in the form of a job object, consistent with the data structure of the GET job
endpoint.
For every webhook received, your system should acknowledge with an HTTP status code 200
. If your system responds with any other status code, I interpret it as a failure and will retry delivering the webhook based on the following schedule:
Important Considerations
Overlapping Webhooks: If a job updates its status while a previous webhook is still in the delivery process, a new webhook will be generated. The previously undelivered webhook will be marked as ‘outdated’ and won’t be delivered anymore.
Temporary Results: Be aware that temporary images in the result
field are transient. Once the job concludes, all temporary results become inaccessible. It is crucial to persist these results if they are of importance to your operations.
Order of Delivery: Webhooks might not always arrive in the order of events. We recommend implementing additional verification steps to ensure the correctness of the status and progress data when processing received webhooks.
Various job status examples:
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "NEW",
"progress": 0,
"result": "",
"parent_id": null,
"options": null,
"error_message": null
}
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "PREPARING",
"progress": 0,
"result": "",
"parent_id": null,
"options": null,
"error_message": null
}
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "IN_PROGRESS",
"progress": 31,
"result": "",
"parent_id": null,
"options": null,
"error_message": null
}
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "SUCCEEDED",
"progress": 100,
"result": "https://cdn.discordapp.com/attachments/1165424365765132298/1166024434549805187/residentsleeperessence_mystic_blonde_portrait_c76e07bc-ec55-4370-8f87-69d539b28602.png?ex=6548fbe0&is=653686e0&hm=0fbcdd0e1750f765e87de702d90d9cf4f2c08931174e81bbd68b19314f11c12d&",
"parent_id": null,
"options": [
"U1",
"U2",
"U3",
"U4",
"🔄",
"V1",
"V2",
"V3",
"V4"
],
"error_message": null
}
{
"id": "00000000-0000-0000-0000-000000000000",
"status": "FAILED",
"progress": 100,
"result": "",
"parent_id": null,
"options": null,
"error_message": "UNEXPECTED_ERROR"
}