Nodes/ComfyUI-Addoor/🌻 Image Indexer
ComfyUI Node

🌻 Image Indexer

Step through a batch one image per run

By Eagle-CN·Created 2 years ago·Updated about a year ago· 75
🌻 Image Indexer
  • images
  • image
  • image_name
  • current_index
  • total_images
increment1
seed0
image_names
index0

Takes a batch of images and hands you one of them, advancing to the next each time you queue. It's the image equivalent of reading a CSV line by line - pull a folder in with Any File List, then use this to walk through it one picture per run so downstream nodes process each in turn.

Where it fits

Batch processing in ComfyUI usually comes in two flavors: operate on the whole batch at once, or step through it one item at a time. Plenty of workflows need the second kind - you want to run a slow, per-image operation (an upscale, a caption, an edit) on each file separately, or you're cycling reference images across a series of generations. Image Indexer is the selector for that: give it the batch, and each queued run it plucks out the next image and reports where you are in the set.

How it works

You feed it a batch of images. It keeps a position and moves forward by increment each run - so with increment at 1 it goes 0, 1, 2, and so on. The seed carries the position between runs (this is the common ComfyUI trick for making a node advance on each queue). If you want to jump straight to a specific picture instead of the automatic progression, the optional index input does that. The optional image_names lets it also return the name that goes with the selected image, so your outputs can be named to match.

The inputs that matter

  • images - the batch to step through. Wire this from Any File List's Image_List or any batch source.
  • increment - how far to advance each run. 1 is the usual.
  • index (optional) - jump directly to a specific position instead of stepping.
  • image_names (optional) - the matching names, if you want image_name on the output.

Four outputs: image (the one it selected - the main event), image_name (its name, if you supplied names), current_index (where you are), and total_images (the batch size - your loop bound so you know when you've been through everything).

Common issues

The main confusion is how it advances. It relies on the seed changing between runs to step forward, so if your seed is fixed you'll keep getting the same image - set the seed widget to increment (or randomize) if the index isn't moving. If you need deterministic control, drive the index input explicitly instead and forget the automatic mode. Watch current_index against total_images to know when you've reached the end; the node will typically wrap or clamp rather than error, so total_images is your signal that a full pass is done. And make sure the batch you feed it is the tier of images you actually want - pulling the wrong folder in upstream is the usual "why is it processing the wrong pictures" culprit.

Installing ComfyUI-Addoor

ComfyUI-Addoor (葵花宝典) is a batch and utility pack from developer Eagle-CN. ComfyUI Manager: Install Custom Nodes → search "ComfyUI-Addoor" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
cd ComfyUI-Addoor
pip install -r requirements.txt

Restart and find it under 🌻 Addoor / Batch. It pairs directly with Any File List.

Category🌻 Addoor/Batch

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE
incrementINT10–1000
seedINT00–18446744073709550000
image_namesoptSTRING
indexoptINT00–18446744073709550000Start from this row (0 or 1 for first image)

Outputs (4)

NameTypeDescription
imageIMAGE
image_nameSTRING
current_indexINT
total_imagesINT