Nodes/SF ComfyUI Nodes/SF Google Sheet Range
ComfyUI Node

SF Google Sheet Range

Read a block of a public sheet and glue it into a prompt string

By Stillfront·Created 2 months ago·Updated 2 months ago· 0
SF Google Sheet Range
    • text
    urlhttps://docs.google.com/spreadsheets/d/.../edit
    sheet_gid0
    start_row1
    start_colA
    end_row1
    end_colA
    delimiter,

    Where its sibling SF Google Sheet Cell pulls one cell, SF Google Sheet Range grabs a whole rectangle of them and joins the values into one string. Think: a row of character traits, a column of style tags, or a small lookup table that gets flattened into your prompt. It's the same "live spreadsheet as a content source" idea, but for the case where you need several cells at once and would rather not wire up fifty single-cell nodes.

    How it works

    Like the Cell node, this uses the gviz/tq CSV export endpoint - no Google API key, no OAuth, just a public sheet URL. It fetches the tab's full contents as CSV, then walks your range left to right, top to bottom, joining each cell with a delimiter. The output is a single STRING named text. If you set a range with empty cells, they still appear as separators - A, B, , D - which is usually what you want for prompt building, but worth knowing before you build a workflow around it.

    The inputs that matter

    • url and sheet_gid - the full sheet link, and the #gid= value for the tab (default 0 is the first tab). Same rules as the Cell node.
    • start_row / start_col / end_row / end_col - the corners of your range, all inclusive. Rows are 1-indexed, columns are letters (A, B, ..., AA). A1:B3 becomes start_row=1, start_col=A, end_row=3, end_col=B.
    • delimiter - what goes between cells, default ", ". You can type it or wire it from another string node, which is handy when you want a newline between items instead of a comma.

    The node validates your range before fetching: start_row greater than end_row (or start column after end column) throws a clear error instead of returning nonsense.

    Installing it

    It's part of the SF ComfyUI Nodes pack from Stillfront. ComfyUI Manager → search "SF ComfyUI Nodes" → Install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Stillfront/comfyui-sf-nodes.git
    cd comfyui-sf-nodes
    pip install -r requirements.txt
    

    No model downloads - the only dependency that matters here is requests.

    Common issues

    The usual suspect is sharing. The sheet must be Anyone with the link → Viewer; anything else returns an HTTP error, not a helpful one. Also mind that the range is inclusive on both ends - a common first-run surprise is getting one more row or column than you intended because you read end_row as exclusive. And since it fetches live on every execution, it's a network call per run; put it somewhere in the graph that executes once, not inside a per-frame loop, unless you enjoy rate limits.

    CategoryStillfront/Utils

    Inputs (7)

    NameTypeDefaultDescription
    urlSTRINGhttps://docs.google.com/spreadsheets/d/.../editFull Google Sheets URL. The sheet must be shared: Share → Anyone with the link → Viewer.
    sheet_gidSTRING0Sheet tab GID — found in the URL after '#gid='. Use 0 for the first/default sheet.
    start_rowINT1First row of the range (1 = first row in the sheet).
    start_colSTRINGAFirst column of the range (e.g. A, B, C, AA, ...).
    end_rowINT1Last row of the range (inclusive).
    end_colSTRINGALast column of the range (inclusive, e.g. A, B, C, AA, ...).
    delimiterSTRING, String placed between each cell value in the output. Can be typed directly or connected from another string node.

    Outputs (1)

    NameTypeDescription
    textSTRING