Get Item (mtb)
Pull one element out of a list by index
- container
- item
The description is blunt and accurate: "Generic index based getter for common types." This is list[index] as a node. You feed it any list-typed container - a batch of images, a FLOATS list, a list of strings, whatever your graph happens to have - and it hands back the single item sitting at the index you specify. Nothing fancier than that, and the "generic" part is the whole point: because its input and output are both wildcard-typed (*), it works on essentially anything ComfyUI treats as a list, without needing a separate "Get Image From Batch" node, a separate "Get Float From List" node, and so on.
Where you'd actually use it
Anywhere you've assembled or received a list and only need one element out of it - pulling a single frame out of a batch for a preview, grabbing the third value out of a schedule to sanity-check a Fit Number-style remap, or picking one item out of whatever Image Batch To Sublist (mtb) or Get Batch From History (mtb) handed back. It's the kind of node that doesn't earn much attention on its own but shows up constantly as a small piece of a bigger debugging or data-wrangling step.
Inputs and outputs that matter
container- the list you're indexing into. Typed*, so it accepts whatever list-like data ComfyUI is carrying at that wire.index(default 0) - which position to pull. Standard zero-based indexing: 0 is the first item.- Output:
item- also typed*, matching whatever type was actually inside the container.
That's the entire node. No settings for handling out-of-range indices are exposed, so what happens if you ask for an index past the end of the list is up to how the underlying list type behaves - worth testing once rather than assuming.
Installing it
- ComfyUI Manager - search "MTB Nodes", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/melMass/comfy_mtb, restart. A manual clone needspip install -r requirements.txtrun inside thecomfy_mtbfolder first.
No models, no heavy dependencies for this one - it's a couple lines of indexing logic.
Common issues & troubleshooting
It errors with an out-of-range index. There's no clamping or wraparound built in here - if your container has 5 items and you ask for index 10, expect an error rather than a silently-clamped result. Double-check item_count (from a node like Image Batch To Sublist, if that's upstream) before setting index blindly.
The downstream node doesn't accept what comes out. Because both sides are wildcard-typed, ComfyUI will let you wire this into almost anything, but that doesn't mean the types actually match at runtime - pulling a single item out of a batch of images gives you an image, but pulling one item out of a FLOATS list gives you a float, and a node downstream expecting one won't accept the other just because the graph let you connect it.
A handful of mtb's other nodes fail to load at startup. Standard for this pack - check the console for [comfy_mtb] STATUS and http://127.0.0.1:8188/mtb for what didn't load and why. This node has no optional dependencies, so it's essentially never the one missing.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| container | * | — | |
| index | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| item | * | — |