IF Display Text📟
Actually Read What Your LLM Said, and Grab One Line to Reuse
- text
- text_list
- count
- selected
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 theselectindex.
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
selectedreturns nothing - the index is out of range.counttells you how many lines exist; keepselectbelow 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| select | INT | 00–9223372036854776000 | Select which line to output (cycles through available lines) |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| text_list | STRING | — |
| count | INT | — |
| selected | STRING | — |