⌘K

MidJourney Uploadpaint

midjourney_uploadpaint

MidJourney Uploadpaint allows custom image uploads for advanced painting and editing operations.

MidJourney API Notes

The MidJourney API is divided into two categories: Direct Generation and Secondary Editing. Direct Generation only requires providing necessary parameters such as prompts to generate images directly. Secondary Editing requires providing the previous task ID and image number to execute image generation. uploadpaint is a Direct Generation category

Authentication

authorization string required

All APIs require authentication via Bearer Token.

Get API Key:

Visit API Key Management Page to get your API Key

Usage:

Add to request header:

Authorization: Bearer YOUR_API_KEY

Parameters

model string required

Model ID to use for the request

Options: midjourney_uploadpaint


imgUrl string required

Image URL, must be valid HTTP/HTTPS URL, length not exceeding 1024 characters


canvas object required

Canvas object

width integer required

Width in pixels

height integer required

Height in pixels


imgPos object required

Image position and size relative to canvas

x integer required

Horizontal offset from the top-left corner of canvas

y integer required

Vertical offset from the top-left corner of canvas

width integer required

Width in pixels

height integer required

Height in pixels


mask object required

Mask parameters, must contain areas or url

areas array

Array of mask area objects

width integer

Area width

height integer

Area height

points array

Array of area coordinate points, must contain at least 6 coordinate values

url string

Mask image URL


remixPrompt string required

Remix prompt, length must be between 1-8192 characters


callback string

Callback URL, must be valid HTTP/HTTPS URL


Polling

Since result generation takes time, you need to poll the task status after creating the task.

The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.

See the examples on the right for polling requests and responses.

Response Format

error object

Error information, only present when status is failed

code integer

Error code

error_message string

Detailed error message


output array

Generation results, only present when status is completed

content array

List of generated content

type string

Resource type, e.g., video, image

url string

Generated content URL


usage object

Usage statistics, only present when status is completed

cost string

Total cost in USD

discount number

Discount amount


metadata object

Metadata information


Error Codes

Error CodeDescription
004014001Image URL missing
004014002Invalid image URL length
004014003Invalid image URL format
004014004Canvas parameters missing
004014005Invalid canvas parameters
004014006Image position parameters missing
004014007Invalid image position parameters
004014008Mask parameters missing
004014009Invalid mask parameters
004014010Remix prompt missing
004014011Invalid remix prompt length
004014012Invalid callback URL
004014098Generation failed
004014099Service unavailable