Nodes/babydjac Nodes/No-Repeat Picker
ComfyUI Node

No-Repeat Picker

A Random Picker That Actually Remembers What It Picked

By babydjac·Created 7 months ago·Updated 5 months ago· 12
No-Repeat Picker
    • item
    items_text
    randomizetrue
    item_index0
    persist_keydefault
    reuse_lastfalse
    reset_historyfalse

    Random prompt pickers are everywhere, and they all share a flaw: every queue run is a fresh coin flip, so you get the same item three times in a row and wait forever for the one you actually wanted to test. The No-Repeat Picker fixes the actual complaint - it picks from a list, but remembers what it already picked, so consecutive runs cycle through your options without repeats. It's a small node from the babydjacNODES pack, and it's one of those "why didn't the core node do this" utilities.

    How it works

    You paste a list (one item per line) into items_text. Each run, the node:

    1. Loads a JSON state file it keeps in its own folder (.apk_no_repeat_state.json).
    2. Hashes your item list. If the list changed since the last run, it resets the "used" history - so editing the list doesn't carry stale state.
    3. Picks a random item among the unused ones. When everything's been picked, the history clears and the cycle restarts.

    The state is keyed by persist_key, so one node can maintain several independent rotation lists, and the history survives restarts - it's on disk, not in RAM. There's also randomize (turn it off to just index into the list via item_index), reuse_last (hand back the previous pick instead of a new one), and reset_history (clear the used set now).

    The inputs that matter

    • items_text - required, one item per line. This is your rotation list.
    • randomize - true by default; set false and it becomes an indexer using item_index.
    • persist_key - default "default". Change it to run a second independent rotation on the same node.
    • reuse_last - false by default. Handy for "same again" cases.
    • reset_history - false by default; flip to true to force the cycle to restart.

    Output is a single STRING, item - the chosen line, wired into whatever consumes your prompt/LoRA name/text.

    Install

    ComfyUI Manager → babydjacNODES, or git clone https://github.com/babydjac/babydjacNODES into ComfyUI/custom_nodes, restart, hard-refresh. No extra pip deps.

    Gotchas

    • The state file lives inside the node's own directory. .apk_no_repeat_state.json is written next to NoRepeatPickerNode.py in your custom_nodes/babydjacNODES/Utils/ folder. That means it's part of your ComfyUI install - back it up if you move machines, and don't be surprised to see it in the repo folder.
    • List changes reset the history. The node hashes the full item text; adding or editing one line invalidates the whole "used" set and the cycle restarts fresh. Usually that's what you want.
    • item_index is a modulo, not a clamp - with randomize off, index 5 on a 3-item list wraps to item 2. Fine if you know, confusing if you don't.

    Where this shines: rotating character names across a seed study, cycling through test prompts so every run shows you something new, or walking through a list of LoRAs without repeats. It's the small utility that makes a "queue 20 runs" workflow actually useful.

    CategorybabydjacNODES/Utils

    Inputs (6)

    NameTypeDefaultDescription
    items_textSTRING
    randomizeoptBOOLEANtrue
    item_indexoptINT00–1000000
    persist_keyoptSTRINGdefault
    reuse_lastoptBOOLEANfalse
    reset_historyoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    itemSTRING