Nodes/TrentNodes/Midjourney Batch Actions
ComfyUI Node

Midjourney Batch Actions

All four upscales or all four variations, in parallel

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Midjourney Batch Actions
  • buttons
  • slot1
  • slot2
  • slot3
  • slot4
task_id
modeU1-U4
api_key
api_urlhttps://yunwu.ai

Midjourney's grid gives you four candidates, and the natural next move is "let me see all four upscaled so I can pick the best." Midjourney Batch Actions is that move in one node: it fires all four upscales (U1–U4) or all four variations (V1–V4) concurrently through a thread pool and hands you four separate IMAGE outputs.

It's the bulk sibling of Midjourney Action. Where that node does one U or V, this one does all four at once - and because they run in parallel rather than serially, four calls cost roughly the wall-clock time of one. That's the whole pitch, and it's a good one when you're iterating on a concept and want to compare the four full-size candidates side by side.

Inputs

  • task_id - from Midjourney Imagine.
  • buttons - the label→customId DICT from the same Imagine run.
  • mode - U1-U4 (upscales, default) or V1-V4 (variations).
  • api_key - Yunwu key, MJ_API_KEY env fallback.
  • api_url - provider, default https://yunwu.ai.

Outputs are four IMAGE sockets, plainly named slot1 through slot4, one per action. The ordering is stable (U1/V1 → slot1, etc.), so you can wire them to a four-up comparison grid or a switch without guessing which is which.

How it works

Under the hood it's a ThreadPoolExecutor running four MidjourneyAction-style submissions against the same task, each resolving its custom button ID from the buttons map and downloading the result. Same matched-pair requirement: task_id and buttons must come from one Imagine output, or you'll get a button-not-found error listing what is available.

Install

Part of TrentNodes:

cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes
pip install -r requirements.txt

Restart, look under Trent/Midjourney.

Gotchas and honest notes

The obvious one first: four actions is four paid API calls, every time you run it. It's convenient; it is not cheap if you're looping. Second, parallel calls can hit provider rate limits on busy resellers - if one slot errors while the others succeed, that's usually rate limiting, not a broken node. Third, the same credential hygiene as the rest of the family: env var over a pasted key. And worth saying plainly: this whole Midjourney family rides on a niche third-party reseller (Yunwu) that has essentially no community track record, so before you build a production pipeline on it, verify the provider's current pricing and reliability - the pattern is sound, but your mileage depends on someone else's uptime.

CategoryTrent/Midjourney

Inputs (5)

NameTypeDefaultDescription
task_idSTRING
buttonsDICT
modeCOMBOU1-U42 options: U1-U4, V1-V4
api_keySTRING
api_urloptSTRINGhttps://yunwu.ai

Outputs (4)

NameTypeDescription
slot1IMAGE
slot2IMAGE
slot3IMAGE
slot4IMAGE