Nodes/Comfyui_JTnodes/JT Find Text From Excel
ComfyUI Node

JT Find Text From Excel

Look up a value in a spreadsheet and wire it into your workflow

By Jint8888·Created about a year ago·Updated about a year ago· 1
JT Find Text From Excel
    • found_text
    • row_number
    • column_number
    Excel_Filepath/path
    Excel_Filenametable
    Find_Text
    Output_Column1

    JT Find Text From Excel is the spreadsheet lookup node you didn't know you needed: it searches an Excel file for an exact text match and returns whatever sits in a column of your choice on the matching row. Think VLOOKUP but as a ComfyUI node with the result feeding straight into a prompt or a text input.

    Why you'd reach for it

    This is where ComfyUI stops being an image tool and starts being a small automation platform. The classic use: keep a product/style/tag sheet in Excel, then have a workflow look up the row for "portrait" and pull the matching prompt or metadata from a different column. The output is plain STRING/INT, so it plugs into anything a text node plugs into. Pair it with JT Read From Excel or JT Save Text to Excel and you've got a read/write round-trip against the same file - build a library, then query it at generation time.

    How it works

    Three inputs and one output column, four inputs total:

    • Excel_Filepath (STRING) - the folder the file lives in. Default is /path, which you must change; more on that below.
    • Excel_Filename (STRING) - the file name. The node appends .xlsx for you if you leave the extension off.
    • Find_Text (STRING) - the exact value to search for.
    • Output_Column (INT) - which column (1-based) to pull from on the matching row.

    The node loads the workbook's active sheet (the first one), scans every cell, and does an exact string comparison: cell.value == Find_Text. On the first match it grabs the cell at Output_Column in that same row and hands back:

    • found_text (STRING) - the content of the output column on the match row
    • row_number (INT) and column_number (INT) - where the match actually was

    Three behavioral notes from reading the source. First, it's exact match, no fuzzy, no case-folding - portrait won't match Portrait or portrait. Second, it uses data_only=True, so formula cells return their cached values. Third, it stops at the first match, so duplicate keys just return whichever row it hits first.

    Gotchas that will actually bite you

    • The /path default is a trap. It's an absolute path. If you forget to set it, the node will create a directory called path at your filesystem root and then fail to find your spreadsheet there (or fail harder, depending on permissions). Set the folder before you run.
    • Active sheet only. If your data lives on the second tab, it won't be found. Rename/move it first or the node quietly returns empty strings.
    • Missing file = a loud error. The node wraps failures in a RuntimeError, so a typo'd filename doesn't silently return nothing - you'll get an error box, which is honestly the good outcome.

    Installing it

    Part of the Comfyui_JTnodes pack, so one install gets you all eight nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Jint8888/Comfyui_JTnodes
    pip install "openai>=1.0.0" "openpyxl>=3.0.0"
    

    or search "Comfyui_JTnodes" in ComfyUI Manager. The pip install matters twice here: openpyxl is what makes the Excel nodes work at all, and the pack has no requirements.txt, so you're doing it by hand. Skip it and the whole pack fails to load - every JT node, not just this one. Restart ComfyUI, then find it under JT > JT/text.

    One last thing: the README is entirely in Chinese, so if you're debugging against the docs rather than the source, you're on your own - but the node itself is small, and the behavior described here comes straight from the code. For a quick spreadsheet lookup inside a graph, it's hard to beat for the price (free, and about twenty lines).

    CategoryJT/text

    Inputs (4)

    NameTypeDefaultDescription
    Excel_FilepathSTRING/path
    Excel_FilenameSTRINGtable
    Find_TextSTRING
    Output_ColumnINT11–16384

    Outputs (3)

    NameTypeDescription
    found_textSTRING
    row_numberINT
    column_numberINT