Nodes/ComfyUI_Catsapi/CatsAPI Midjourney
ComfyUI Node

CatsAPI Midjourney

Five Widgets, Four Images, Zero Local Sampling

By maodeyu180·Created 3 months ago·Updated 2 days ago· 1
CatsAPI Midjourney
    • images
    • file_paths
    • cost_coins
    • task_id
    • metadata
    prompt
    versionv7
    aspect_ratio1:1
    process_modefast
    max_coins0
    negative_prompt
    api_key_override

    You can't download Midjourney. No weights, no checkpoint, no safetensors - it's a hosted service, and the only "API" for years was somebody's Discord bot wrapper. So the only way to get MJ output inside a Comfy graph is a node that ships your prompt to a relay service and hands back the returned pixels as a normal IMAGE tensor.

    That's what this is. CatsAPI Midjourney looks like a generator on the canvas and behaves like an HTTP client underneath: it talks to catsapi.com, pays in that service's coins (猫币), and drops four Midjourney images into your graph. Reach for it when you want MJ's look - the artistic consistency people still pay for - but want it in the same workflow as your local upscaler and Save Image node, instead of tabbing to a web UI and re-importing by hand.

    How it actually works

    The node does four things in order, and the order matters:

    1. Preview the cost. It asks what this job will bill, and refuses to submit if the preview is malformed or your balance is short.
    2. Submit. Your prompt plus version, aspect_ratio and process_mode (sent as version, aspectRatio, processMode). negative_prompt goes along as negativePrompt only if you typed something.
    3. Poll every 3 seconds, up to a 900-second cap, then error out if the job isn't done.
    4. Download and convert. Files land in ComfyUI/output/catsapi/, then become a tensor for images.

    One billed task returns four images, and there's deliberately no num_images widget - the source comment says it submits num_images=1 because MJ prices per task, not per image. Your images output is a batch of four.

    The inputs and outputs that matter

    Five required fields, all short:

    • prompt - multiline, capped at 2500 characters. Ratio, version and mode do not go in here; they're widgets.
    • version - v7 (default), v6, or niji 6. Niji is the anime-tuned family, so that's your first call if you're doing illustration rather than photoreal.
    • aspect_ratio - 1:1, 16:9, 9:16, 4:3, 3:4, 1:2, 2:1. Seven options, no 21:9 weirdness.
    • process_mode - fast, turbo, relax. This is also the mode the cost preview prices against, so relax is the cheap/slow queue and turbo is the expensive one.
    • max_coins - 0 means no ceiling. A positive number blocks any job whose preview exceeds it. It's a pre-submission check, not a server-side price lock.

    Optional: negative_prompt and api_key_override, which you leave blank on your own machine.

    Outputs, all five: images (wire it to Preview Image, Save Image, or a local upscale step), file_paths (JSON list of downloaded local paths), cost_coins, task_id, and metadata (JSON with task_id, model, cost, params, paths). Grab task_id when something goes wrong; it's what you'll quote if you have to check a job on the site.

    Installing it

    ComfyUI Manager, search ComfyUI_Catsapi (or CatsAPI). Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/maodeyu180/ComfyUI_Catsapi.git
    

    Restart after. There's no requirements.txt in the repo - the client is stdlib urllib, and tensor conversion uses numpy/PIL/torch ComfyUI already ships - so no pip step to babysit. What you need is a key:

    export CATSAPI_API_KEY=cats-your-key
    python main.py
    

    If ComfyUI doesn't inherit your shell environment, the pack also reads a .env in the node folder, one in ComfyUI's launch directory, and ~/.catsapi.env. The key must start with cats-; a truncated paste containing ... is rejected before any request goes out. On hosted platforms like RunningHub, where you can't set server env vars, fill api_key_override - and remember ComfyUI saves widget values into workflow JSON, so don't share a workflow with that field filled in.

    Where people get burned

    • "No valid CATSAPI_API_KEY" on first run usually means the env var was set in a terminal ComfyUI didn't launch from. Restart it from that shell, or use a .env.
    • Poll timeout at 15 minutes. The cap is fixed in code, and relax is exactly the mode where MJ queues run long. If a run dies with "still in <status>", the task may still finish server-side and bill you - that's why the error carries the task_id.
    • It's text-to-image only. There's no reference-image input here, and MJ's inline flags (--sref, --stylize, --chaos) aren't widgets - ratio, version and mode come from the dropdowns.
    • Download failures are a hazard for any API wrapper; this pack hedges with browser-ish headers and a curl fallback when a CDN decides the default UA looks like a bot.

    One honest note: this puts your prompt on someone else's server and meters every call in coins. r/comfyui's prevailing attitude - an API node is the right tool for a model you cannot run locally and the wrong default for one you can - applies exactly here. For MJ there's no local option, so the tradeoff is real rather than lazy.


    Sources: ComfyUI_Catsapi README and the pack's nodes.py / catsapi_client.py (read 2026-09-16; polling cap, key validation, output paths); CatsAPI.

    CategoryCatsAPI/Image

    Inputs (7)

    NameTypeDefaultDescription
    promptSTRING
    versionCOMBOv73 options: v7, v6, niji 6
    aspect_ratioCOMBO1:17 options: 1:1, 16:9, 9:16, 4:3, 3:4, 1:2, +1
    process_modeCOMBOfast3 options: fast, turbo, relax
    max_coinsINT00–100000
    negative_promptoptSTRING
    api_key_overrideoptSTRING

    Outputs (5)

    NameTypeDescription
    imagesIMAGE
    file_pathsSTRING
    cost_coinsINT
    task_idSTRING
    metadataSTRING