Nodes/Simple List Picker/Simple List Picker
ComfyUI Node

Simple List Picker

The fix for a node that looks like it's ignoring your index

By jmtoball·Created 2 months ago·Updated 2 months ago· 1
Simple List Picker
  • items
  • item
  • resolved_index
  • count
◄index0►
◄modewrap►

Simple List Picker takes a list, takes an index, and hands you the item at that index. Three inputs, three outputs, no models, nothing to download. On paper it is the most boring node you could install.

It exists because the obvious version of it is subtly wrong, and the wrong version fails in a way that looks like your index is being ignored.

The two things ComfyUI calls "a list"

A list output - the socket the canvas marks as a list, flagged OUTPUT_IS_LIST under the hood - is what the core Create List node produces. Downstream nodes never receive it. The executor runs them once per item and collects the results. That's what lets one Create List of four prompts drive four generations inside a single queued run, and it's engine behaviour, not a pack convention.

The other thing called a list is a Python list a node receives whole, which only happens if the node declares INPUT_IS_LIST = True.

So a generic "index into any input" node without that flag gets invoked once per element and dutifully returns each one in turn. On the canvas it looks broken. It's working exactly as written - it just never saw a list.

SimpleListPicker declares INPUT_IS_LIST = True, so it gets every item and returns one. That fixes the bug and creates a second one: with INPUT_IS_LIST, all its inputs arrive wrapped, the index widget included. Set index to 3 and the node is handed [3]. Unwrapping those is the other half of the job, and getting it wrong turns your index into a list and the arithmetic into nonsense.

The inputs that matter

Three, all required.

  • items - the list output. Create List, or anything else emitting a list socket. The type is *, so it takes whatever you give it: strings, images, latents, a list of dicts.
  • index - where to land. Negative counts from the end, Python-style, so -1 is the last item. It's a plain INT widget, and it carries control_after_generate - more on that below, it's the interesting part.
  • mode - what to do when the index is out of range: wrap (the default), clamp, or error.

Outputs: item, the value at that index, in whatever type went in. resolved_index, where the index actually landed after wrap or clamp - quiet, but it's the fastest way to see why you got the prompt you got. And count, the list length. All three come back as single values, not list outputs, so this node does not fan out downstream; it collapses the list into one run.

One item per queued job

Here's what people actually install it for. Because index has control_after_generate, set that dropdown to increment and the number walks forward once per queued run, exactly like a seed.

Put your prompts in a Create List, wire the picker between it and your text encoder, set index to 0 with control increment, and queue with a batch count of N. Each job takes the next prompt. With mode: wrap you can queue more jobs than you have prompts and it cycles.

Two things that will bite you. The index is a counter, not a queue - nothing is consumed, so re-running a job repeats its prompt, and re-queueing the same workflow picks up where you left off rather than starting over. That counter also keeps climbing between sessions; resetting it is a manual act of remembering. The other one is control_after_generate itself: by default it fires after a run, so the number in the box is the one the next job will use. If that confusion gets old, flip ComfyUI's "widget control mode" setting from After to Before once and the displayed number is the one that ran.

Install

ComfyUI Manager → search Simple List Picker → Install → restart. Or from a shell:

cd ComfyUI/custom_nodes
git clone https://github.com/jmtoball/comfyui-simple-list-picker

Restart ComfyUI. No dependencies, no models, nothing to download - pyproject.toml lists an empty dependencies array and there's no requirements.txt at all. It wants Python 3.10+, which any recent ComfyUI already is. MIT licensed, and the whole pack is one nodes.py - worth five minutes, since custom nodes run as arbitrary Python with your user account.

Where it trips people up

"It just passes my value through." If what you plugged into items isn't a list output, the node treats the single value as a list of one and gives it back unchanged. Deliberate, but a non-list source will look like a no-op.

"It errors on an empty list." wrap can't save you from zero items: the list is empty, so there is nothing at any index. Usually a Create List upstream is being fed nothing, or sits in a muted branch.

mode: error is doing its job. You'll get index N is outside a list of M item(s), which is the point of that setting - use it while building a graph, stop using it once you queue batches past the end.

Nobody's talking about this pack. Searches for it and its author come back empty across the community corpus, so treat it as a small single-purpose utility rather than a vetted standard. That's fine.

Categoryutils

Inputs (3)

NameTypeDefaultDescription
items*A list output, e.g. from Create List.
indexINT0-18446744073709550000–18446744073709550000Negative counts from the end, as in Python.
modeCOMBOwrapOut of range: wrap around, clamp to the ends, or raise an error.

Outputs (3)

NameTypeDescription
item*—
resolved_indexINT—
countINT—