ARRAY INFO
How long is that array, actually?
- value
- length
A one-job node: hand it a JNComfy ARRAY, get back its length as a plain integer. That's the entire feature. It earns a place in your graph anywhere you need to know "how many items am I actually dealing with here" - before a loop, before a conditional, or just while debugging why something downstream is behaving like there's nothing to work with.
It's from JNComfy (jn-jairo/jn_comfyui), a one-person pack covering everything from voice conversion to face restoration to a family of small array and logic primitives - this node being one of the plainest of that last group. There's no real community conversation around this pack anywhere, so the README and the node's own inputs are the whole reference; there isn't a thread out there with a workaround waiting for you.
How it works
There isn't much mechanism to describe. value takes JNComfy's own ARRAY type - the structure produced by nodes like the pack's batch-to-array and multi-value-to-array converters - and the node counts its items, returning that count as length. It doesn't touch the contents, doesn't validate them, doesn't do anything else.
That length feeds naturally into a conditional check - the pack's own workflow-branching nodes, or just a debug read via JN_Dump - anywhere you want to confirm "is this array actually empty" before something downstream assumes it has data to work with.
It's also the simplest way to sanity-check an array-building step while you're still putting a graph together: wire JN_PrimitiveBatchToArray or JN_PrimitiveToArray into this, check the number, and you know immediately whether the upstream node actually bundled as many items as you expected - before you go debugging something three nodes further down that was never the real problem.
The inputs and outputs that matter
value(required,ARRAY) - the array to measure.- Output:
length(INT) - how many items are in it.
Installing it
ComfyUI Manager: search "JNComfy". Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/jn-jairo/jn_comfyui
Restart ComfyUI. No models, no dependencies - it's a length check.
Common issues & troubleshooting
Wiring in something that isn't actually a JNComfy ARRAY. This node specifically wants that type, not a raw ComfyUI batch tensor (a batched IMAGE or MASK). If you're trying to get "how many images in this batch" straight off a batch tensor, this node will reject it - convert with the pack's batch-to-array node first, then measure the result.
The count doesn't match what you expected. If an upstream array-building node has flags around merging or flattening nested items, a mismatch here is usually a sign the array wasn't built the way you assumed, not a bug in this node. Drop a JN_Dump on the array itself before this node to see what's actually in it.
That's basically the whole troubleshooting section. It's a length check on a well-defined type - if it errors, the problem is almost always upstream, in whatever built the array in the first place.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | ARRAY | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| length | INT | — |