API method
Midjourney blend via API
Same thing as /blend in Discord: you give Midjourney two to five pictures, it mixes them and returns a grid of four new images. No text prompt needed.
Updated
When it comes in handy
- A product photo plus a picture whose style or background you want.
- Two characters, or a character and a place, when describing them in words doesn't work well.
- Getting your own images into Midjourney so you can then upscale, vary, zoom or animate them.
Request
/midjourney/v2/blendBase URL is https://api.userapi.ai. Every request needs two headers, api-key and Content-Type: application/json.
{"urls": [{ "url": "https://example.com/image1.jpg", "ext": "jpg" },{ "url": "https://example.com/image2.png", "ext": "png" }],"webhook_url": "https://example.com/blend/webhook-url","webhook_type": "result","account_hash": "a7d44910-88a6-4673-acc8-d60ffc3479a6"}
Parameters
| Field | Required | Description |
|---|---|---|
urls | Yes | From 2 to 5 items, each with url and ext (jpg or png). |
webhook_url | No | Where we POST the task when its status changes. |
webhook_type | No | result: one call at the end (done or error). progress: also every progress update. |
account_hash | No | Which Discord account to use. If omitted, accounts on the key take turns. |
What comes back
The response is just the task hash, e.g. {"hash": "ed162774-9244-4038-bdf1-801b033809ec"}. The finished task is what you later get from GET /midjourney/v2/status?hash=… or in the webhook:
{"account_hash": "3b2c7341-ec22-0301-810d-9cf0543e20ba","hash": "fd88479e-455f-6a6f-6284-b0c49117d76f","urls": [{ "url": "https://example.com/image1.jpg", "ext": "jpg" },{ "url": "https://example.com/image2.jpg", "ext": "jpg" }],"type": "blend","status": "done","result": {"url": "https://cdn.discordapp.com/...6a65992f3587.png","proxy_url": "https://media.discordapp.net/...6a65992f3587.png","filename": "...-6a65992f3587.png","content_type": "image/png","width": 2048,"height": 2048,"size": 2145293},"status_reason": null}
You get a grid of four, just like from imagine. The blend hash can go straight into upscale or variation with choice 1-4.
| status | What it means |
|---|---|
sent | we passed the task on for processing |
waiting | Midjourney accepted it and put it in the queue |
progress | it is running, progress goes from 0 to 100 |
done | finished, the output is in result |
error | failed, see status_reason |
Example with cURL
1. Two images in
curl -X POST https://api.userapi.ai/midjourney/v2/blend \-H "Content-Type: application/json" \-H "api-key: $USERAPI_KEY" \-d '{"urls": [{"url": "https://example.com/product.png", "ext": "png"}, {"url": "https://example.com/style.jpg", "ext": "jpg"}]}'
2. Wait for the grid
curl "https://api.userapi.ai/midjourney/v2/status?hash=BLEND_HASH" \-H "api-key: $USERAPI_KEY"
3. Upscale the one you like
curl -X POST https://api.userapi.ai/midjourney/v2/upscale \-H "Content-Type: application/json" \-H "api-key: $USERAPI_KEY" \-d '{"hash": "BLEND_HASH", "choice": 3}'
Wrappers for Python, Node.js and PHP are on separate pages. If you'd rather not write code, the same methods are available in n8n and Make. This method in the documentation.
Other methods
| Method | Endpoint (POST /midjourney/v2…) | Input |
|---|---|---|
| Imagine | /imagine | prompt |
| Upscale | /upscale | hash of imagine / blend / describe / animate + choice 1-4 |
| Upsample (Subtle, Creative, 2x, 4x) | /upsample | hash of upscale |
| Variation | /variation | hash of imagine / describe / blend + choice 1-4 |
| Vary (Subtle) / Vary (Strong) | /vary-subtle, /vary-strong | hash of upscale |
| Reroll | /reroll | hash of a task |
| Animate (video) | /animate | hash of upscale + high / low |
| Inpaint (Vary Region) | /inpaint | hash of upscale + mask + prompt |
| Zoom Out | /zoom | hash of upscale + 50 / 75 or prompt |
| Pan | /pan | hash of upscale + direction |
| Blend | /blend | 2-5 image URLs |
| Describe | /describe | image URL |
| Seed | /seed | hash of a task |
| Upload | /upload | PNG / JPG file or URL |
| Info, Speed, Prefer (Remix) | /info, /speed, /prefer | account_hash |
Try it on 50 free requests
Register, add a Discord account that has Midjourney, and you get an API key. The first 50 requests are free and you don't need to enter a card. Since 2023 more than 10,000 people have signed up and sent over 8 million requests through the API.
Questions
How many images can I blend?
Two to five per request, as with /blend in Discord.
Which formats?
jpg and png. Each image is a URL plus ext.
What does "Image denied" mean?
It is the error we see most often with blend: Midjourney refused one of the source images. Replace that image, retrying with the same set usually gives the same answer.
Can I add text to a blend?
blend itself only takes images. If you want text as well, use imagine and put the image URLs at the start of the prompt, then the text. Or turn on Remix for the account and run variation on the blend result with a prompt.
What next?
Anything you would do with an imagine result: upscale or variation, and on the upscaled image also upsample, vary, zoom, pan, inpaint or animate.