Nodes/ComfyUI-Prompter-fofrAI/List sampler 🪴
ComfyUI Node

List sampler 🪴

The List sampler that lets you peek inside the prompt lists

By fofr·Created 2 years ago·Updated 2 years ago· 80
List sampler 🪴
    • STRING
    ◄list_name▾►
    â—„modesequentialâ–º
    â—„number_of_items1â–º
    â—„join_with, â–º
    â—„index0â–º
    â—„seed0â–º

    The README is honest about what this node is for: "You can use the list sampler node to see what prompt lists are available." It's the sidekick to the pack's other node, Prompt from template - but it's also a perfectly usable picker on its own. The idea is that a few hundred curated phrase lists (characters, animals, camera stock, colors, years...) ship inside the pack, and this node is how you poke at them and pull items out.

    It fills the same niche as the old A1111 wildcard tricks - {brown|blonde|black} style alternation for generating variety - but with curated, categorized lists instead of hand-rolled text files, and it plays nice with ComfyUI's batch workflow (which is where the seed reproducibility matters).

    Here's the inputs tour, since only a few matter. list_name is a dropdown with 238 curated lists covering categories like animal, architecture, character, cinematic, interaction and time - this dropdown is the "see what lists are available" feature. mode flips between random and sequential (default sequential). Then:

    • number_of_items - how many entries to pull (default 1)
    • join_with - the separator between them, default ", "
    • index - your steering wheel in sequential mode
    • seed - makes random mode reproducible

    How it works is worth understanding because of one clever detail. In sequential mode the node slices the list starting at index - list[index : index + number_of_items] - and wraps around when you hit the end. The index input is flagged control_after_generate, so ComfyUI auto-increments it after every run. That means you can queue up a batch and step through an entire list in order: pick animal.dogBreed, set index 0, queue 20 runs, and you get 20 different breeds with no repeats. That's a great trick for character sheets or outfit variation studies. In random mode the seed does the work instead (Python's random.sample, so no duplicates within one pull either), and index does nothing - don't be surprised.

    The output is a single STRING. Wire it into the text input of a CLIP Text Encode node, feed it into the Prompt from template node's template, or just attach a Show Text node while you're browsing lists.

    Install is the same as the rest of this pack: ComfyUI Manager (search "ComfyUI-Prompter-fofrAI") or

    cd ComfyUI/custom_nodes
    git clone --recursive https://github.com/fofr/ComfyUI-Prompter-fofrAI
    

    then restart. No models, no pip dependencies - pure stdlib. That --recursive matters, because the lists live in a git submodule; a plain clone leaves prompt-lists empty and the node will error on a missing lists.json instead of loading.

    Two things to keep in mind. A mistyped list name doesn't fail loudly - the node returns the literal [mistyped.name] string, which then sails into your prompt as junk text. And if you're on a fresh install that errors at load, the submodule didn't come along; reclone with --recursive and it's fixed. For a node whose whole job is browsing and sampling, that's the entire troubleshooting manual.

    CategoryPrompter

    Inputs (6)

    NameTypeDefaultDescription
    list_nameCOMBO238 options: animal.all, animal.bird, animal.deepSea, animal.dinosaur, animal.dogBreed, animal.insect, +232
    modeCOMBOsequential2 options: random, sequential
    number_of_itemsINT1—
    join_withSTRING, —
    indexINT00–18446744073709550000—
    seedINT00–18446744073709550000—

    Outputs (1)

    NameTypeDescription
    STRINGSTRING—