Nodes/ComfyUI Warper Nodes/Text File Iterator with Info (Warper)
ComfyUI Node

Text File Iterator with Info (Warper)

Know which prompt file you're on, mid-batch

By AIWarper·Created about a year ago·Updated 8 months ago· 14
Text File Iterator with Info (Warper)
    • text_content
    • file_name
    • file_index
    • total_files
    directory_path
    index0
    modefixed

    Running a prompt library and not knowing which prompt is currently cooking is a recipe for untraceable outputs. Text File Iterator with Info (Warper) is the observability version of the pack's Text File Iterator (Warper): same three iteration modes, same text output - but it also tells you the file_name, the file_index, and the total_files. Wire those into a filename prefix or a display node and every output tells you where it came from. The README's use case is exactly that: "track which file is being used or display progress information."

    It's from ComfyUI Warper Nodes, the niche pack by workflow author AIWarper. If you don't need the metadata, use the leaner plain iterator - but for batch runs where provenance matters, this is the one you reach for.

    How it works

    The three inputs are identical to the plain iterator: directory_path, index, and mode (fixed, incremental, or randomized). The modes behave the same way - fixed reads the indexed file with bounds checking, incremental remembers position per directory and cycles, randomized seeds on the index for reproducible picks. What's added is the output set:

    • text_content - the file's contents.
    • file_name - which file, e.g. 07_western.txt.
    • file_index - its 0-based position in the sorted list.
    • total_files - how many .txt files are in the directory, for progress math.

    On failure the node returns empties and zeros rather than raising: missing directory, no files, or out-of-range fixed index all come back as ("", "", 0, 0) (or with total_files filled where it knows it). Files are sorted by name in every mode, so zero-pad your filenames if order matters.

    Installing it

    Standard Warper install: ComfyUI Manager → search "ComfyUI-WarperNodes" → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AIWarper/ComfyUI-WarperNodes
    # restart ComfyUI
    

    No dependencies beyond the standard library, no models. The README's RAFT checkpoint is only for Flow Visualizer.

    Common issues

    Everything from the plain iterator applies, plus one observation: the metadata only helps if you use it. The file_index and total_files outputs are there to build progress displays and filename labels - if you leave them unwired, you've bought yourself nothing over the cheaper node. The failure-return contract is worth memorizing because it's easy to misread: an empty text_content with file_index 0 and total_files 0 means "nothing loaded," not "file zero was empty." And incremental mode's per-directory memory applies here too - same session, same folder, it keeps advancing, so don't expect a fresh run to restart at the top of your list.

    CategoryWarper Tools/Text

    Inputs (3)

    NameTypeDefaultDescription
    directory_pathSTRING
    indexINT00–10000
    modeCOMBOfixed3 options: fixed, incremental, randomized

    Outputs (4)

    NameTypeDescription
    text_contentSTRING
    file_nameSTRING
    file_indexINT
    total_filesINT