Nodes/ComfyUI-Tlant-Toolkit/Random Line (No Seed) (Tlant)
ComfyUI Node

Random Line (No Seed) (Tlant)

A random line picker that never needs a seed

By Tlant·Created 3 months ago·Updated 28 days ago· 0
Random Line (No Seed) (Tlant)
    • line
    text

    Every queue run, a different line. That's the whole job of Random Line (No Seed) (Tlant): feed it a multiline string and it hands back one random non-empty line, on every single execution, with no seed widget and no "control after generate" button to fiddle with.

    The "no seed" part is deliberate, and it's the thing to understand before you use it. Most random nodes in ComfyUI are seed-driven - you get a fixed toggle and can lock a result in. This one is the opposite. It draws from Python's secrets.choice (operating-system-level randomness, not a seeded PRNG) and its IS_CHANGED hook returns float("NaN"), which tells ComfyUI's cache to consider it dirty every run. Practical meaning: each queue produces a different pick and you can't reproduce a specific one. Want reproducibility? Grab a seed-stable node instead. This one exists for when you explicitly don't want it.

    Where it earns its keep: prompt sampling and batch variation. Wire it to a wildcard-style list of prompt variants, a caption list, or just a big text box, then queue the same workflow repeatedly to explore the space. It also slots into batch pipelines that need a random caption, a random negative prompt, or a random token per item. The text input is forceInput - an input socket rather than a canvas widget - so it composes cleanly mid-graph.

    The input and output are minimal, which is the appeal:

    • text - the multiline string to pick from. Only non-empty lines count; blank lines are skipped.
    • line (STRING) - the chosen line, wired into whatever needs it.

    If the input has no non-empty lines, it returns an empty string instead of erroring, so a miswired workflow gives you a blank prompt rather than a crash.

    Install

    Get it via ComfyUI Manager (search ComfyUI-Tlant-Toolkit), or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Tlant/ComfyUI-Tlant-Toolkit
    

    Restart ComfyUI after installing. The pack's requirements.txt is deliberately empty - no third-party deps, nothing downloads on first run, plain Python all the way.

    The one gotcha

    Because this node always re-executes (that's the entire point), it also dirties everything downstream. ComfyUI reruns the whole branch on every queue, not just the pick. For a single random line that's exactly what you want; if you hang it upstream of an expensive sampler and run it in a loop, every iteration regenerates. Keep it near the end of the graph, or use it only where you genuinely want fresh variation each run.

    CategoryTlant Toolkit/Text

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    lineSTRING