TO ARRAY
Wire in as many values as you want, get one array out
- values
- ARRAY
You've got several separate values scattered across a graph - three candidate scores, five filenames, whatever - and you want them bundled into one list you can measure, reduce, or iterate over with the rest of JNComfy's array nodes. JN_PrimitiveToArray is the node that does the bundling.
It's part of JNComfy (jn-jairo/jn_comfyui), a one-person pack that also covers audio, face restoration, and sampling extensions, alongside this family of array and primitive utilities. There's essentially no discussion of the pack anywhere in the community, so the README and the node's own schema are the whole reference here, not a summary of something bigger.
How it works
values relies on the same patch as JN_FirstActive and JN_MathOperationArray - JNComfy's own "Easy multiple inputs" feature, documented in the README, which lets one socket accept as many wires as you actually connect rather than a fixed number of slots. Connect two candidates or twenty; they all arrive together and get bundled into a single ARRAY.
only_active (on by default) drops any candidate that isn't actually present - an unconnected optional slot, or a value the node considers empty - rather than including it as a placeholder entry. merge_array_items (also on by default) matters if one of your wired-in values is itself already an ARRAY: with it on, that array's items get flattened directly into the result instead of nesting an array-inside-an-array.
Worth not confusing this with JN_PrimitiveBatchToArray: that node unpacks the internal dimension of one already-batched object (like a batch of images), while this one bundles several separate wires together. Same destination type, opposite starting point.
The inputs and outputs that matter
only_active(required, boolean, defaults on) - skip inactive/empty candidates rather than including them.merge_array_items(required, boolean, defaults on) - flatten array-typed candidates instead of nesting them.values(optional, any type, multiple) - the values being bundled.- Output: ARRAY.
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.
Common issues & troubleshooting
The array is shorter than the number of wires you connected. That's only_active doing its job - an unconnected or empty candidate gets dropped silently rather than showing up as a None entry. If you need a fixed-length array where position matters (a placeholder preserved even when empty), turn only_active off.
A nested array shows up where you expected a flat list, or vice versa. That's merge_array_items. The exact interaction between it and only_active isn't spelled out beyond what the flag names suggest, so if the shape you're getting looks off, verify it empirically - wire a JN_Dump onto the output and check what's actually in there before trusting it in something load-bearing.
Confusing this with JN_PrimitiveBatchToArray. See above - one bundles separate wires, the other unpacks a single batched object. Reaching for the wrong one is the most common source of "why does my array only have one item" confusion.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| only_active | BOOLEAN | true | — |
| merge_array_items | BOOLEAN | true | — |
| valuesopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ARRAY | ARRAY | — |