🪠️ WWAA LineCount
Count the prompts in your multiline text box
- Line Count
WWAA LineCount does one thing: takes a multiline string and tells you how many lines it contains - ignoring blank ones. That's it. If you've ever pasted a list of prompts into a text widget and wanted to know how many variations you're about to generate, or wanted a count to drive some conditional logic, this is the node.
It's part of the WWAA-CustomNodes pack from WeirdWonderfulAI.Art, and it's the rare utility that's honest about being a one-trick pony. The output is a single INT named "Line Count." There's a string_text multiline input (with a two-line default so you see what's expected) and nothing else. No optional inputs, no lists, no magic.
How it works
The implementation is refreshingly plain: it strips surrounding whitespace, collapses runs of two or more newlines into one, splits on newlines, and counts the resulting entries. That means blank lines - lines that are empty, or just whitespace - don't inflate your count. The collapse of multiple consecutive newlines is worth knowing if you're pedantic about exact line numbers: a text block with double-spacing won't count the empty lines.
The classic use: pair it with a multi-prompt text box and use the count to set a batch size, or to compare against the total_lines output of a stateful reader like WWAA Advanced Text File Reader so you know how many runs a batch will take. Since it's pure text-in, INT-out, it also works fine inside a "number of iterations" computation.
Inputs
string_text- the multiline text to count.
Output: Line Count (INT).
Installing it
It's bundled in WWAA-CustomNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/hgabha/WWAA-CustomNodes
Restart ComfyUI. Or use ComfyUI Manager → search "WWAA Custom Nodes" → install → restart. It's under 🪠️ WWAA/String. No models, no extra dependencies.
Gotchas
Honestly, the only thing to trip over is the blank-line behavior - if your text uses blank lines as separators and you expected them counted, they aren't. If you want the raw newline count including empties, this isn't the node. And, as with every node in the pack, if it's missing after install, do the restart first, then check the pack's image-half OpenCV dependency if nothing under 🪠️ WWAA loads at all. Otherwise: paste text, read a number. It's the sort of node you install as part of a pack and forget about until you need it - and then it's exactly right.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| string_text | STRING | String goes here Second line. | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Line Count | INT | — |