Nodes/ComfyUI-MidjourneyHub/MidjourneyImagineNode
ComfyUI Node

MidjourneyImagineNode

Midjourney inside ComfyUI — for real, but no GPU is doing the work

By jiaqianjing·Created 2 years ago·Updated 4 months ago· 18
MidjourneyImagineNode
    • image
    • task_id
    • buttons
    promptcat,cute,
    base_modelmidjourney
    version6
    image_ratio1:1
    stylize100
    chaos0
    weird0
    tilefalse
    q2false
    sref
    repeat1
    seed-1

    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 --ar syntax here; set the flags with the fields below.
    • base_model - midjourney or niji (MJ's anime-tuned model).
    • version - 5.0 to 6.1, default 6. Note --v only 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.

    CategoryMidjourneyHub

    Inputs (12)

    NameTypeDefaultDescription
    promptSTRINGcat,cute,
    base_modelCOMBOmidjourney2 options: midjourney, niji
    versionCOMBO65 options: 5.0, 5.1, 5.2, 6, 6.1
    image_ratiooptCOMBO1:15 options: 1:1, 4:3, 3:4, 16:9, 9:16
    stylizeoptINT1000–1000
    chaosoptINT00–100
    weirdoptINT00–3000
    tileoptBOOLEANfalse
    q2optBOOLEANfalse
    srefoptSTRING
    repeatoptINT11–40
    seedoptINT-1

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    task_idSTRING
    buttonsDICT