Nodes/XBHH Live2D Pet & LoRA/xbhh XLSX查看器
ComfyUI Node

xbhh XLSX查看器

Read your Excel files inside ComfyUI without ever opening Excel

By xbhh123456·Created 8 months ago·Updated about a month ago· 13
xbhh XLSX查看器
    • content
    • row_count
    • col_count
    file_path
    sheet_name
    max_rows100

    Somewhere between "why would you ever need this" and "I now use it every week" sits the XBHH XLSX viewer. It reads an .xlsx file, renders the sheet as a formatted text table right in the node, and hands you the content plus row and column counts as outputs. If your prompts, LoRA lists, or batch parameters live in a spreadsheet - which a surprising number of people's actually do - this lets the graph itself read them.

    The classic setup: a spreadsheet where each row is a prompt variation or a character spec, you pick one (or just eyeball the sheet), and the node turns spreadsheet rows into workflow inputs. It also earns its keep as a lightweight inspection tool when you're handed a config workbook and don't want to alt-tab out of ComfyUI to read it.

    How it works

    It's a thin wrapper around openpyxl - the only real Python dependency in the entire XBHH kit, and this node is why it exists. On execution it loads the workbook in read-only mode, picks the requested sheet (or the first one if sheet_name is blank), reads up to max_rows rows, and formats them into an aligned pipe-separated table. It caps column width at 20 characters with a .. truncation marker so huge cells don't turn the output into a wall. Values are read with data_only=True, which means you get computed results rather than formulas.

    The inputs and outputs that matter

    • file_path - the full path to the .xlsx file. Required, and it's a path, not a dropdown - there's no file picker.
    • sheet_name (optional) - pick a specific sheet by name; blank means the first/active sheet.
    • max_rows (optional) - cap on how many rows get read and rendered, default 100, max 10000. Raise it for big sheets, lower it for speed on enormous ones.

    Three outputs: content (STRING - the whole rendered table), row_count and col_count (INTs - the true totals from the sheet, not just what you capped). Those counts are the sleeper feature: wire row_count into iteration logic or a batch-size calculator and the spreadsheet drives the workflow.

    Installing it

    This is the node that makes the kit's install step non-optional:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xbhh123456/Comfyui-xbhh-main.git
    cd Comfyui-xbhh-main
    pip install -r requirements.txt
    

    That requirements.txt is essentially just openpyxl>=3.1.0. Skip the pip step and this node will happily tell you exactly what's missing. ComfyUI Manager users can search xbhh-lora and Manager handles the dependency.

    Common issues

    • "❌ 需要安装 openpyxl 库" - you skipped the pip install, or you installed the pack into an environment where requirements.txt never ran. pip install openpyxl in the same environment as ComfyUI, restart, done.
    • "❌ 仅支持 .xlsx 格式文件" - it's .xlsx only. Old .xls files from Excel 97–2003 are rejected; re-save them as .xlsx first.
    • "❌ 文件不存在" - the node takes a real filesystem path, not a ComfyUI-relative path. On Windows, mind that your path string might need C:/Users/... forward slashes depending on how you pasted it.
    • The table view is read-only by design - this is a viewer, not an editor. If you want to modify sheets from a workflow, this isn't that node.

    One honest note: this node is a specialty tool. You'll either have a spreadsheet-driven workflow and consider it essential, or never touch it. Both are fine - but if you ever find yourself hand-copying rows from Excel into a text widget, you now know the better way.

    CategoryXBHH

    Inputs (3)

    NameTypeDefaultDescription
    file_pathSTRINGxlsx 文件的完整路径
    sheet_nameoptSTRING工作表名称(留空则使用第一个工作表)
    max_rowsoptINT1001–10000最大显示行数

    Outputs (3)

    NameTypeDescription
    contentSTRING
    row_countINT
    col_countINT