ComfyUI Node

TysiguTextInput

A multi-line prompt box that counts its own lines for you

By tysigu-project·Created 5 months ago·Updated 5 months ago· 0
TysiguTextInput
    • text
    text

    The most quietly useful trick in ComfyUI's batch workflows: paste a prompt per line into a multi-line text box, set the queue count, and let each run consume the next line. The annoying part is counting how many lines you just pasted so you know what to set the queue to. TysiguTextInput is the text box that does that counting for you - paste your list and a bright little [ 総行数: N 行 ] (that's "total lines: N" in Japanese) appears right on the node, so you never have to count by hand or do the mental math wrong at 2am.

    That's the whole job, and it's a real one. It's the front end of the pack's batch setup: paste the list here, feed the text output into TysiguReadLines, and let the reader walk the list while this node tells you how long the queue needs to be.

    How it works

    The Python side is gloriously dumb - it takes a string in and passes it straight through. All the magic is in the frontend extension (text_input.js). Every time the canvas redraws, it reads the node's text widget, splits on newlines, filters out blank lines, and paints the count in the top-right corner of the node in bold light-green text. It's pure decoration - zero effect on the actual data - but it's the kind of decoration that saves you from miscounting a 37-line prompt list.

    The count matches the reader's behavior, which is the detail that makes it trustworthy: both ignore empty lines. Paste a list with blank lines between prompts and the number on this node is exactly the number of runs the reader will iterate, not the number of physical rows in the box.

    The input and output

    • text - the only input, a multiline string widget (default empty). This one you type into, unlike the reader's force-input pins.
    • text - the output, an identical STRING pass-through. Wire it into SmartTextLineReader's text input, or into any other string input on your graph.

    That's it. One widget, one output, no settings to misconfigure.

    Installing it

    It's one of the four nodes in the ComfyUI-TysiguUtilityNodes pack, so a single install gets you all of them. Through Manager, search ComfyUI-TysiguUtilityNodes, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tysigu-project/ComfyUI-TysiguUtilityNodes.git
    

    Restart ComfyUI and the nodes show up under Tysigu/Text. No requirements.txt, no model files, nothing to download beyond the repo - the pack's README clone command contains a YourUsername placeholder, so copy the real URL above instead.

    Where it's a little annoying

    • The line counter label is in Japanese. 総行数 means "total lines." It's a single character string baked into the frontend, so don't go hunting for a language setting - there isn't one.
    • It counts non-empty lines. If you paste a list with a blank row where you wanted an empty prompt, that line just won't be counted (or read). Blank lines are skipped, not honored.
    • It's a plain text node with a counter, not a file reader. If you were hoping to load prompts from a .txt file, this isn't it - this is for pasting. The pack's README doesn't position it as anything more, and neither should you.

    Honestly, this is the sort of node you don't think about until you've run one batch without it. If you're batching prompt lists in ComfyUI - even outside this pack, since any string input works - having the line count on the box beats counting rows by eye, and it's the piece that makes the rest of the Tysigu batch workflow click.

    CategoryTysigu/Text

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING