Nodes/ComfyUI-LogicUtils/Pyobjects/Cast to LIST
ComfyUI Node

Pyobjects/Cast to LIST

Force a value into a real Python list

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Pyobjects/Cast to LIST
  • py_obj
  • LIST

If you've landed on this page, you're probably deep into a graph that's doing more programmatic Python-object plumbing than typical image generation - this node's whole job is taking whatever value comes in on its wildcard input and forcing it into an actual Python list. Think of it as list(py_obj) in your head: whatever quirky object another node handed you - a tuple, a generator, a dict view, something else entirely - comes out the other side as a genuine, ordinary list, so anything downstream that assumes standard list behavior (indexing, len(), iterating more than once) actually gets one.

It's part of aria1th's ComfyUI-LogicUtils pack - the same GitHub account behind the Illustrious XL checkpoints under the AngelBottomless handle, though this small utility pack is a completely separate, much quieter piece of work, last touched 2026-01-21.

Inputs and outputs

  • py_obj - any value, typed as the wildcard *. Connect literally anything.
  • Output - a single LIST.

That's the entire schema - one cast, no configuration.

One detail worth knowing: this node is flagged as an output node in ComfyUI's terms, meaning it'll execute even if you leave the LIST output unwired downstream. That's handy while you're building a graph and just want to confirm a value got cast correctly, though don't expect a rich visual preview - a raw Python list doesn't render as anything more than plumbing succeeding or failing.

Where you'd actually use it

Honestly: this is deep-graph plumbing, not a node most beginners need to go looking for. It matters when you're chaining data through nodes (this pack's own or others') that specifically expect a LIST-typed value rather than the permissive wildcard * that most of this pack's other nodes pass around, or when you need the actual Python type to be a list rather than whatever iterable-like object happened to come out of an upstream node. If you got here from a shared workflow's missing-node error, it's a safe bet the graph is doing something more custom/programmatic than a standard txt2img pipeline.

Its sibling, Pyobjects/Cast to SET, does the same thing but casts to a Python set instead - reach for that one if you specifically want duplicates dropped and don't care about order.

Installing it

ComfyUI Manager → search ComfyUI-LogicUtils → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils

No model files, and no real dependencies to speak of - a r/StableDiffusion thread recommending lean logic-node packs over heavier alternatives (WAS Node Suite, Impact Pack) called this pack out by name for having none. The README's own auto-install hook is opt-in (COMFYUI_LOGICUTILS_AUTO_INSTALL=1) and can be forced off (COMFYUI_LOGICUTILS_SKIP_INSTALL=1).

Common issues

There isn't much to break in a straight type cast, but casting only works on things that are actually iterable - Python's plain list() call errors out on a bare number or a non-iterable object rather than wrapping it into a single-item list. If this node throws on something you fed it, that's the likely reason: check that py_obj is already list-like (a tuple, a generator, another collection) before assuming the node itself is broken. And as with the rest of this pack, it hasn't been updated since January 2026, so it's stable but not actively maintained.

CategoryData

Inputs (1)

NameTypeDefaultDescription
py_obj*

Outputs (1)

NameTypeDescription
LISTLIST