Nodes/IF_LLM/IF Display Text📟
ComfyUI Node

IF Display Text📟

Actually Read What Your LLM Said, and Grab One Line to Reuse

By if-ai·Created 2 years ago·Updated about a year ago· 157
IF Display Text📟
    • text
    • text_list
    • count
    • selected
    text
    select0

    ComfyUI's own text display options are a bit of a black box - you drag a Text node in and the value only shows when you poke at the output. IF_LLM_DisplayText is the pack's straightforward answer: it prints the incoming text to the console under a big IF_AI_tool_output banner so you actually see it, splits it into individual lines, and hands you all of it back - plus a count and the ability to pull out a specific line.

    It's the glue you reach for after an LLM call. The main IF_LLM node is an output node, but its response is often a wall of prose; you want to eyeball it in the log while simultaneously feeding just one piece of it onward.

    How it works

    It takes one required input, text (forced to come from a wire, so you can't accidentally type a literal), and splits it on newlines, stripping empty lines. The result is a list of lines. The select integer - its tooltip says it all: "Select which line to output (cycles through available lines)" - picks which one of those lines you get out as selected.

    Three outputs plus the count:

    • text - the full original string, passed through untouched.
    • text_list - every non-empty line as a list, so you can loop over multiple prompts.
    • count - how many lines there are.
    • selected - the single line at the select index.

    Classic use: your LLM returns a numbered list of prompt options. Feed it through, set select to 2, and the second prompt rides out on selected straight into a text encode node, while count tells you how many options you had.

    Installing it

    Same pack, same install. ComfyUI Manager (search "IF_LLM") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/if-ai/ComfyUI-IF_LLM
    

    then restart. Remember the README's warning: uninstall IF_AI_tools first - the two packs conflict. The install pulls a big dependency tree, so give it time.

    Troubleshooting

    • selected returns nothing - the index is out of range. count tells you how many lines exist; keep select below that. It doesn't wrap, it just misses.
    • Lines you expect are missing - blank lines are stripped, not preserved. If you genuinely need empty lines kept, this node will fight you.
    • Nothing prints to the console - the banner print happens on execution; if you're viewing the ComfyUI log in a different terminal, you won't see it. Check the right output.

    It's a small node, and it's not going to win awards for originality. But it's the difference between squinting at JSON in the sidebar and actually reading what your model produced.

    CategoryImpactFrames💥🎞️/IF_LLM

    Inputs (2)

    NameTypeDefaultDescription
    textSTRING
    selectINT00–9223372036854776000Select which line to output (cycles through available lines)

    Outputs (4)

    NameTypeDescription
    textSTRING
    text_listSTRING
    countINT
    selectedSTRING