array1 attribute
How long is that list, really?
- array_input
- length
- size
- dimension
In a node graph, lists arrive from other nodes and you usually have no idea what's in them. array1 attribute is the node that answers the most basic questions about a list - how long is it, how many elements total, how many dimensions - and hands you the answers as plain integers you can build logic on. It's the list equivalent of get tensor shape in the same pack, and it's a genuinely useful diagnostic.
The single input is array_input (a LIST). The three outputs:
length- the first dimension's length. For[1,2,3]that's 3; for a 2D array it's the number of rows.size- the total number of elements across all dimensions. For a 3×4 2D array that's 12, not 3.dimension- how many dimensions the array has (numpy'sndim). 1 for a flat list, 2 for a grid, and so on.
That length vs size distinction is the thing people trip on. A 2D pose array of 6 rows × 3 columns reports length=6, size=18, dimension=2. If you're planning a loop over rows, length is your count; if you're counting every number you've got, size is. Empty input returns 0, 0, 0 rather than erroring, so it's safe to leave dangling in a graph.
Real-world uses: feed this the output of a generated array and wire length into a batch-size input or a conditional, so a workflow adapts to how many items actually arrived. Or use dimension to sanity-check that a converter gave you a 2D array before you hand it to something that expects rows - a dimension of 1 where you expected 2 is usually the first sign data got flattened somewhere.
This lives in 807502278/ComfyUI-3D-MeshTool, a one-developer 3D utility pack. Pure Python, no models, no downloads. Install via ComfyUI Manager (search "ComfyUI-3D-MeshTool") and restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/807502278/ComfyUI-3D-MeshTool
cd ComfyUI-3D-MeshTool
pip install -r requirements.txt
Usual pack quirk: renamed nodes turn red on old workflows - recreate and reconnect. It's a boring node, but boring nodes are what stop you from counting rows by hand in a workflow.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| array_input | LIST | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| length | INT | — |
| size | INT | — |
| dimension | INT | — |