Midjourney Image Formats (Midjourney Proxy/Plus)
Midjourney Image Formats (Midjourney Proxy/ Plus)
Section titled “Midjourney Image Formats (Midjourney Proxy/ Plus)”Overview
Please note
This interface is not the official Midjourney API. It is a Midjourney proxy API based on the open-source project midjourney-proxy by novicezk.
This project has two versions, both of which are supported by 4All API:
- Open-source version
midjourney-proxy - Paid version
midjourney-proxy-plus
We sincerely appreciate the author’s contribution, which makes it easy to use Midjourney’s powerful capabilities. If you have the time, please give the author a Star. If you’re able to, we recommend supporting the paid version, which offers more features.
| Feature Category | Open-source Version | Paid Version |
|---|---|---|
| Basic Features | | |
| Imagine commands and related actions | ✓ | ✓ |
| Image reference support | ✓ | ✓ |
| Blend (image blending) | ✓ | ✓ |
| Describe (image-to-text) | ✓ | ✓ |
| Real-time task progress | ✓ | ✓ |
| Chinese prompt translation | ✓ | ✓ |
| prompt sensitive-word detection | ✓ | ✓ |
| user-token connects to wss | ✓ | ✓ |
| Multi-account configuration | ✓ | ✓ |
| Advanced Features | | |
| Shorten (prompt analysis) | ✗ | ✓ |
| Pan | ✗ | ✓ |
| Zoom | ✗ | ✓ |
| Vary Region | ✗ | ✓ |
| Link button actions with Remix mode | ✗ | ✓ |
| Get image seed value | ✗ | ✓ |
| Account Management | | |
| Persistent account pool | ✗ | ✓ |
| Multiple storage backends supported (Redis/MySQL) | ✗ | ✓ |
| Account info retrieval and settings | ✗ | ✓ |
| Task cancellation | ✗ | ✓ |
| Built-in admin panel | ✗ | ✓ |
| Intelligent Features | | |
| MJ V6.0 support | ✗ | ✓ |
| Automatic account status monitoring | ✗ | ✓ |
| Automatic mode switching | ✗ | ✓ |
niji・journey Bot support | ✗ | ✓ |
| InsightFace face service | ✗ | ✓ |
| Security & Reliability | | |
| Dynamic configuration support | ✗ | ✓ |
| Fix for token disconnect issues | ✗ | ✓ |
| Automatic verification | ✗ | ✓ |
| Automatic appeals for banned words | ✗ | ✓ |
📝 Introduction
Section titled “📝 Introduction”Midjourney is a powerful image generation and editing model that can create, edit, and modify images from natural-language descriptions. By exposing different interfaces, it can handle a wide range of image generation and processing tasks.
🔄 Workflow Diagram
Section titled “🔄 Workflow Diagram”Workflow Description
Section titled “Workflow Description”- Initial task
- Imagine: text to image
- Blend: multi-image blending
- Describe: image description
- Swap Face: face replacement
- Image processing
- U1-U4: upscale operations
- V1-V4: variation generation
- Pan: image shifting
- Zoom: image scaling
- Special workflows
- Action + Modal: actions that require a confirmation dialog
- Action direct execution: actions that do not require a dialog
- Task management
- Get task details
- Get image Seed
- Upload to Discord
💡 Request Examples
Section titled “💡 Request Examples”Submit an Imagine task ✅
Section titled “Submit an Imagine task ✅”curl --location --request POST 'https://4All API地址/mj/submit/imagine' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "botType": "MID_JOURNEY", "prompt": "Cat", "base64Array": [], "accountFilter": { "channelId": "", "instanceId": "", "modes": [], "remark": "", "remix": true, "remixAutoConsidered": true }, "notifyHook": "", "state": ""}'Response example:
{ "code": 1, "description": "提交成功", "properties": {}, "result": 1320098173412546}Submit a Blend task ✅
Section titled “Submit a Blend task ✅”curl --location --request POST 'https://4All API地址/mj/submit/blend' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "botType": "MID_JOURNEY", "base64Array": [ "data:image/png;base64,xxx1", "data:image/png;base64,xxx2" ], "dimensions": "SQUARE", "accountFilter": { "channelId": "", "instanceId": "", "modes": [], "remark": "", "remix": true, "remixAutoConsidered": true }, "notifyHook": "", "state": ""}'Response example:
{ "code": 1, "description": "提交成功", "properties": {}, "result": 1320098173412546}Submit a Describe task ✅
Section titled “Submit a Describe task ✅”curl --location --request POST 'https://4All API地址/mj/submit/describe' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "botType": "MID_JOURNEY", "base64": "data:image/png;base64,xxx", "accountFilter": { "channelId": "", "instanceId": "", "modes": [], "remark": "", "remix": true, "remixAutoConsidered": true }, "notifyHook": "", "state": ""}'Response example:
{ "code": 1, "description": "提交成功", "properties": {}, "result": 1320098173412546}Submit a Modal ✅
Section titled “Submit a Modal ✅”curl --location --request POST 'https://4All API地址/mj/submit/modal' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "maskBase64": "", "prompt": "", "taskId": "14001934816969359"}'Response example:
{ "code": 1, "description": "提交成功", "properties": {}, "result": 1320098173412546}Submit a swap_face task ✅
Section titled “Submit a swap_face task ✅”curl --location --request POST 'https://4All API地址/mj/insight-face/swap' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "sourceBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RDnYdriP1wsS81kwU8OVs/R3xu8s6bX7+zYnOH8coSqpmRSBjqerjcBlr2OB/lbAf/2Q==", "targetBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD849k="}'Response example:
{ "code": 0, "description": "string", "result": "string"}Execute an Action ✅
Section titled “Execute an Action ✅”curl --location --request POST 'https://4All API地址/mj/submit/action' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "chooseSameChannel": true, "customId": "MJ::JOB::upsample::1::82c51c9d-bc33-4c07-a471-36c3dcb1a6f0", "taskId": "1728781324658687", "accountFilter": { "channelId": "", "instanceId": "", "modes": [], "remark": "", "remix": true, "remixAutoConsidered": true }, "notifyHook": "", "state": ""}'Response example:
{ "code": 1, "description": "提交成功", "properties": {}, "result": 1320098173412546}Upload files to Discord ✅
Section titled “Upload files to Discord ✅”curl --location --request POST 'https://4All API地址/mj/submit/upload-discord-images' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--data-raw '{ "base64Array": [], "filter": { "channelId": "", "instanceId": "", "remark": "" }}'Response example:
{ "code": 0, "description": "string", "result": [ "string" ]}Query tasks by ID list ✅
Section titled “Query tasks by ID list ✅”curl --location --request POST 'https://4All API地址/mj/task/list-by-condition' \--header 'Accept: application/json' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Content-Type: application/json' \--data-raw '{ "ids": []}'Response example:
[ { "action": "IMAGINE", "buttons": [ { "customId": "string", "emoji": "string", "label": "string", "style": 0, "type": 0 } ], "description": "string", "failReason": "string", "finishTime": 0, "id": "string", "imageUrl": "string", "progress": "string", "prompt": "string", "promptEn": "string", "properties": {}, "startTime": 0, "state": "string", "status": "NOT_START", "submitTime": 0 }]Get a task by ID ✅
Section titled “Get a task by ID ✅”curl --location --request GET 'https://4All API地址/mj/task/{id}/fetch' \--header 'Accept: application/json' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Content-Type: application/json'Response example:
{ "action": "IMAGINE", "buttons": [ { "customId": "string", "emoji": "string", "label": "string", "style": 0, "type": 0 } ], "description": "string", "failReason": "string", "finishTime": 0, "id": "string", "imageUrl": "string", "progress": "string", "prompt": "string", "promptEn": "string", "properties": {}, "startTime": 0, "state": "string", "status": "NOT_START", "submitTime": 0}Get the seed of a task image ✅
Section titled “Get the seed of a task image ✅”curl --location --request GET 'https://4All API地址/mj/task/{id}/image-seed' \--header 'Accept: application/json' \--header 'Authorization: Bearer $4All API_API_KEY' \--header 'Content-Type: application/json'Response example:
{ "code": 0, "description": "string", "result": "string"}📮 Requests
Section titled “📮 Requests”Endpoints
Section titled “Endpoints”Submit an Imagine task
Section titled “Submit an Imagine task”POST /mj/submit/imagineCreate an image from a text prompt.
Submit a Blend task
Section titled “Submit a Blend task”POST /mj/submit/blendBlend multiple input images to generate a new image.
Submit a Describe task
Section titled “Submit a Describe task”POST /mj/submit/describeGenerate a text description from an input image.
Submit a Modal
Section titled “Submit a Modal”POST /mj/submit/modalSubmit modal information for fine-tuning image generation details.
Submit a swap_face task
Section titled “Submit a swap_face task”POST /mj/insight-face/swapPerform face swapping using a source image and a target image.
Execute an Action
Section titled “Execute an Action”POST /mj/submit/actionPerform follow-up actions on a generated image, such as upscaling or adjustments.
Upload files to Discord
Section titled “Upload files to Discord”POST /mj/submit/upload-discord-imagesUpload images to Discord.
Query tasks by ID list
Section titled “Query tasks by ID list”POST /mj/task/list-by-conditionQuery task details by a specified list of task IDs.
Get a task by ID
Section titled “Get a task by ID”GET /mj/task/{id}/fetchGet task details by task ID.
Get the seed of a task image
Section titled “Get the seed of a task image”GET /mj/task/{id}/image-seedGet the seed value of the image generated by the specified task.
Authentication
Section titled “Authentication”Include the following in the request header for API key authentication:
Authorization: Bearer $4All API_API_KEY$OPENAI_API_KEYWhere $OPENAI_API_KEY is your API key.
Request Body Parameters
Section titled “Request Body Parameters”Submit an Imagine task
Section titled “Submit an Imagine task”botType
Section titled “botType”- Type: enum string
- Required: No
- Default:
MID_JOURNEY - Possible values:
MID_JOURNEY: Midjourney modelNIJI_JOURNEY: Niji Journey model- Description: The bot type to use
prompt
Section titled “prompt”- Type: string
- Required: Yes
- Description: The text prompt for image generation
- Tips:
- Use clear and specific descriptions
- You can include artistic style, composition, and other details
- English and Chinese input are both supported
base64Array
Section titled “base64Array”- Type: string array
- Required: No
- Description: The base64-encoded array for reference images
- Format: Each item should be a complete base64 image string, including the MIME type prefix
accountFilter
Section titled “accountFilter”- Type: object
- Required: No
- Properties:
- channelId: channel ID
- instanceId: account instance ID
- modes: account mode array, possible values:
RELAX,FAST,TURBO - remark: content contained in the remark field
- remix: whether the account supports remix
- remixAutoConsidered: remix auto-submit setting
notifyHook
Section titled “notifyHook”- Type: string
- Required: No
- Description: Callback URL after the task is completed. If empty, the global
notifyHookis used
- Type: string
- Required: No
- Description: Custom state parameter, which can be used to track the request
Submit a Blend task
Section titled “Submit a Blend task”base64Array
Section titled “base64Array”- Type: string array
- Required: Yes
- Description: Base64-encoded array of images to blend
- Format: Must contain base64 strings for 2-5 images
dimensions
Section titled “dimensions”- Type: enum string
- Required: No
- Possible values:
PORTRAIT: 2:3 aspect ratioSQUARE: 1:1 aspect ratioLANDSCAPE: 3:2 aspect ratio- Description: Aspect ratio setting for the output image
Submit a Describe task
Section titled “Submit a Describe task”base64
Section titled “base64”- Type: string
- Required: Yes
- Description: Base64-encoded image to describe
- Format: Complete base64 string including the MIME type prefix
Submit a Modal task
Section titled “Submit a Modal task”maskBase64
Section titled “maskBase64”- Type: string
- Required: No
- Description: Base64-encoded mask image for local inpainting
prompt
Section titled “prompt”- Type: string
- Required: No
- Description: Text prompt for the inpainted region
taskId
Section titled “taskId”- Type: string
- Required: Yes
- Description: ID of the original task
Submit a Swap Face task
Section titled “Submit a Swap Face task”sourceBase64
Section titled “sourceBase64”- Type: string
- Required: Yes
- Description: Base64-encoded source face image
- Requirement: The image must contain a clear face
targetBase64
Section titled “targetBase64”- Type: string
- Required: Yes
- Description: Base64-encoded target image
- Requirement: The image must contain the face to be replaced
Execute an Action
Section titled “Execute an Action”chooseSameChannel
Section titled “chooseSameChannel”- Type: boolean
- Required: No
- Default:
false - Description: Whether to choose an account in the same channel
customId
Section titled “customId”- Type: string
- Required: Yes
- Description: Action identifier
- Format: A string in a specific format, such as
"MJ::JOB::upsample::1::xxx"
taskId
Section titled “taskId”- Type: string
- Required: Yes
- Description: The task ID on which to perform the action
Upload files to Discord
Section titled “Upload files to Discord”base64Array
Section titled “base64Array”- Type: string array
- Required: Yes
- Description: Base64-encoded array of images to upload
filter
Section titled “filter”- Type: object
- Required: No
- Properties:
- channelId: target channel ID
- instanceId: account instance ID
- remark: remark information
Query tasks by ID list
Section titled “Query tasks by ID list”- Type: string array
- Required: Yes
- Description: List of task IDs to query
Common Response Format
Section titled “Common Response Format”All endpoints return a similar response structure:
- Type: integer
- Description: Status code
| Status Code | Description |
|---|---|
| 1 | Submitted successfully |
| 22 | Task queued |
| 21 | Invalid parameters |
| 23 | System error |
| 24 | Account unavailable |
| 25 | Insufficient balance |
description
Section titled “description”- Type: string
- Description: Response description
properties
Section titled “properties”- Type: object
- Description: Extended properties
result
Section titled “result”- Type: string or array
- Description: Returned result, which may be a task ID or other data
📥 Response
Section titled “📥 Response”Successful Response
Section titled “Successful Response”action
Section titled “action”- Type: enum string
- Description: Task type
| String Value | Description |
|---|---|
| IMAGINE | Create image |
| UPSCALE | Upscale image |
| VARIATION | Generate variation |
| ZOOM | Zoom image |
| PAN | Shift image |
| DESCRIBE | Image description |
| BLEND | Image blending |
| SHORTEN | Shorten prompt |
| SWAP_FACE | Face replacement |
buttons
Section titled “buttons”- Type: object array
- Description: Action buttons that can be executed
| Array Field | Description |
|---|---|
| customId | Action identifier |
| emoji | Button icon |
| label | Button text |
| style | Style (2=Primary, 3=Green) |
| type | Type used internally by the system |
description
Section titled “description”- Type: string
- Description: Task description
failReason
Section titled “failReason”- Type: string
- Description: Reason the task failed
finishTime
Section titled “finishTime”- Type: integer
- Description: Task completion timestamp
- Type: string
- Description: Unique task identifier
imageUrl
Section titled “imageUrl”- Type: string
- Description: URL of the generated image
progress
Section titled “progress”- Type: string
- Description: Task progress information
prompt
Section titled “prompt”- Type: string
- Description: Original prompt
promptEn
Section titled “promptEn”- Type: string
- Description: English prompt
status
Section titled “status”- Type: enum string
- Description: Task status
| String Value | Description |
|---|---|
| NOT_START | Not started |
| SUBMITTED | Submitted |
| MODAL | In modal operation |
| IN_PROGRESS | In progress |
| FAILURE | Failed |
| SUCCESS | Success |
| CANCEL | Canceled |
submitTime
Section titled “submitTime”- Type: integer
- Description: Task submission timestamp
startTime
Section titled “startTime”- Type: integer
- Description: Task start execution timestamp
Error Response
Section titled “Error Response”When a request encounters an issue, the API returns an error response:
HTTP Status Codes
Section titled “HTTP Status Codes”- 400 Bad Request: Invalid request parameters
- 401 Unauthorized: API key is invalid or missing
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource does not exist
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error :