Nodes/ComfyUI-Addoor/🌻 Text Indexer
ComfyUI Node

🌻 Text Indexer

Step through a list of strings one per run

By Eagle-CN·Created 2 years ago·Updated about a year ago· 75
🌻 Text Indexer
    • text
    • file_name
    • current_index
    • total_texts
    texts
    increment1
    seed0
    file_names
    index0

    The text twin of the Image Indexer: give it a list of strings and it hands you one at a time, advancing to the next each run. If you've pulled a folder of caption or prompt files in with Any File List, this is what walks through them one by one so each drives a separate generation.

    Where it fits

    Sequential text is a common batch need. You've got a folder of prompts, a set of captions, or a list of variations, and you want to run through them one per queue rather than all at once. Text Indexer is the selector for that. Pair it with Any File List - whose Text_List output is exactly a list of the loaded text files - and you have a clean loop: load the folder once, step through it here, feed each string into your prompt encoder or wherever it needs to go.

    How it works

    You feed it texts (a list of strings). It keeps a position and moves forward by increment each run, with the seed carrying the position between queues - the standard ComfyUI pattern for a node that advances on each run. The optional index jumps straight to a specific entry. The optional file_names lets it also return the name matching the selected string, so you can keep track of which file each one came from.

    The inputs that matter

    • texts - the list of strings to step through. Wire from Any File List's Text_List or any string list.
    • increment - how far to advance each run. 1 is standard.
    • index (optional) - jump directly to a specific entry instead of stepping.
    • file_names (optional) - matching names, if you want file_name on the output.

    Four outputs: text (the selected string - the main one), file_name (its source name, if supplied), current_index (your position), and total_texts (the list length - so you know when a full pass is done).

    Common issues

    Same advancing behavior as the Image Indexer, same gotcha: it relies on the seed changing between runs to step forward. Fixed seed means the same string every time - set the seed to increment or randomize if it's stuck. For deterministic control, drive index directly and skip the auto mode. Watch current_index against total_texts to know when you've been through the whole list. And make sure the list you feed in is actually a list of separate strings - if an upstream node hands over one big blob of text instead of a proper list, you'll get one item, not many.

    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
    textsSTRING
    incrementINT10–1000
    seedINT00–18446744073709550000
    file_namesoptSTRING
    indexoptINT00–18446744073709550000Start from this row (0 or 1 for first text)

    Outputs (4)

    NameTypeDescription
    textSTRING
    file_nameSTRING
    current_indexINT
    total_textsINT