Nodes/ComfyUI_Isulion Random Prompt Generator/๐Ÿ•น๏ธ Isulion Mega Prompt V4
ComfyUI Node

๐Ÿ•น๏ธ Isulion Mega Prompt V4

The Prompt Slot Machine That Re-Rolls on Every Queue

By IsulionยทCreated 2 years agoยทUpdated 22 days agoยท 44
๐Ÿ•น๏ธ Isulion Mega Prompt V4
    • prompt
    โ—„machine_state{"version": 1}โ–บ

    The node draws a slot machine on the canvas. Five reels, a PULL lever, 109 themes, and one string coming out the right-hand side. It's a prompt generator that refuses to look like a prompt generator, and the joke is load-bearing: the lever, the locks and the reels are all there to teach you the one thing that matters about it, which is that it re-rolls every single time you hit Queue.

    What it's for

    Mega Prompt V4 picks a theme, draws a subject, place, style and effects from that theme's word lists, and glues them into one comma-separated string. Lock a reel and it holds; leave it unlocked and it changes every draw.

    Its predecessor, V3, exposes each component as its own output (prompt, subject, environment, style, effects, seed); V4 gives you one. If you need the pieces apart, use V3.

    How it works

    The frontend owns a small versioned JSON object and stuffs it into the node's hidden machine_state widget: which theme, the five reels with their text, lock flags, enable flags, custom subject/location text, a complexity setting, a LoRA string, and a frozen_prompt. Python parses that strictly - version must be 1 and every field is type-checked, with anything invalid quietly falling back to defaults. Then it rolls only the unlocked, enabled reels using the V3 theme handlers (under a lock, because the handlers set the RNG globally), draws a 32-bit random seed, and assembles the prompt: each segment's text, comma-joined, deduplicated, plus a suffix for the complexity level, plus your LoRA text at the end.

    Pulling the lever doesn't queue anything. The frontend POSTs to the pack's own /isulion/megaprompt_v4/roll route and paints the result, so you can spin forty times for free and only queue the one you liked.

    The second one is IS_CHANGED returning NaN - the always-dirty idiom that forces a node to run every time, because NaN never equals itself and ComfyUI's cache check can't rule it out. Consequence: every queue re-rolls the machine and re-executes everything behind it. That's right for a randomiser, and it's why mixing this node into a large graph you were hoping to partially cache is a bad idea.

    Inputs and outputs

    You don't set anything by hand. machine_state is a STRING holding the JSON, hidden by the node's JS, and it's saved with the workflow - so theme, locks, your own subject/place text, complexity and LoRA all persist when you save and share the graph. Don't edit the JSON yourself; a wrong version key resets the whole thing to defaults without a word.

    The output is prompt (STRING) - wire it into CLIPTextEncode. It's also marked as an output node, so it renders its draw preview as part of the run and can sit as the terminal node of a prompt-only workflow.

    On screen, the settings that actually matter: lock a reel to keep it (picking a theme locks it; leave the theme unlocked for a random one each run), your own text on SUBJECT and PLACE so the theme writes around your idea instead of ignoring it, and EDIT, which freezes a hand-written prompt that gets sent verbatim until you pull the lever again.

    The complexity setting is not free quality

    SIMPLE, DETAILED and COMPLEX append different boilerplate: nothing, highly detailed, sharp focus, or a block ending in masterpiece, cinematic composition, dramatic lighting. On the SDXL lineage and anime tag models - Illustrious, NoobAI, Pony - that's still doing real work. On anything with a sentence-shaped text encoder (Flux, Chroma, Z-Image), masterpiece, best quality was never in the vocabulary and gets discarded. So with a modern model, set SIMPLE and treat the output as a starting point. It's inherently tag-shaped, being fragments joined with commas, which suits CLIP-era prompting and is mediocre for models that want a paragraph.

    Installing it

    ComfyUI Manager โ†’ Custom Nodes Manager โ†’ search Isulion โ†’ install โ†’ restart. Manually:

    cd your_ComfyUI_install_dir/custom_nodes
    git clone https://github.com/Isulion/ComfyUI_Isulion
    

    Then restart and hard-refresh the browser (Ctrl+Shift+R). Unlike the FLUX examples floating around for the older V3 workflows, V4 needs no models, no GGUF loader, and no Ollama - the pack's only Python dependency is requests. The themed word lists are JSON files shipped in the repo.

    Where it goes wrong

    You see a text box full of {"version": 1} instead of a slot machine. The frontend failed to load - stale browser cache, almost always. Hard refresh; if it persists, check that the pack's web/ folder exists and that no browser extension is blocking the /isulion/megaprompt_v4/* routes.

    Your workflow stopped being reproducible. That's the node doing its job: every queue is a new seed. Found a draw you like? Click it in the last-five list and save it as a favourite, or hit EDIT to freeze the text, or lock the reels. The footer shows the seed, which is the other way back.

    It costs more than you think. The node is always dirty, so a graph that used to skip a cached encode-and-sample now reruns it each queue. Fine for a prompt generator, a mystery slowdown when bolted onto a 200-node video graph.

    CategoryIsulion/Core

    Inputs (1)

    NameTypeDefaultDescription
    machine_stateSTRING{"version": 1}โ€”

    Outputs (1)

    NameTypeDescription
    promptSTRINGโ€”