Pyobjects/Set to List
The bridge back from SET to a type ComfyUI understands
- py_set
- LIST
Every other node in LogicUtils' set family - Create, Add, Remove, Clear, Union, Intersection, Difference, Symmetric Difference - deals in a SET type that's specific to this pack. Set to List (SetToListNode) is the exit ramp: it converts that SET into a plain LIST, the type the rest of ComfyUI (and every other node pack) actually knows how to consume. If you've done any set algebra in your graph, this is almost always the last node in the chain before the result goes anywhere useful.
Part of aria1th's ComfyUI-LogicUtils, a personal utility pack from the trainer behind Illustrious XL. It's an obscure library - barely documented, barely discussed - but the mechanics here are simple and reliable: it's a straight list(py_set) call.
Why this node has to exist
ComfyUI's type system is duck-typed at the graph level: a node declares what types its sockets accept, and the UI only lets you connect matching types. LogicUtils invented SET as its own type rather than reusing LIST, because a Python set and a Python list behave differently (no duplicates, no order) and collapsing them into one type would blur that distinction. The cost is that SET can only plug into other LogicUtils nodes - nothing in ComfyUI core, and no other pack's nodes, know what to do with it. SetToListNode is the one node whose entire job is closing that gap.
How it works
Feed it a SET; it calls list() on it and returns a LIST. One thing worth internalizing: sets are unordered, so the order of items in the resulting list isn't something you should build logic around - it can vary between runs even with the exact same set contents. If ordering matters for whatever comes next (say, you're feeding the list into something that processes items sequentially and the order changes the outcome), sort the list yourself downstream rather than relying on set iteration order.
Inputs and outputs
py_set(SET, required) - the set to convert.- Output:
LIST- the set's contents as a plain list, order not guaranteed.
How to install it
ComfyUI Manager: search "ComfyUI-LogicUtils", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils
then restart. No models, no GPU involvement - a trivial CPU-side conversion.
Common issues & troubleshooting
"Missing node type" on a shared workflow. ComfyUI Manager's "Install Missing Custom Nodes" installs the entire pack from the graph JSON in one pass.
Import error at startup. The README documents an opt-in dependency auto-installer: set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 before launch if a needed package wasn't installed automatically, or COMFYUI_LOGICUTILS_SKIP_INSTALL=1 to force it off if that hook is the problem. SetToListNode needs nothing beyond the standard library, so an import error here means the actual fault is elsewhere in the pack.
List order changes between identical runs. Expected, not a bug - Python set iteration order isn't guaranteed to be stable across processes. Sort the output explicitly if your downstream logic needs a consistent order.
Still can't connect the list where you want it. Double check the destination node's expected list contents (a list of strings vs. a list of numbers, for instance) - SetToListNode preserves whatever types were in the set, it doesn't coerce them.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| py_set | SET | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LIST | LIST | — |