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

Pick Image From Batch (FS)

Grab one (or a few) images out of a batch

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

Batches in ComfyUI are handy right up until you only want one image out of the pile. If you've generated a batch of 8 and just want to send #3 onward, or grab a random one each run for a quick preview, you're normally stuck adding a Latent/Image From Batch node and fiddling with the batch index. This node does exactly that job, with a small twist: it can pick randomly (with a seed, so it's reproducible) instead of always making you specify an exact index.

Why you'd reach for it

Say you batch-generate variations and want a downstream node - a save, a compare, a second-pass sampler - to only see one of them, or a random subset, without you manually re-wiring an index every time. That's this node. It's also useful for spot-checking: rig up a random pick from a large batch so your preview node shows a different sample each run instead of always frame 0.

How it works

Three controls do the job together. start_index decides where in the batch you begin picking from; its default is -1, which is the pack's sentinel for "don't use a fixed index - pick randomly instead," driven by the seed value so the pick is reproducible across runs (same seed, same pick). Set start_index to 0 or higher and it switches to a deterministic mode: it starts exactly there and pulls forward. select_amount controls how many images come out - leave it at 1 for a single pick, or raise it to grab a contiguous handful starting from your chosen point.

The inputs and outputs that matter

  • images (IMAGE) - the batch you're picking from.
  • seed (INT, default 0) - controls the random pick when start_index is -1. Same seed and same batch size gives you the same selection every time, which matters if you want a reproducible preview rather than a different image every run.
  • start_index (INT, default -1, range -1 to 32) - -1 means random (seeded); 0 or above means "start picking exactly here."
  • select_amount (INT, default 1, range 1 to 32) - how many images to pull out.

Output: a single IMAGE - either one image, or a small batch if select_amount is greater than 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. No models to download, nothing heavy to install - it's a small utility pack. You'll find this under Fitsize → Image.

Common issues

The main thing to keep straight is the start_index = -1 sentinel - it's easy to assume -1 means "the last image" (a common convention in other tools), but here it means random. If you want a specific image and get a different one each run, check that start_index isn't still sitting at -1.

Both start_index and select_amount cap out at 32, so if you're working with a batch bigger than that and need to reach further in, this node's index range won't cover it - you'd need a different batch-indexing node for that range. Beyond that, this pack's install is unusually low-friction; it's a real-world niche utility with a small footprint and no community-reported failure modes in wide circulation, so most issues you'll hit are the generic ones (forgot to restart after cloning, missing-node error on a shared workflow before you've installed the pack).

CategoryFitsize/Image

Inputs (4)

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

Outputs (1)

NameTypeDescription
IMAGEIMAGE