Get Value from List
Forgiving index lookup that returns None instead of crashing
- py_list
- value
Get Value from List pulls an element out of a list by index - and unlike its stricter sibling in the pack, it refuses to blow up your workflow when the index is out of bounds. Ask for item 5 of a 3-item list and you get None back plus a polite warning in the console, not an error that kills the whole run.
That forgiveness is the entire personality of this node, and it's why it earns its slot in the ovum/loop category. Loops and counters produce dynamic indexes, and dynamic indexes go out of range. If your graph is walking a list with a counter that runs one step too far, you want "returns None" - you can then handle that downstream - rather than a hard stop on the last iteration.
Inputs and output
- py_list (
*) - the list to index into. The node is strict on this one thing: it raises a clear error if you pass something that isn't a list ("Input 'py_list' for getValueFromList must be a list"), because indexing a non-list is a mistake you'd want to know about. - index (
INT, default0, min0) - zero-based position. Note the minimum: negative indexes aren't allowed here, so no Python-style "count from the end" behavior.
Output: value (*) - the element at that index, or None (with a console warning) when the index is past the end.
How it differs from GetByIndex
This is the important decision to make, because comfy-ovum ships both:
- Get Value from List (this node,
ovum/loop) - forgiving: out-of-range index returnsNone+ warning. Great for loops and counters where overshoot is expected. - Get By Index (
ovum/lists/python) - strict: out-of-range raisesIndexError. Great when a missing element is a genuine bug you want to surface loudly.
Reach for whichever matches how you feel about failure: "keep going, I'll handle None" versus "tell me the moment something's wrong." For loop-driven indexing, most people want the forgiving one. Just be ready for None to flow into whatever's downstream - if a node downstream chokes on None, wrap the lookup with an IfElseOvum check or default it.
Installing it
It's part of sfinktah/comfy-ovum:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
or search comfy-ovum in ComfyUI Manager, then restart. No models.
Gotchas
Only the two above really matter: no negative indexes, and a non-list input raises. Everything else about it is deliberately, blessedly forgiving. If you find yourself indexing lists constantly with dynamic counters, this node plus GetListLength is a genuinely solid combo - measure the list, walk it, and let None stand in for "past the end."
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| py_list | * | — | |
| index | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | * | — |