Count List
How many items are actually in that list
- input_list
- INT
Count List takes a LIST and hands back a single INT - how many elements are in it. That's the entire node. No filtering, no inspection of what's inside, just a count.
Why you'd bother counting a list you built yourself
It sounds almost too simple to need a dedicated node, but it earns its place in exactly the kind of graph this pack is built around: XYZ-plot-style sweeps where a list gets assembled dynamically from several sources - a Dynamic Checkpoint Selector here, a List Combiner merge there - and by the time it reaches the end of the chain, you honestly don't know how many entries survived. Maybe some of those "none" slots in a ten-slot generator node got filled and some didn't. Count List gives you a quick, verifiable number instead of guessing.
Practically, that count is useful two ways: as a sanity check before a long batch actually runs (does this say 6 checkpoints when you meant to select 8? something upstream dropped entries), and as a value you can feed forward - into a label, a log message, or a comparison - so your saved outputs or console logs can say "ran across N configurations" without you hand-typing that number and having it drift out of sync the next time you change the list.
The input and output
input_list(LIST, required) - the list you want the length of.- Output is a single
INT- its element count.
Like the rest of this pack's list nodes, LIST here is a custom type carrying a Python list as one value - this node doesn't trigger anything to run once per item, it just measures what's already there.
How to install it
ComfyUI Manager: search DemonAlone-nodes-ComfyUI, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/DemonAlone/DemonAlone-nodes-ComfyUI
then restart. No dependencies, no models - a one-line utility, live as soon as the pack loads.
Common issues & troubleshooting
The count is lower than I expected. Trace back to whatever built the list. This pack's generator nodes (Dynamic Checkpoint Selector, Dynamic VAE Selector) use ten dropdown slots defaulting to "none" - if some of those were left at their default, they likely aren't counted as real entries, so the list can be shorter than the number of slots you see on the node.
The socket won't connect. Same rule as this pack's other list nodes: input_list needs to be typed LIST from this pack, not a generic list from an unrelated node pack's own custom type.
Do I need this if I already know how many items I put in? Only if "how many I put in" and "how many actually made it through" might differ - which, in a graph with conditional branches, merges, or dynamic selection upstream, is more often than you'd think. If your list is a fixed, hand-typed constant with nothing dynamic feeding it, you can skip this and just remember the number.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input_list | LIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |