Nodes/comfyui_LLM_party/Excel Iterator
ComfyUI Node

Excel Iterator

Drive an LLM workflow one spreadsheet row at a time

By heshengtao·Created 2 years ago·Updated 7 days ago· 2,321
Excel Iterator
    • file_content
    • is_end
    pathtest.xlsx
    is_enabletrue
    is_reloadfalse
    load_allfalse
    iterator_modesequential
    start_row2
    end_row1048576

    If your prompts, product descriptions, or batch data already live in a spreadsheet, retyping them into ComfyUI widgets one at a time is a waste of an afternoon. Excel Iterator is comfyui_LLM_party's answer: point it at an .xlsx file, and each time the graph runs it hands you the next row's content as text - no manual copy-paste, no separate script.

    It's the spreadsheet sibling of the pack's File Path Iterator (which walks a folder of files instead of a folder of rows). Same underlying idea - stateful, one-item-per-run - different source.

    How it works

    The node opens the Excel file at path, walks its rows starting from start_row, and returns each row's content as a single string in file_content. Row 2 is the default starting point rather than row 1, which is the tell that this expects a header row on line 1 - the usual shape of a real-world spreadsheet. It keeps track of where it left off between runs, the same way File Path Iterator does.

    The inputs and outputs that matter

    • path (default test.xlsx) - the spreadsheet to read. Point it at your real file.
    • iterator_mode - sequential (row by row, in order), random (a shuffled pull each run), Infinite (wraps back to the start once it runs out instead of stopping), and sequential_flagout (sequential, but flips is_end once you've stepped past the last row).
    • load_all - flip this to dump the entire sheet's content in one go instead of iterating one row per run, if you actually wanted a bulk load rather than a step-through.
    • is_reload - force a fresh read of the file and reset position; useful if you edited the spreadsheet mid-session and the node is still working off a stale scan.
    • start_row / end_row (default 2 / 1048576) - the row range to iterate over. The defaults assume a header on row 1 and effectively "everything after it" as the ceiling.
    • is_enable - the pack's standard bypass toggle.

    Outputs: file_content (STRING, the current row's data) and is_end (BOOLEAN, only meaningful in sequential_flagout mode). Since a static ComfyUI graph can't natively branch or loop on its own, is_end is meant to drive an external run-count - an API caller, a batch script, a queue you bump - rather than something the graph reacts to by itself.

    How to install it

    Search comfyui_LLM_party in ComfyUI Manager and install, then restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/heshengtao/comfyui_LLM_party.git
    

    Then run pip install -r requirements.txt from inside the pack's own folder, using ComfyUI's Python - not your system Python. This is the step that actually matters for this specific node: reading .xlsx files needs a real Excel-parsing library, and that dependency ships bundled in the pack's combined requirements.txt rather than something you install separately. If the install fights you over version conflicts (this is a large pack pulling in LLM clients, embeddings, OCR, and TTS libraries all at once), the README ships a requirements_fixed.txt with pinned versions as a fallback.

    Common issues & troubleshooting

    It errors immediately on load instead of returning a row. Check path first - a relative path is resolved from wherever ComfyUI's working directory happens to be, which trips people up more than a genuinely missing file does. An absolute path sidesteps the ambiguity.

    It keeps returning the same row, or skips rows you just added. That's is_reload - the node trusts its last scan of the file by default, so toggle reload on for one run after editing the spreadsheet.

    Your header row shows up as data. start_row defaults to 2 specifically to skip a header on row 1 - if your sheet doesn't have a header, or has more than one header row, adjust start_row to match instead of assuming the default fits every spreadsheet.

    You expected it to stop and it didn't. Only sequential_flagout sets is_end; plain sequential and Infinite will keep re-running or loop forever by design. Pick the mode that matches whether you actually want a hard stop.

    Category大模型派对(llm_party)/迭代器(iterator)

    Inputs (7)

    NameTypeDefaultDescription
    pathSTRINGtest.xlsx
    is_enableBOOLEANtrue
    is_reloadBOOLEANfalse
    load_allBOOLEANfalse
    iterator_modeCOMBOsequential4 options: sequential, random, Infinite, sequential_flagout
    start_rowoptINT22–1048576
    end_rowoptINT10485762–1048576

    Outputs (2)

    NameTypeDescription
    file_contentSTRING
    is_endBOOLEAN