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

Multi Vocab String List (Nukun)

Four wildcard decks on one node, each with its own increment cursor

By OnekoSL·Created 3 months ago·Updated 11 days ago· 1
Multi Vocab String List (Nukun)
    • combined
    • slot_1
    • slot_2
    • slot_3
    • slot_4
    vocab_file_1resources/Anima2B_Artist_Index_59k.txt
    amount_13
    word_index_10
    vocab_file_2resources/Anima2B_Artist_Index_59k.txt
    amount_23
    word_index_20
    vocab_file_3resources/Anima2B_Artist_Index_59k.txt
    amount_33
    word_index_30
    vocab_file_4resources/Anima2B_Artist_Index_59k.txt
    amount_43
    word_index_40
    chain

    Prompt mixing usually means a wildcard text file, a randomize seed, and a lot of squinting at your output trying to remember which combo made the good one. Multi Vocab String List (Nukun) attacks the other side of that problem: instead of one random grab-bag, it gives you four vocabulary slots, each with its own deterministic word cursor. You don't shuffle blindly - you walk through combinations like flipping cards, one at a time, and the good one is reproducible.

    How it works

    Each of the four slots has three widgets: a vocab_file picker, an amount (how many words to draw), and a word_index. The vocab file is a comma-separated word list - bundled resources like adjectives.csv, animals_mythical_creatures.csv, camera_composition.csv, visual_art_styles.csv, plus Little Doom LoRA keyword sets - or anything you drop into the pack's resources/ folder (.csv, .txt, or .json all work). It also reads ComfyUI/user/vocab.json.

    The clever part is word_index. It's a block cursor, not a per-word counter: incrementing it walks forward through non-overlapping shuffled blocks of words before reshuffling, so consecutive runs never overlap. With ComfyUI's control-after-generate dropdown you can keep, increment, decrement, or randomize each slot's cursor independently - one slot advances while another stays fixed, and every combination is replayable on the same seed.

    The inputs that matter

    • vocab_file_1..4 - which deck each slot draws from.
    • amount_1..4 - words per slot; 0 disables the slot, which is the intended way to use fewer than four.
    • word_index_1..4 - the block cursors. This is where the control-after-generate menu earns its keep.
    • chain (optional) - an incoming string; when connected, the combined output is appended after it.

    Outputs are combined (all active slots joined) plus slot_1 through slot_4 as separate strings, so you can wire individual slots to different encoders or keep one as a filename component.

    What it's good for

    This pack pairs it naturally with Ollama Prompt Refiner (Nukun) - feed the combined output in as a random "word salad" and let a local LLM turn it into a coherent prompt. But it's just as useful standing alone: put characters in slot 1, settings in slot 2, style in slot 3, camera in slot 4, and sweep the cursors. Amounts larger than the vocabulary clamp to the full list, and words are deduplicated before sampling, so you won't get "red red sky."

    Installing it

    It's in the Nukun_ComfyUI_Nodes pack - ComfyUI Manager (search "Nukun") or:

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

    Restart ComfyUI. No model downloads, just numpy/Pillow/scipy/PyWavelets. One gotcha: a new vocab file you add to resources/ only appears in the dropdown after a restart - the file list is built at load time. And if you want to freeze a good combo, note the word index and the seed, not just the words - that's what makes it reproducible.

    CategoryNukun/Text

    Inputs (13)

    NameTypeDefaultDescription
    vocab_file_1COMBOresources/Anima2B_Artist_Index_59k.txtComma-separated word list for slot 1.
    amount_1INT30–10000Number of words to output from slot 1. Use 0 to disable the slot.
    word_index_1INT00–18446744073709550000Block cursor for slot 1. Increment/decrement/randomize this to choose the next word block.
    vocab_file_2COMBOresources/Anima2B_Artist_Index_59k.txtComma-separated word list for slot 2.
    amount_2INT30–10000Number of words to output from slot 2. Use 0 to disable the slot.
    word_index_2INT00–18446744073709550000Block cursor for slot 2. Increment/decrement/randomize this to choose the next word block.
    vocab_file_3COMBOresources/Anima2B_Artist_Index_59k.txtComma-separated word list for slot 3.
    amount_3INT30–10000Number of words to output from slot 3. Use 0 to disable the slot.
    word_index_3INT00–18446744073709550000Block cursor for slot 3. Increment/decrement/randomize this to choose the next word block.
    vocab_file_4COMBOresources/Anima2B_Artist_Index_59k.txtComma-separated word list for slot 4.
    amount_4INT30–10000Number of words to output from slot 4. Use 0 to disable the slot.
    word_index_4INT00–18446744073709550000Block cursor for slot 4. Increment/decrement/randomize this to choose the next word block.
    chainoptSTRINGOptional incoming string. When connected, the combined output is appended after it.

    Outputs (5)

    NameTypeDescription
    combinedSTRING
    slot_1STRING
    slot_2STRING
    slot_3STRING
    slot_4STRING