Nodes/ComfyUI-nkxx/2. MJ 全局查询 (Query)
ComfyUI Node

2. MJ 全局查询 (Query)

See every Midjourney task on the Wujiai channel at a glance

By nkxx188·Created 11 months ago·Updated 6 months ago· 14
2. MJ 全局查询 (Query)
    • report
    api_key

    Second step in the four-node MJ flow (1. Imagine → 2. Query → 3. Action → 4. Result), and the "全局" in the name is doing real work: this one lists every MJ task on the Wujiai channel, not just the one you submitted last. After an MJImagineSubmit fires, this node tells you what state that job is in - queued, rendering, done, failed - so you know whether to sit tight or move on to MJGetResult.

    It's the sparsest node in the pack: zero required inputs, one optional api_key, one report STRING output. It's also an output-only control node (is_output_node: true), which is ComfyUI's way of saying "this is a sink you run and read from, it doesn't feed anything." You run it, you read the report, you decide.

    Why "global" matters

    Because MJ has multiple jobs in flight - an Imagine from an hour ago, an upscale you triggered, a reroll you forgot about. The query node surfaces all of them with their status, which is exactly the visibility you want before you spend money on step 3. The pattern here is the same enterprise async ledger the pack advertises on the Grsai side (a thread-safe task database that survives restarts), just scoped to the Wujiai channel's MJ tasks.

    Using it

    Practically: wire MJImagineSubmit → (wait) → MJQueryTasks → read report → when your task reads done → MJGetResult. In a loop or batch workflow you'd re-run query until the target task's status flips. Since it's a control node, its report output typically lands on a text/display node so you can actually see it.

    The api_key is optional because the pack falls back to the channel-level Wujiai key. One thing worth stressing: use the same key family as your Imagine. If Imagine ran on key A but query uses key B, "global" only sees key B's world, and your task looks missing.

    Install

    Same pack, one install:

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

    restart (or ComfyUI Manager, search "ComfyUI-nkxx"). The auto-installer pulls requests, pandas, openpyxl, yt-dlp, opencv-python, aiohttp on first launch. No models, no VRAM - a query is a network call, and unlike Imagine it doesn't spend generation credits (status checks are just status checks).

    Common issues

    • Empty report after an Imagine: key mismatch between the submit and query nodes is the classic cause, or the Imagine actually failed - check its report text.
    • Task stuck "rendering": the Wujiai queue owns that; re-querying doesn't speed it up. A failed job will eventually surface as failed.
    • Trust note: the Wujiai-side nodes ship obfuscated in this pack (base64+zlib exec blobs, not readable source). For a read-only status node that's low-stakes, but it's the same trust decision as the rest of the Wujiai side.
    CategoryNkxx/Wujiai/MJ

    Inputs (1)

    NameTypeDefaultDescription
    api_keyoptSTRING

    Outputs (1)

    NameTypeDescription
    reportSTRING