Select Indexes From Any
The frame selector that doesn't care what you throw at it
- any
- any
Select Indexes From Images is the friendly version: it only works on image tensors, and that's fine. Select Indexes From Any is the general-purpose version with a * input that eats tensors and plain lists, plus one toggle that trips up more people than it should. It's from SineSwiper's LoadAnim-Adv pack, and it's what you grab when the thing you want to filter isn't an image.
What it is
Same frame-selection syntax as its sibling (Python-style range, colons, negatives, commas - 0:5, ::2, -1, 0,5:10:-1), but the input is any: a tensor, a list of tensors, a list of strings, whatever. It selects along the first dimension of a tensor, or along the length of a list. Same language, wider audience.
The input that confuses everyone: multi_item_list
This is the part worth reading twice. The node runs with ComfyUI's list-input mode on, so it receives a list of whatever your source emits. The toggle decides what "select from" means:
multi_item_listoff (default): treat the incoming items as separate things and run the selection on each one. Feed it a list of three image sets and you get three selections back - one per item.multi_item_liston: treat the incoming list itself as the thing to select from, and slice that - e.g., pick "file #2 out of the list."
The tooltip puts it exactly: with it on, it "will select from the initial given list, instead of selecting from each item in the list." Wrong setting is the classic "why is my output the wrong shape" bug, so if a selection comes back looking nothing like you expected, check this box first.
When you'd reach for it
- Filtering a list of file paths from List Files From Directory before a batch loop.
- Slicing a list of masks, latents, or conditioning - anything list- or tensor-shaped that isn't an IMAGE.
- Replacing Select Indexes From Images when you're not sure what type a source really emits; the
*input means it just works.
Inputs and outputs
Inputs: any (the set), indexes_to_select (the syntax string, default 0:), multi_item_list (the toggle). Output: any - the selected set. That's it. It's a knife with one blade, but the blade is sharp across every type.
Installing
Part of ComfyUI-LoadAnim-Adv. ComfyUI Manager → search "LoadAnim", or:
cd ComfyUI/custom_nodes
git clone https://github.com/SineSwiper/ComfyUI-LoadAnim-Adv.git
Restart ComfyUI. Dependencies are only torch, numpy, Pillow - nothing heavy, no models.
Gotchas
- Multi-item list + default off means "select from each file" - so
0:on a list of ten files returns ten selections, not one. That's correct behavior, just surprising the first time. - The node refuses to select from something it can't index (a bare int, a dict) with a clear error. Better than a silent wrong answer.
- Empty input returns an empty list, but an empty selection string raises an error. Leave the default
0:alone unless you have a reason.
If you've ever wanted the image selector's syntax but found yourself staring at a list of paths, this is the node. Just don't forget what multi_item_list is doing.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| any | * | Object set to select from. Must be a Tensor or list-like object. | |
| indexes_to_select | STRING | 0: | Indexes (zero-based) to select. Supports ':' for range selection (including ':#', '#:' formats), '::#' & '#::#' & '#:#:#' formats for step selection, ',' for multiple entries, and negative numbers for selecting from the end. |
| multi_item_list | BOOLEAN | false | Indicates that the input is from an output node that supports list processing (usually marked with a multi-box icon). If true, it will select from the initial given list, instead of selecting from each item in the list. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| any | * | The selected set. |