Nodes/ComfyUI-BadmanNodes/Select String from List (Badman)
ComfyUI Node

Select String from List (Badman)

Pull one line out of a batch

By MariusKM·Created 2 years ago·Updated 3 months ago· 4
Select String from List (Badman)
    • STRING
    string_List
    Index0

    If you've ever run a batch caption or wildcard node and gotten back a pile of strings when you only wanted one, this is the node you were missing. It's dead simple: feed it a list of strings and an index, and it hands you back exactly the one you asked for. No branching logic, no Python node, no manual copy-paste out of a console log.

    Where it actually earns its keep

    Anything in ComfyUI that processes a batch - a multi-image folder run through BLIP or CLIP interrogation, a WD14 tagger over a set of frames, this same pack's own Wildcard Processor called across a batch of seeds - tends to hand you results as a list rather than a single value. That's great for downstream nodes that expect a list, and useless the moment you actually want to look at, log, or wire in one specific result. Say you're debugging why image #7 in a batch got tagged weirdly, or you want to reuse the caption generated for the third image in a directory as the prompt for a completely separate generation. Select String from List is the node that closes that gap: point it at the batch's string output, set the index, done.

    It's the kind of node that only exists because someone hit this exact friction repeatedly. Small pack, small node, real problem.

    Inputs and outputs

    Two required fields:

    • string_List - the list of strings you're indexing into. Wire in whatever produced the batch (a captioner, a wildcard resolver run over multiple seeds, anything that outputs strings per-item).
    • Index (integer, default 0) - which item to pull. Zero-based, so 0 is the first string in the list, 1 is the second, and so on.

    One output, plain STRING - the string sitting at that index, ready to wire into a CLIPTextEncode, a save-text node, or wherever else you need a single string rather than a batch.

    Installing it

    Easiest path is ComfyUI Manager: search ComfyUI-BadmanNodes, install, restart. By hand it's the usual drill:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MariusKM/ComfyUI-BadmanNodes
    

    Restart ComfyUI and the whole Badman set shows up under the Badman category. The README doesn't call out any Python dependencies or model downloads for this node - it's plain string indexing, so there's nothing to fetch and nothing to break on install.

    Where people get tripped up

    The only real failure mode here is an index that doesn't exist. If your list has 5 entries and you set Index to 7, expect an out-of-range error rather than a silent empty string - there's no wraparound behavior documented, so don't assume it clamps or loops back to the start. If your batch size changes between runs (say you point a folder loader at a different directory with fewer images), a hardcoded index that worked yesterday can break today; it's worth double-checking the batch count before you trust a fixed index in a saved workflow.

    The other thing worth knowing going in: this pack has essentially no footprint outside its own GitHub page - no Reddit threads, no forum chatter, nobody arguing about it. That's not a red flag, it's just what a small personal quality-of-life pack looks like. Marius built it to smooth his own workflow friction, and this node is a good example of the genre: unglamorous, does one thing, and you'll only ever notice it when you need it.

    CategoryBadman

    Inputs (2)

    NameTypeDefaultDescription
    string_ListSTRING
    IndexINT0

    Outputs (1)

    NameTypeDescription
    STRINGSTRING