Nodes/ComfyUI XAV Google Sheets/XAV Google Sheets Loader
ComfyUI Node

XAV Google Sheets Loader

Turn a Public Google Sheet Into a Text Matrix — No API Key Required

By XAV-Games·Created 4 months ago·Updated 4 months ago· 2
XAV Google Sheets Loader
    • table
    urlhttps://docs.google.com/spreadsheets/d/.../edit
    sheet_gid0

    The name undersells the trick. This node turns a public Google Sheet into a matrix of text your ComfyUI graph can read, and it does it with zero credentials - no API key, no Google Cloud project, no billing account. You paste a Share-link URL, it downloads the sheet as CSV, and hands you a table of rows and columns you can slice into.

    Why you'd reach for it

    The classic reason anyone pulls a spreadsheet into ComfyUI: you keep a batch of prompts - or character names, style tags, negative prompts, whatever is text - in a place other people can edit, and you want the graph to read from it instead of you copy-pasting a value into a node every run. The r/comfyui thread on this pattern is basically a support ticket for it: someone iterating through a prompt list in a Google Sheet, wanting one generation per cell. This loader is the bridge for that workflow. The whole prompt batch lives in one editable doc, and ComfyUI just goes and gets it.

    How it works

    Mechanically it's about as simple as a node gets, which is refreshing. It pulls the spreadsheet ID out of your URL with a regex (it matches /d/<id> - and it'll also accept a bare ID pasted in), then builds Google's public CSV export endpoint:

    https://docs.google.com/spreadsheets/d/{id}/export?format=csv&gid={gid}
    

    It fires a plain requests.get at that, decodes the body as UTF-8, and parses it with Python's csv module into a list of lists - every row a list of cell strings. That's the whole thing.

    This is worth stressing because it's the opposite of the usual "node that reaches out" story. The API-wrapper nodes this ecosystem knows - the closed-model and LLM callers - carry a key and send your data somewhere (the external-api-nodes KB essay has the security frame for those). This one holds no credential and sends nothing but a GET to Google's public export URL. It works only because the sheet is public, and that's the entire design.

    The inputs that matter

    Only two, both strings:

    • url - the full share link. The tooltip says it for you: "In Google Sheets: Open Access -> Anyone with the link -> Copy link."
    • sheet_gid - which tab to read, default "0" for the first sheet. To target another tab, open it and copy the number after gid= in the URL bar into this field.

    Output: table, a custom TABLE type. That's the matrix. One catch: the type only interoperates with this pack's own Cell Selector node. If you want to do anything else with the data, the README's answer is a Python script node to manipulate the list.

    Installing it

    Standard custom-node fare, and a light one:

    cd ComfyUI/custom_nodes
    git clone https://github.com/XAV-Games/ComfyUI-XAV-Google-Sheets.git
    

    Then restart ComfyUI. Or skip the terminal: ComfyUI Manager → search "XAV Google Sheets" → install. There are no model downloads and no heavy dependencies - the pyproject.toml lists zero requirements, and the one import (requests) is something ComfyUI already bundles. If Manager offers to pip-install anything for it, that's noise.

    Where people get burned

    • The sheet has to actually be public. If you forget "Anyone with the link," Google doesn't give you an error - the export URL returns a login page, which this node cheerfully decodes as text and hands you as a one-row "table" of HTML garbage. Set Share → Anyone with the link → Viewer before you queue.
    • Indexing is 0-based. Row 0 is the first data row. If your sheet has a header row, that's row 0 - plan around it.
    • It downloads synchronously every time it runs, so a genuinely large sheet stalls the workflow while it fetches. The README admits this one outright.
    • Fresh edits may not appear. The node has no IS_CHANGED override, so once ComfyUI has executed it with a given url/gid, it reuses the cached table on the next queue. Edit the sheet and you might need to nudge the url/gid or reload the workflow to force a re-fetch.

    Wiring it up

    The README's example is honest and minimal:

    XAV Google Sheets Loader --table--> XAV Google Sheets Cell Selector --text--> Show Text
    

    For real work, feed that cell text into a CLIP Text Encode (convert its text widget to an input) and you're generating from a spreadsheet prompt. The selector is the other half of this pack - grab it next.

    CategoryXAV/google

    Inputs (2)

    NameTypeDefaultDescription
    urlSTRINGhttps://docs.google.com/spreadsheets/d/.../editIn Google Sheets: Open Access -> Anyone with the link -> Copy link
    sheet_gidSTRING0Sheet gid (see URL when opening a specific sheet)

    Outputs (1)

    NameTypeDescription
    tableTABLE