ComfyUI Node

create_array

Tie a bunch of loose wires into one array

By cardenluo·Created 2 years ago·Updated a day ago· 324
create_array
    • array

    Sometimes the annoying part of a workflow isn't the generation, it's the plumbing: you've got five separate prompt strings or seeds scattered across the graph and a node downstream that wants them as one thing. create_array is the pack's answer to "collect these into a list." It has no required inputs - you just wire as many values as you want into its dynamic value_1, value_2, … sockets, and it hands you a single array output holding them in wire order.

    How it works

    Under the hood it's about as simple as a node can get. The node reads the current workflow (via hidden unique_id/prompt/extra_pnginfo parameters), walks its connected inputs, and gathers every value whose key starts with value into a Python list. The order comes from how you wired the ports, so port order is the array order - there's no sorting, no deduplication, nothing clever. What you get out is a LIST (the pack's array type), which is a single wire carrying a Python list as one object.

    That distinction matters, so it's worth being explicit: in this pack, array means "one wire that carries a Python list." That's different from a true ComfyUI list, which is a socket that carries many items in parallel (that's what create_list outputs, marked is_list). If a downstream node shows a socket that won't connect to your array, you almost always need type_ArrayToList to convert one shape into the other.

    What to do with it

    Wire it in front of anything that wants a batch of values on one wire. Feed it per-stage prompts you collected in the flow pipeline, gather several seed values before slicing them, or bundle a handful of control parameters into one object you can carry down the graph. It pairs naturally with array_Slice (to trim the gathered values) and array_Merge (to join two collections). Since it accepts anything - strings, ints, tensors, whatever - it'll happily hold a mixed bag, but keeping one type per array makes the downstream type checks in this pack much happier.

    Install

    It's part of ComfyUI-Apt_Preset: install via ComfyUI Manager (search "ComfyUI-Apt_Preset") or git clone https://github.com/cardenluo/ComfyUI-Apt_Preset into custom_nodes, run install.bat, and restart ComfyUI. No models, no special dependencies. The only real trap is forgetting that the output is a single object: nodes that expect multiple parallel wires (a true list) won't take it until you pass it through type_ArrayToList.

    CategoryApt_Preset/data

    Inputs (0)

    No inputs

    Outputs (1)

    NameTypeDescription
    arrayLIST