Nodes/comfyui-fitsize/Pick Image From List (FS)
ComfyUI Node

Pick Image From List (FS)

The same batch-picker, but for a Python list of images

By bronkula·Created 3 years ago·Updated 2 years ago· 52
Pick Image From List (FS)
  • list
  • IMAGE
seed0
start_index-1
select_amount1

ComfyUI has two ways of carrying multiple images through a graph: a batch, where every image lives stacked in one IMAGE tensor, and a list, where a node emits several separate IMAGE outputs one after another (the kind of thing you get from nodes that process items individually, or that are explicitly marked as list outputs). They look similar on the canvas but behave differently under the hood, and a node built for one doesn't always play nicely with the other. This node is the list version of "Pick Image From Batch" - same selection logic, wired for a list input instead of a stacked batch.

Why you'd reach for it

If whatever's feeding you images already outputs a list rather than a batch, you don't want to force it through a batch-combining step just to use the batch-flavored picker. This node takes the list directly and applies the same random-or-indexed selection, so you can grab one image (or a few) out of a list without restructuring your graph around it.

How it works

Same mechanism as its batch sibling: start_index at its default of -1 means "pick randomly," using seed to make that pick reproducible across runs. Set start_index to 0 or higher to switch to deterministic mode and start pulling from that exact position in the list instead. select_amount controls how many you pull.

The inputs and outputs that matter

  • list (IMAGE) - the incoming list of images to pick from.
  • seed (INT, default 0) - drives the random pick when start_index is -1.
  • start_index (INT, default -1, range -1 to 32) - -1 for random (seeded), 0+ to start at a specific position.
  • select_amount (INT, default 1, range 1 to 32) - how many images to select.

Output: IMAGE - your selected image, or a small set if select_amount is above 1.

Installing it

ComfyUI Manager: search "Comfy Fit Size" or "fitsize." Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/bronkula/comfyui-fitsize.git

Restart ComfyUI. Lightweight pack, no models, no heavy dependencies. Lives under Fitsize → Image once installed.

Common issues

The thing that trips people up isn't this node specifically - it's the batch-vs-list distinction in ComfyUI generally. If you plug a batch tensor into this node's list input and nothing seems to happen the way you expect (or vice versa, feeding a list into the batch-flavored sibling node), that's the mismatch to check first. If you're not sure which one you have, look at what produced it: a normal image generation or load gives you a batch; a node that explicitly says it outputs a list, or one that processes items one at a time, gives you a list.

Same -1-means-random gotcha as the batch version applies here too: it's not "last item," it's "random, seeded." And both index fields cap at 32, so very long lists need a different indexing approach if you're reaching past that range.

CategoryFitsize/Image

Inputs (4)

NameTypeDefaultDescription
listIMAGE
seedINT0
start_indexINT-1-1–32
select_amountINT11–32

Outputs (1)

NameTypeDescription
IMAGEIMAGE