Generate images and wait for them
imagineGenerate images from a text prompt and receive direct image URLs once the Midjourney job finishes.
Instructions
Generate images from a prompt, wait for the job to finish, and return the results with direct image URLs. This is the tool to reach for by default: it does the whole job rather than handing back an id to poll.
A fast-mode job usually finishes in 30-60 seconds and this call blocks for that long. Relax mode queues and can take many minutes, so raise MIDJOURNEY_JOB_TIMEOUT_MS or use submit_imagine instead if you do not want to wait.
Set save to true to also write the files to disk and get back local paths, which is what you want when the images are going to be used rather than looked at.
Costs GPU time from the Midjourney plan and cannot be refunded, so it needs confirm: true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exp | No | 0-100. Experimental aesthetics on v7. Sent as --exp. | |
| raw | No | Shorthand for style 'raw'. | |
| niji | No | Niji model version, for example '6'. The anime-oriented model line. Sent as --niji, and it ignores version. | |
| save | No | Also download the finished images to disk and return their local paths. | |
| seed | No | 0-4294967295. Reusing a seed with an identical prompt gives a near-identical result, which is how you iterate on one image rather than rolling a new one. Sent as --seed. | |
| stop | No | 10-100. Stop rendering early for a blurrier, faster result. | |
| tile | No | Make a seamlessly tiling image. Sent as --tile. | |
| chaos | No | 0-100. How different the four results are from each other. Sent as --chaos. | |
| draft | No | Draft mode: much faster and cheaper, lower fidelity. Sent as --draft. | |
| speed | No | Generation speed. 'fast' burns fast-hours and takes under a minute. 'relax' is unlimited on Standard and above but queues, often for several minutes. 'turbo' is quickest and costs double. Defaults to MIDJOURNEY_DEFAULT_SPEED, itself 'fast'. | |
| style | No | Style modifier, most usefully 'raw' for less automatic prettification. Sent as --style. | |
| weird | No | 0-3000. Pushes toward the unusual. Sent as --weird. | |
| aspect | No | Aspect ratio as width:height, for example '16:9', '3:2', '1:1'. Sent as --ar. | |
| prompt | Yes | The subject text, in plain words. Do not put --parameters in here; use the fields below, which are validated before anything is spent. Midjourney reads the start of a prompt as the most important part. | |
| repeat | No | 1-40. Run the prompt this many times. Multiplies the cost. | |
| confirm | No | Must be true for this to run. This call spends GPU time from the Midjourney plan, or cannot be undone, so it is refused without an explicit confirmation. | |
| out_dir | No | Where to save, when save is true. Defaults to MIDJOURNEY_DOWNLOAD_DIR. | |
| private | No | Keep the result off the public feed. Requires a plan that allows stealth mode. | |
| profile | No | Personalisation profile id, or 'auto' for this account's own. Sent as --profile. | |
| quality | No | 0.25, 0.5, 1, 2 or 4. Render time and therefore cost. Sent as --q. | |
| stylize | No | 0-1000. How strongly Midjourney applies its own aesthetic. Low follows the prompt literally, high makes prettier but less faithful images. Default is 100. Sent as --stylize. | |
| version | No | Model version, for example '7' or '6.1'. Sent as --v. Cannot be combined with niji. | |
| negative | No | Things to keep out, comma separated, for example 'text, watermark'. Sent as --no. | |
| moodboard | No | Use one of the account's moodboards as the style, by name or id. Partial names work: 'High Fashion' finds 'High Fashion | Woman'. Its images are sent as style references, so this is the shorthand for building a look you have already curated. Call list_moodboards to see them. | |
| omni_refs | No | Omni references, for carrying a character or object across images. An image URL or 'random'. Sent as --oref. This is the v7 replacement for --cref. | |
| style_refs | No | Style references, each an image URL, a numeric style code, or 'random'. Sent as --sref. Anything else is silently treated as prompt text by Midjourney, so this is validated here first. | |
| timeout_ms | No | How long to wait before giving up on the job. Defaults to MIDJOURNEY_JOB_TIMEOUT_MS. | |
| omni_weight | No | 0-1000. How strongly omni references apply. Sent as --ow. | |
| image_weight | No | 0-3. How much the image prompts matter against the text. Sent as --iw. | |
| style_weight | No | 0-1000. How strongly the style references apply. Sent as --sw. | |
| image_prompts | No | Direct URLs to images used as visual input, each ending in .png, .jpg, .jpeg, .webp or .gif. A link to the page an image sits on will not work. These are prepended to the prompt, which is what Midjourney expects. | |
| moodboard_refs | No | How many images to take from the moodboard, 1-10. Defaults to 4. They are spread across the board rather than taken from the front, so a large board does not always draw on its oldest images. |