ComfyUI Node

CSV Reader (Soze)

Turn a spreadsheet into a batch-generation loop

By SozeInc·Created 2 years ago·Updated 3 months ago· 10
CSV Reader (Soze)
    • Column_1
    • Column_2
    • Column_3
    • Column_4
    • Column_5
    • Column_6
    • Column_7
    • Column_8
    • Column_9
    • Column_10
    • Entire_Line
    • Row_Count
    • status
    csv_filename_path
    index0
    csv_text

    The node that turns a spreadsheet into a batch-processing loop. Put your prompts - and whatever else varies per generation: negative prompts, style tags, filenames - in the columns of a CSV, drive an index counter from outside the node, and this reads back one row at a time as separate string outputs you wire straight into the rest of your graph.

    How it works

    Point it at a CSV file (or skip the file entirely and paste CSV content directly into csv_text), give it a row index, and it splits that row into up to ten column outputs plus the whole raw line. It also reports the total row count, which is genuinely useful for driving a loop - you know exactly when to stop incrementing index.

    The inputs and outputs that matter

    • csv_filename_path - the path to your CSV file.
    • index (INT, default 0, up to 1,000,000) - which row to read. Increment this across runs (a Primitive int tied to the queue counter, or your own loop node) to walk through the whole file.
    • csv_text (optional, multiline) - paste CSV content directly here instead of pointing at a file on disk, if you'd rather keep it inline in the graph.
    • Outputs: Column_1 through Column_10 (STRING, one per CSV column up to ten), Entire_Line (the raw row as one string), Row_Count (total rows in the file - handy for knowing when your loop is done), and status.

    How to install it

    Via ComfyUI Manager: search "Quality of Life Nodes for ComfyUI", install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SozeInc/ComfyUI_Soze.git
    pip install -r ComfyUI_Soze/requirements.txt
    

    No API keys or heavy dependencies - plain file/text parsing.

    Common issues & troubleshooting

    Only some columns come through, or they're in the wrong slot. This node caps out at ten columns (Column_1Column_10) - a wider CSV just won't have outputs for the extra columns. If your columns look shifted, check for a stray comma inside an unquoted field throwing off the split.

    index goes past the end of the file. Use Row_Count to bound your loop - feeding an out-of-range index is a common source of an empty or errored row rather than a graceful wraparound.

    You want to test-drive this without a file on disk yet. Use csv_text instead of csv_filename_path - paste a few rows straight into the node while you're wiring things up, then switch to a real file once the graph works.

    Testing prompts against multiple checkpoints, not just rows. Plain CSV Reader only walks rows. If you want to sweep every row against every checkpoint in one pass, look at CSV Reader X Checkpoint instead.

    Categoryutils

    Inputs (3)

    NameTypeDefaultDescription
    csv_filename_pathSTRING
    indexINT00–1000000
    csv_textoptSTRING

    Outputs (13)

    NameTypeDescription
    Column_1STRING
    Column_2STRING
    Column_3STRING
    Column_4STRING
    Column_5STRING
    Column_6STRING
    Column_7STRING
    Column_8STRING
    Column_9STRING
    Column_10STRING
    Entire_LineSTRING
    Row_CountINT
    statusSTRING