NativeCountListNode
Find out how many items are actually in that list
- length
The list is the thing you can't see
Once you start doing sweeps - the sampler/scheduler grids people run to settle their defaults - your workflow stops passing single values around and starts passing lists. Ten samplers, eight schedulers, five prompts. The whole point of the plumbing layer is that these fan out and iterate without you hand-building twenty parallel branches. The downside: once a list goes into a wire, you can't see it. You're left guessing whether that comma-separated blob of text turned into eleven items or one.
NativeCountListNode is the smallest possible answer to that. It takes a list, returns how many things are in it. One input, one output, no settings.
Why care? Because axis lists are built by splitting text, and text splitting goes wrong quietly. A trailing comma, a blank line, a double separator - suddenly your "four schedulers" is six iterations and the sweep runs 50% longer than you planned. Counting first is cheaper than finding out at hour four.
How it counts (and what it doesn't)
The mechanism is a single engine flag. The node sets INPUT_IS_LIST = True, which tells ComfyUI: don't call me once per item, hand me the entire list in one go. The author's comment in the source spells out the consequence - with that flag on the value arrives wrapped in a Python array, so the node just measures it:
def get_length_native(self, input_list):
# input_list because of the INPUT_IS_LIST flag always comes wrapped in a Python array
if isinstance(input_list, list):
length = len(input_list)
else:
length = 1
return (length,)
Read that else branch carefully, because it's the part that trips people up. This counts list items, not characters, words, or lines of text. Feed it a single string - a primitive text node, a prompt field, anything not emitting a real list - and you get 1, which looks like a broken node and is actually the spec.
Inputs and outputs
input_list(STRING) - the only input. Wire a native list into it: an upstream node withOUTPUT_IS_LISTenabled, like this pack's own list maker or its "from string" selector variants.length(INT) - the count. It doesn't feed a sampler, so what you do with it is up to you: size a loop's iteration count, sanity-check a split before committing to a long queue, or feed your own volume bookkeeping.
One thing worth knowing: the pack also ships a plain CountListNode - same idea, but it declares its input as a legacy LIST type and lives in a different menu category. They aren't interchangeable. Use the legacy counter on a modern native list and you count the wrapper, getting 1; swap them and it works. Same symptom, opposite fix.
Installing it
The pack is published to the Comfy Registry (there's a pyproject.toml publisher id and a publish workflow in the repo), so ComfyUI Manager is the easy route: search DemonAlone-nodes-ComfyUI, install, restart.
Manual route works the same as any pack:
cd ComfyUI/custom_nodes
git clone https://github.com/DemonAlone/DemonAlone-nodes-ComfyUI
Then restart. Dependencies are a non-event - requirements.txt is one line, piexif, and the heavy things the pack touches (torch, PIL, numpy) already come with ComfyUI. No model downloads, nothing for models/.
The real install problem is finding the node afterwards. It has no friendly display name - it's literally NativeCountListNode - and it lives at utility → text → native. Search "Count" rather than scrolling.
Also: single-maintainer hobby pack, no code review behind it, and custom nodes run arbitrary Python on import. This one's small enough to skim if you care. It's actively developed (5.3.1, commits within days of this writing), which cuts both ways - a workflow built today may shift slightly after a pull.
Troubleshooting
It always returns 1. Either the upstream isn't emitting a native list (a plain string counts as one item, by design), or you're using the legacy CountListNode / native pairing backwards.
The count is one higher than you expect. You're counting a split that produced an empty item - trailing separator, blank line at the end of the text box, two separators in a row. Enable empty-value removal upstream, or fix the source text.
You can't find it in the menu. utility/text/native, and the display name is the class name. Search, don't scroll.
Nothing happens at all. Its output isn't wired to anything, so ComfyUI never executes it. Connect length to a consumer before hunting for a bug.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_list | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| length | INT | — |