Anything To List
Stop wiring three separate branches into three separate nodes
- any1
- any2
- any3
- merged_list
- total_items
A lot of ComfyUI nodes want a list - a for-each loop, a batch processor, anything that iterates. But your data usually doesn't start life as a list. It's three separate outputs from three separate nodes, or one image batch tensor that isn't technically a "list" in the sense a list-consuming node expects. KY_AnyToList exists to close that gap: wire up to three things into it, get one merged list out.
What it actually does with each input
Per the node's own description, it's type-aware rather than a dumb concatenation. A plain value - an int, float, bool, or string - gets added to the result as a single item. A list you feed in gets extended into the result rather than nested as one item. An image batch or tensor batch gets split apart into a list of individual single images/tensors, not kept as one batched blob. That last behavior is the one to actually pay attention to: if you wire in a 4-image batch expecting it to land as one list entry, it doesn't - you get four separate entries in the merged list instead.
Inputs and outputs
any1 is the only required input, wildcard-typed so it accepts anything. any2 and any3 are optional, same wildcard type. Order matters: items get appended in any1 → any2 → any3 sequence, so if downstream processing order depends on it, wire accordingly.
Two outputs: merged_list (wildcard-typed, marked as a list) and total_items (an INT telling you how many items ended up in it). That count is worth actually checking before you assume your merge did what you think - it's the fastest way to catch the batch-gets-split behavior above before it surprises you three nodes downstream.
Where this fits in a real graph
The natural partners are its own siblings in this pack: KY_First_NOT_EMPTY and KY_isNone for filtering what goes in, KY_JoinToString if what you actually want out is a single joined string rather than a list, and KY_DummyOut if you just need a place to preview the merged result without saving anything. Outside the pack, this is the node you reach for right before anything that expects IS_LIST behavior - a batch caption node, an iterator, a for-loop-style custom node from another pack.
Installing it
ComfyUI Manager: search ComfyUI-KYNode, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/yorkane/ComfyUI-KYNode
Restart ComfyUI. No external dependencies - it's pure Python list logic, nothing to download.
Common issues
The image/tensor-batch splitting behavior above is the one that trips people up most, because it's invisible until you check total_items. If you expected a merged list of length 3 (one image batch + two plain values) and got a much larger number, that's your batch getting exploded into individual frames - which is often what you actually want for iteration, but not always what you expect at a glance.
Since every wired input is wildcard-typed, ComfyUI won't stop you from mixing genuinely incompatible things into one list - a string next to a tensor next to a boolean. That's fine if the downstream node genuinely handles mixed types, but if the next node in your graph assumes a uniform list (all images, all strings), a silent type mismatch there is a KY_AnyToList upstream problem, not a bug in the consuming node.
And because only any1 is required, leaving any2/any3 unconnected is completely normal - this node degrades gracefully to "wrap a single value in a one-item list" when that's all you give it, which is a legitimate use on its own if some other node insists on list input for a single value.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any1 | * | — | |
| any2opt | * | — | |
| any3opt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| merged_list | * | — |
| total_items | INT | — |