Nodes/Nukun_ComfyUI_Nodes/Random Vocab String List (Nukun)
ComfyUI Node

Random Vocab String List (Nukun)

Deterministic random prompts, without the repeat-everything problem

By OnekoSL·Created 3 months ago·Updated 11 days ago· 1
Random Vocab String List (Nukun)
    • STRING
    vocab_fileresources/Anima2B_Artist_Index_59k.txt
    amount10
    seed0
    chain

    "Random prompt" nodes usually disappoint in one of two ways: they repeat the same handful of words because sampling from a small list with replacement is a small world, or they're genuinely random and you can't reproduce a good run. This node dodges both with a shuffle-bag approach. It reads a vocabulary file, shuffles it deterministically, and hands you a slice - increment the seed and you walk through non-overlapping blocks, so ten queued runs cover ten different corners of the vocabulary before anything repeats. Reproducible and varied at the same time. That's a real feature, not a gimmick.

    The intended role in this pack is as the front-end for the Ollama Prompt Refiner: random words in, curated split prompts out. On its own, though, it's a perfectly good way to add controlled randomness to any workflow that wants a text input.

    How it works

    Pick a vocab_file from the dropdown - the pack bundles 30+ files covering places, objects, animals, verbs, nouns, adjectives, *ing words, camera/composition terms, quality tags, person names, countries, cities, and 250 visual art styles, plus little_doom_*.csv files with LoRA keyword subsets. It also reads ComfyUI/user/vocab.json if you have one. Words are deduplicated before sampling, and amount gets clamped to the vocabulary size, so asking for 50 words from a 12-word file gives you 12, not an error.

    The seed widget is the cursor. With control-after-generate on increment, each queued run moves to the next shuffled block; randomize jumps to another block. Want to grow a prompt? Connect the optional chain input and generated words append after it. That's the whole interface: vocab_file, amount, seed, optional chain, one STRING output.

    The formats are plain comma-separated text. The bundled guide warns about the one parsing gotcha: no leading spaces after commas (tag_a,tag_b not tag_a, tag_b), and the same applies to any custom files you drop into custom_nodes/Nukun_ComfyUI_Nodes/resources/. .csv, .txt, and .json all work.

    Where it sits in a workflow

    Straightforward: output → prompt encoder, or output → Ollama Prompt Refiner's word_salad for the full pipeline. If one file isn't enough variety, the pack's Multi Vocab String List (Nukun) combines four vocab files with independent amount and word_index cursors per slot.

    Installing it

    Nothing special - it's just text parsing:

    cd ComfyUI/custom_nodes
    git clone https://github.com/OnekoSL/Nukun_ComfyUI_Nodes.git
    

    Restart ComfyUI, or install via Manager (search "Nukun"). No model downloads, no dependencies beyond the pack's own.

    Common issues

    The beginner trap is expecting the seed to act like a normal random seed. It doesn't - it's a block cursor, so incrementing by 1 gives you a different block, but incrementing by 50 might wrap you back near the same block you saw before. If your random prompts feel less random than you'd like, it's because a shuffle-bag guarantees coverage over variety; that's the trade you're buying reproducibility with. Also check your vocabulary file if you're seeing repeats across the whole range - a short list reshuffles fast no matter how clever the bag is. And if you add a custom file and it doesn't show in the dropdown, restart ComfyUI; the node scans resources/ at load time.

    CategoryNukun/Text

    Inputs (4)

    NameTypeDefaultDescription
    vocab_fileCOMBOresources/Anima2B_Artist_Index_59k.txtComma-separated word list to sample from. Add .csv, .txt, or .json files to this node pack's resources folder.
    amountINT101–10000Number of random words to output. Clamped to the number of available vocab words.
    seedINT00–18446744073709550000Shuffle-bag block cursor for deterministic random words. Increment this to walk the vocabulary without repeats before reshuffling.
    chainoptSTRINGOptional incoming string. When connected, generated words are appended after it.

    Outputs (1)

    NameTypeDescription
    STRINGSTRING