Nodes/ComfyUI-Apt_Preset/excel_column_diff
ComfyUI Node

excel_column_diff

Find how many prompts in your batch sheet are still missing

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
excel_column_diff
    • count
    • count_data
    • count_finish
    excel_pathexcel_file_path.xlsx
    sheet_nameSheet1
    row_data1
    row_finish1

    If you're driving a batch of generations off a spreadsheet - one row of source prompts, another row tracking what's actually been completed - you eventually need to know how far behind you are. excel_column_diff answers that directly: point it at two rows in your sheet and it tells you how many cells are out of alignment between them.

    Read the name carefully before you use it, though - it's a little misleading, and that's worth flagging up front rather than letting you find out the hard way.

    How it works

    The node scans two rows from left to right and counts, for each one, how many consecutive non-empty cells it finds starting from the left edge - row_data gives you count_data, row_finish gives you count_finish. Subtract the two and you get count, the number of items still outstanding. It's built for exactly the workflow you'd expect: row_data is the row listing everything queued up, row_finish is the row recording what's actually been written back (a generated image reference, a "done" marker, whatever your process uses), and this node tells you the gap without you having to eyeball a wide spreadsheet.

    Here's the part worth knowing: despite the name "column_diff," this node compares two rows, counting left to right - its parameters are literally called row_data and row_finish. If you actually want to diff two columns (counting top to bottom), that's the sibling node, excel_row_diff, whose parameters are col_data/col_finish. The names on these two nodes are swapped from what you'd guess - worth bookmarking so you don't burn time debugging a "wrong" result that's actually just the right node with a confusing name.

    The inputs and outputs that matter

    • excel_path / sheet_name - which file and sheet to read.
    • row_data / row_finish (INT, min 1) - the two rows being compared, counting non-empty cells left to right from column 1.
    • Outputs: count (the difference - count_data minus count_finish), plus count_data and count_finish individually if you want the raw numbers rather than just the gap.

    How to install it

    Bundled with the full pack. Via ComfyUI Manager: search "ComfyUI-Apt_Preset" → Install → restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
    

    Windows: run install.bat from the cloned folder through ComfyUI's embedded Python. Linux/Mac: activate your ComfyUI venv and install requirements from that folder by hand. Restart ComfyUI. The excel nodes in this pack read/write .xlsx files, which almost always means a Python spreadsheet library (something like openpyxl) gets pulled in during that install step - if this node specifically fails to import while everything else in the pack loads fine, that's the dependency to look for in the console error.

    Common issues & troubleshooting

    "column_diff" gave you a row comparison and it feels backwards. It is backwards from what the name suggests - see above. Use excel_row_diff if you actually meant to compare two columns top to bottom.

    Count comes back higher than expected. The scan stops at the first empty cell counting from the left - it's consecutive non-empty cells, not a total count across the whole row. A single blank cell partway through a mostly-full row will cut the count short right there, which is usually exactly what you want for an "is this batch complete" check, but can surprise you if your data has legitimate gaps.

    File not found or sheet name mismatch. excel_path and sheet_name are plain strings with no validation shown at the schema level - a typo'd sheet name or a relative path that doesn't resolve to where you expect (relative to ComfyUI's working directory, not necessarily your workflow's folder) is the most common reason this comes back empty rather than erroring loudly.

    CategoryApt_Preset/prompt/excel

    Inputs (4)

    NameTypeDefaultDescription
    excel_pathSTRINGexcel_file_path.xlsx
    sheet_nameSTRINGSheet1
    row_dataINT1
    row_finishINT1

    Outputs (3)

    NameTypeDescription
    countINT
    count_dataINT
    count_finishINT