MidjourneyImagineNode
Midjourney inside ComfyUI — for real, but no GPU is doing the work
- image
- task_id
- buttons
Here's the honest pitch before you get excited: this node puts Midjourney inside a ComfyUI graph, but the image is not generated on your machine. Midjourney still has no public API, so this pack is a thin client for a third-party relay called 云雾 (Yunwu, at yunwu.ai) that runs the model for you and bills you per image. You get MJ's look in your workflow without owning a GPU big enough for the task - and in exchange you hand your prompts to a reseller and pay per generation. That trade is the entire node.
Why you'd reach for it
Midjourney remains the benchmark people compare open weights against - consistent artistic quality that needs almost no prompt craft (the KB's closed-source-models essay goes into why Flux closed the gap but MJ kept its identity). If your project needs that look as part of a ComfyUI pipeline - say, feed MJ output into an upscaler or use it as the base for an edit - this node is one way to get it without leaving the graph or screenshotting a Discord channel.
Mechanically it's simple. The node takes your prompt, appends classic MJ flags (--ar 1:1 --s 100 --v 6, plus the ones you toggle), and POSTs it to {api_url}/mj/submit/imagine. That returns a task_id, which the node polls via /mj/task/{id}/fetch every 3 seconds until it's SUCCESS, then downloads the result. You're watching a remote queue, not local inference.
The inputs that matter
- prompt - your text, multiline. You do NOT need MJ's
--arsyntax here; set the flags with the fields below. - base_model -
midjourneyorniji(MJ's anime-tuned model). - version -
5.0to6.1, default6. Note--vonly gets appended when base_model isn't niji.
The ones worth touching after that: image_ratio (1:1, 4:3, 3:4, 16:9, 9:16), stylize (0–1000), chaos (0–100, adds variety), weird (0–3000, the fun one), tile and q2 (quality ×2), sref (a style-reference URL/code), repeat (1–40, how many grids), and seed (-1 = random). These map 1:1 to the Discord flags, so whatever you know from MJ applies.
Outputs and what to wire
- image - the IMAGE tensor; this is MJ's standard 2×2 grid. Preview it or save it directly.
- task_id - a STRING. This is the important one: wire it into Midjourney Upscale/Variation or Batch Upscale/Variation from the same pack to turn a grid cell into a full-size image.
- buttons - a DICT of the action buttons MJ returned. The action nodes re-fetch this themselves, so treat it as informational.
Installing
Via ComfyUI Manager (search "ComfyUI-MidjourneyHub") or:
cd ComfyUI/custom_nodes
git clone https://github.com/jiaqianjing/ComfyUI-MidjourneyHub
# restart ComfyUI
Dependencies are light (aiohttp, openai, nest_asyncio; torch/numpy/Pillow are already in ComfyUI). The real setup step is config.ini inside the pack folder: put your own key and URL under [MIDJOURNEY_API]. The repo ships the author's keys committed to the file - replace them before running anything, for everyone's sake.
Where people get burned
The relay's README is in Chinese, the console is Chinese, and this pack lives at the intersection of "unofficial MJ API" and "Chinese API reseller" - two worlds with basically zero English-community coverage. Official Midjourney has called unofficial APIs ToS violations before, so treat the service as best-effort. The most common real error is the relay refusing a model for your billing group ("当前分组 ... 无可用渠道") - that means your token group can't access it and you need a pricier plan tier. And the author warns the api_url can change without notice, so if jobs suddenly fail, that's the first thing to check.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | cat,cute, | — |
| base_model | COMBO | midjourney | 2 options: midjourney, niji |
| version | COMBO | 6 | 5 options: 5.0, 5.1, 5.2, 6, 6.1 |
| image_ratioopt | COMBO | 1:1 | 5 options: 1:1, 4:3, 3:4, 16:9, 9:16 |
| stylizeopt | INT | 1000–1000 | — |
| chaosopt | INT | 00–100 | — |
| weirdopt | INT | 00–3000 | — |
| tileopt | BOOLEAN | false | — |
| q2opt | BOOLEAN | false | — |
| srefopt | STRING | — | |
| repeatopt | INT | 11–40 | — |
| seedopt | INT | -1 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| task_id | STRING | — |
| buttons | DICT | — |