EasyUse/Logicgenerated

Index Any(indexAnything)

Index Any extracts a single element from an input collection using an integer index.

index Anything

any
out
index
0
Easy Use

Index Any extracts a single element from an input collection using an integer index. It is a generic logic node in the EasyUse suite, so it works with any input type rather than being limited to a specific data kind such as images, latent tensors, or strings.

Description

The node accepts an any input plus an index value, and returns the element found at that position. Because any is an arbitrary ComfyUI type, the node can be used to index into lists, tuples, or other indexable structures, and the output type will match the element type of the input.

Inputs

any

The collection, sequence, or other indexable value to select from. This input uses ANYTYPE, so it can receive any ComfyUI data type.

index

The zero-based position of the element to retrieve.

  • Default: 0
  • Minimum: -1000000
  • Maximum: 1000000
  • Step: 1

Negative values select from the end of the collection, following standard indexing semantics. Use -1 to get the last item, -2 for the second-to-last item, and so on.

Outputs

ANYTYPE

The element at the selected index position. The output type follows the element type of the collection supplied to any. If the indexed item is itself a complex value such as an image or latent representation, that value is passed through unchanged.

Usage Notes

  • This node is especially useful for picking individual items from a batch or sequence when a later node needs a single value rather than an entire collection.
  • The large index range makes it safe to use with very long sequences, while still allowing negative indices for reverse access.
  • Because the input is ANYTYPE, the node can also be used as a generic passthrough selector in dynamic logic pipelines.
  • If the provided index is out of range for the actual collection, behavior depends on the underlying Python object being indexed; for most standard sequences this will raise an error, so validate indices when the collection length is not fixed.

Comments

Sign in with GitHub to join the discussion.

Loading comments…