Nodes/ComfyUI-Addoor/🌻 CSV Reader
ComfyUI Node

🌻 CSV Reader

Drive generations from a spreadsheet of prompts

By Eagle-CN·Created 2 years ago·Updated about a year ago· 75
🌻 CSV Reader
    • File_Path
    • Seed
    • Increment
    • Full_Content
    • Lines
    • Total_Lines
    • Selected_Line
    file_path
    column_index0
    seed0
    increment1
    index0

    Reads a CSV file and lets you pull one row per generation. The classic use is a spreadsheet of prompts: put one prompt per line, and this node hands you the next one each run so you can batch through a whole list without touching the graph. It's the backbone of any "generate 200 images from my prompt sheet" setup.

    Why a CSV instead of a text box

    Because a spreadsheet is a far nicer place to manage a big list than a cramped node widget. You can sort it, edit it in Excel or Google Sheets, keep columns for prompt / negative / style, and version it as a file. The CSV Reader is the bridge between that spreadsheet and your workflow - it reads the file and picks the line you want.

    The column_index input is what makes the multi-column part work: keep prompts in column 0, negatives in column 1, and pull whichever you need by index.

    The inputs

    • file_path - path to the CSV (on the machine running ComfyUI).
    • column_index - which column to read (0 is the first).
    • seed and increment - together these advance which line you get. increment sets the step; the seed carries the position, so each run walks forward through the file.
    • index (optional) - jump straight to a specific line when you want a particular row rather than the automatic progression.

    The outputs

    Seven, but you'll mostly care about a couple:

    • Selected_Line - the single row you landed on. This is the one you wire into your prompt encoder. It's the whole point of the node.
    • Lines - every row as a list, if you'd rather iterate the entire file at once.
    • Total_Lines - the row count, useful for setting up a loop or knowing when you've reached the end.
    • Full_Content - the raw file as one string.
    • File_Path, Seed, Increment - pass-throughs, handy for chaining the progression onward.

    Using it for a prompt sweep

    Set file_path to your sheet, column_index to your prompt column, wire Selected_Line into CLIP Text Encode, and queue a batch - each run steps to the next prompt. If a run lands on a blank or malformed row you'll get odd output, so keep the CSV clean: no stray empty lines, and watch commas inside a prompt, since a naive CSV split treats a comma as a column break. Quote fields that contain commas, or keep prompts in their own dedicated column. One quick test run against Total_Lines confirms it's reading the file the way you think.

    Installing ComfyUI-Addoor

    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 / CSV. Pair it with the Incrementer if you want tighter control over which line comes next.

    Category🌻 Addoor/CSV

    Inputs (5)

    NameTypeDefaultDescription
    file_pathSTRING
    column_indexINT00–1000
    seedINT00–18446744073709550000
    incrementINT1-1000–1000
    indexoptINT00–18446744073709550000Start from this row (0 or 1 for first row)

    Outputs (7)

    NameTypeDescription
    File_PathSTRING
    SeedINT
    IncrementINT
    Full_ContentSTRING
    LinesSTRING
    Total_LinesINT
    Selected_LineSTRING