ComfyUI Node

TysiguReadLines

How TysiguReadLines walks your prompt list

By tysigu-project·Created 5 months ago·Updated 5 months ago· 0
TysiguReadLines
    • text
    • display_info
    text
    seed1

    ComfyUI has no native "run these 20 prompts one after the other" button. You paste a list into a text node and it gets treated as one giant prompt, or you hand-wire a text node per prompt and end up with spaghetti you can't read. SmartTextLineReader (display name TysiguReadLines) is the middle path: feed it a multi-line prompt list and it hands out one line per run, advancing as your queue burns through.

    The trick: that "seed" isn't a seed

    Here's the thing that trips everyone up. The author named this node's integer widget seed on purpose, because ComfyUI treats a widget named seed specially - it gets the control_after_generate menu with randomize / fixed / increment / decrement options for free. The node then takes that number and reads line (seed - 1) % total_lines of your list. So:

    • increment on control_after_generate → each run moves to the next line
    • fixed → the same line every run, which is exactly what you want for "gacha" rerolling one prompt while you spam new image seeds
    • increment past the end → the modulo wraps it back to line 1, silently, instead of throwing an error

    Lines are split on newlines and empty ones are stripped first, so the numbering you see counts only real prompts. The node re-executes whenever seed or text changes (it implements IS_CHANGED), which is what makes the whole advance-one-line-per-queue behavior work at all.

    The inputs and outputs that matter

    The node only has two inputs, and both matter:

    • text - your multi-line prompt list, one prompt per line. It's marked forceInput, so you don't type into it; you connect a source like TysiguTextInput (same pack).
    • seed - the line index / counter, 1 to 99999, default 1. Set control_after_generate to increment or fixed.

    Two outputs:

    • text - the selected line. Wire this into CLIP Text Encode (or wherever your prompt goes).
    • display_info - a formatted report of the whole list with a marker on the current line, plus a total line count. Feed it to the pack's TysiguTextDisplay node and you can actually watch progress instead of guessing.

    A minimal batch workflow looks like: TysiguTextInput → SmartTextLineReader → CLIP Text Encode → KSampler. Set the queue batch count to the number of lines (TysiguTextInput shows the count right on the node) and hit queue.

    Installing it

    Same drill as every ComfyUI custom node. Through Manager, search for the pack title ComfyUI-TysiguUtilityNodes and install. Or by hand:

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

    Then restart ComfyUI. One honest gotcha: the pack's README literally ships a git clone https://github.com/YourUsername/... line - that's a template placeholder, ignore it and use the URL above. Good news elsewhere: there's no requirements.txt, no model downloads, no torchvision fights. It's pure Python stdlib plus a bit of frontend JS. If it doesn't load, the problem is your ComfyUI, not this pack.

    Where people get burned

    • The seed isn't a seed. It picks the line; it does not vary your output. Keep it independent of the KSampler's seed - don't wire the reader's seed into the sampler or you'll make every run identical.
    • It wraps silently. Queue 40 runs against a 30-line list and runs 31–40 are lines 1–10 again. Fine once you know; confusing the first time your last run looks like your first.
    • The reset button reaches into other nodes. The "Reset line to 1" button on the node sets the seed widget back to 1, and if the seed is connected from a primitive it also tries to reset that source node's numeric widgets. It usually works; just don't be shocked when it touches things.

    Honest framing: this is a brand-new, single-author pack (one release at time of writing) with essentially zero community footprint. The code is simple enough to trust, but there's no army of users behind it - expect rough edges and no one to ask if something odd happens.

    CategoryTysigu/Text

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    seedINT11–99999

    Outputs (2)

    NameTypeDescription
    textSTRING
    display_infoSTRING