Nodes/Quality of life Suit:V2/ConcatRandomNSP_O
ComfyUI Node

ConcatRandomNSP_O

Append a random term to your prompt mid-graph

By omar92·Created 3 years ago·Updated 5 months ago· 180
ConcatRandomNSP_O
    • STRING
    text
    terminology
    separator,
    seed0

    Want to shake up your prompts without hand-writing forty variations? That's the whole job of ConcatRandomNSP_O. You feed it a base string, pick a category, and it appends a random term from that category - so every run of your workflow gets a slightly different prompt. It's the "in-route modifier" version of the pack's RandomNSP _O: instead of a standalone random term, it splices one onto text you already have.

    It lives under O/text/NSP, where NSP stands for Noodle Soup Prompts - a community-maintained collection of categorised prompt terms. The pack downloads the term list on first use and caches it locally, so there's nothing to configure and no model file to hunt down. That's the appeal: instant vocabulary injection for artists, styles, subjects, lighting, and dozens of other categories.

    What you actually set

    Four inputs, and only three matter:

    • text - your existing prompt string
    • terminology - the category dropdown (82 of them, from artist and style to fantasy-creature and noun-horror)
    • separator - what goes between your text and the random term (default ,)
    • seed - controls which term you get; same seed, same term

    The output is a single STRING: your text, plus separator, plus a random term from the chosen category. Wire it into a CLIP Text Encode and you're rolling dice with every queue.

    The quirk you'll notice immediately

    Read the source and you'll see the return is text + separator + result + separator. Yes - it appends the separator after the random term too, so your output ends with a dangling comma. For most CLIP-based models (SD 1.5, SDXL line) a trailing comma is harmless - the encoder just tokenizes it and moves on. But it's the kind of thing that makes a careful prompt tinkerer twitch, and if you're feeding the output somewhere that parses tags strictly, trim it. Easy enough to work around with a Trim Text node, just don't assume the output is clean.

    Also note the seed handling: it reseeds Python's global random with your seed before picking, so within a single run the pick is deterministic. Change the seed and you get a different term. Same seed plus a different category naturally gives a different result.

    Where this shines

    NSP is great for variations and bad for consistency. Batch a few seeds and you get a spread of stylistic takes on one subject - useful for moodboarding or for "surprise me" testing when you're bored of your own prompt voice. If you need reproducible output for a deliverable, lock the seed. And a genuinely useful trick: put the randomizer on a secondary prompt branch that gets blended at low weight, so the base composition stays stable and only the flavor shifts.

    One caution, straight from the KB's prompt-engineering doc: random tag soup is a 2023-era habit that still works on the SDXL lineage, but on newer LLM-encoded models the "add a random word" trick does much less than it used to - the model treats the whole prompt as an instruction, not a token bag. Keep expectations calibrated by model family.

    Install

    It ships in the Quality of Life Suit (O/ menu). One install, whole pack:

    cd <ComfyUI root>/custom_nodes
    git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
    

    Then restart ComfyUI - a browser reload won't load new nodes. The pack creates a config.json on first run and auto-updates from GitHub on every start; set "autoUpdate": false in that file if you want it to stop. First time you use an NSP node it fetches the pantry from GitHub, so give it a few seconds before the category dropdown fills in.

    CategoryO/text/NSP

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING
    terminologyCOMBO82 options: fantasy-creature, gen-modifier, adj-beauty, noun-beauty, noun-fantasy, adj-horror, +76
    separatorSTRING,
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING