Nodes/ComfyUI-nkxx/1. MJ 生图提交 (Imagine)
ComfyUI Node

1. MJ 生图提交 (Imagine)

Midjourney inside ComfyUI, prompt, pad, sref, and all

By nkxx188·Created 11 months ago·Updated 6 months ago· 14
1. MJ 生图提交 (Imagine)
  • image_prompts
  • sref_images
  • character_refs
  • report
promptA cyberpunk cat
model_versionv7
aspect_ratio1:1
extra_args
api_key

Midjourney is a closed service, full stop - no weights, no local path, the community's poster child for "you can only call it." This node is the call, on the Wujiai channel, and it's the "1." in a numbered four-node MJ flow: 1. Imagine → 2. Query → 3. Action → 4. Get Result. The author has essentially recreated the MJ app inside ComfyUI, including the parts MJ users expect: style reference, character reference, and the U/V/Reroll buttons you normally click in Discord.

MJImagineSubmit is the submission front door. It takes a prompt, a model version, an aspect ratio, and up to three flavors of reference image, and it fires an Imagine - the "make me a 4-up grid" step - into the Wujiai service. Output is a single report STRING: the receipt identifying the task. That task is what the rest of the flow chases.

The inputs that matter

  • prompt (multiline) - your actual MJ prompt. Don't put --ar or --sref flags in here; those are separate inputs.
  • model_version - v7 (default), v6.1, v6.0, v5.2, or the anime line niji 7 / niji 6. This is the MJ version selector, straight from the app.
  • aspect_ratio - 1:1 (default), 16:9, 9:16, 3:4, 4:3, 2:3, 3:2.
  • extra_args (optional) - the tooltip is the author's own description: "可选附加参数,例如: --iw 1.5 --cw 50". So this is where MJ flags like image weight go.
  • image_prompts (optional IMAGE) - "常规垫图 (图生图)": plain image-as-input.
  • sref_images (optional IMAGE) - "风格参考 (--sref)": the style-reference socket.
  • character_refs (optional IMAGE) - "角色/物体参考 (自动适配 --cref / --oref)": character or object reference, auto-mapped to --cref/--oref.
  • api_key (optional) - falls back to the Wujiai key.

How it fits the wider workflow

The clever part is downstream. The Wujiai side of this pack adds frontend button interaction - the node panel exposes U/V/Reroll buttons you click directly, feeding MJActionSubmit. So your workflow becomes: Imagine here, check the grid with MJGetResult, then act on it (upscale a tile, make a variation, reroll) without leaving ComfyUI or typing a single slash command. If you've ever managed an MJ pipeline through Discord and copy-pasted URLs, this is the version where the graph does it.

Install & prerequisites

Same pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/jieg9341-lab/ComfyUI-nkxx

restart (or ComfyUI Manager, search "ComfyUI-nkxx"). First launch auto-installs requests, pandas, openpyxl, yt-dlp, opencv-python, aiohttp. No local models - this is a pure API wrapper, so the only hardware requirement is a network card. You need a Wujiai key from wujiai.org, and MJ calls are metered.

Common issues

  • Report but no grid: normal - Imagine only submits. You fetch the grid in step 4.
  • Ignored flags: put MJ flags in extra_args, not the prompt, or they may be treated as literal text.
  • Key missing: the Wujiai key has to be reachable - node field, WUJIAI_KEY env var, or pack-level config. A key that works for Grsai nodes won't satisfy this one.
  • Trust note: the Wujiai-side nodes ship obfuscated in the pack, so the Imagine call's exact behavior is behavior-only verifiable. It's a paid channel - test one cheap prompt first.
CategoryNkxx/Wujiai/MJ

Inputs (8)

NameTypeDefaultDescription
promptSTRINGA cyberpunk cat
model_versionCOMBOv76 options: v7, v6.1, niji 7, niji 6, v6.0, v5.2
aspect_ratioCOMBO1:17 options: 1:1, 16:9, 9:16, 3:4, 4:3, 2:3, +1
extra_argsoptSTRING可选附加参数,例如: --iw 1.5 --cw 50
api_keyoptSTRING
image_promptsoptIMAGE常规垫图 (图生图)
sref_imagesoptIMAGE风格参考 (--sref)
character_refsoptIMAGE角色/物体参考 (自动适配 --cref / --oref)

Outputs (1)

NameTypeDescription
reportSTRING