Nodes/ComfyUI-LogicUtils/Pyobjects/List Get
ComfyUI Node

Pyobjects/List Get

Pull one item out of a list by index

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Pyobjects/List Get
  • py_list
  • *
index0

The read side of the list nodes: you've got a LIST somewhere in the graph and you want one specific item out of it, by position. That's this node - Python's my_list[index], wired up.

What it does

Two required inputs: py_list (a LIST) and index (an INT, default 0). Because this pack is genuinely just thin wrappers around Python's own list semantics, standard indexing rules apply - index 0 is the first item, and since the underlying object is a real Python list, negative indices should count backward from the end the same way they do in a script (-1 for the last item, and so on). The output is a single wildcard port, *, because the item could be anything - a number, a string, a nested list, whatever was stored at that position.

Where this earns its keep: once you've built a list with Create/Append/Extend, or parsed one out of a JSON string, List Get is how you actually pull a specific value back out to use elsewhere - grab the third seed you collected, pull the first entry out of a parsed config, that sort of thing.

The inputs and outputs that matter

  • py_list (required, LIST) - the list to read from.
  • index (required INT, default 0) - the position to grab. Zero-based.
  • Output: * (wildcard) - whatever value lived at that index.

Installing it

Search ComfyUI-LogicUtils in ComfyUI Manager and install, or clone it by hand: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart. There's nothing model-related to download and no meaningful dependency chain - the pack came up specifically as the answer when someone on Reddit wanted the lightest possible node for basic logic operations and didn't want to drag in a whole install just to compare two numbers. It ships an install hook you have to opt into with COMFYUI_LOGICUTILS_AUTO_INSTALL=1, plus a hard off-switch (COMFYUI_LOGICUTILS_SKIP_INSTALL=1), though with nothing heavy to install you're unlikely to ever need to touch it.

Where people get burned

The obvious failure mode: index out of range. If your list has three items and you ask for index 5, this behaves exactly like Python's IndexError - the run fails rather than silently returning nothing or wrapping around. If you're computing the index dynamically (say, from a counter that's supposed to stay in bounds but might not), it's worth sanity-checking the list length before you get here, since there's no clamping or bounds protection built in.

The other thing worth knowing is the output type: it's wildcard, not locked to any specific type, because a list can hold mixed types in Python and this node has no way of knowing in advance what you'll find at a given index. That means ComfyUI won't catch a type mismatch for you at connection time if you wire the output somewhere expecting a specific type - you'll only find out at run time if what came back doesn't match what the downstream node wanted. And as with every node in this pack, the README itself admits the docs are still catching up to the number of nodes on offer, so the source is the fallback reference when behavior isn't obvious from the schema alone.

CategoryData

Inputs (2)

NameTypeDefaultDescription
py_listLIST
indexINT0

Outputs (1)

NameTypeDescription
**