EasyUse/Logicgenerated

Any Inversed Switch(anythingInversedSwitch)

Any Inversed Switch is a generic selector node. It takes a single arbitrary value as in, treats it as an indexable container or sequence, and returns the elemen...

anything Inversed Switch

in
ANYTYPE
index
0
Easy Use

Any Inversed Switch is a generic selector node. It takes a single arbitrary value as in, treats it as an indexable container or sequence, and returns the element selected by the integer index. It is the inverse counterpart to the standard Any Switch: instead of using an index to pick one of several connected inputs, it uses an index to pick one element from a single connected value.

Inputs

  • index (INT): Zero-based position of the element to select. Defaults to 0, with a valid range from 0 to 9 in steps of 1.
  • in (ANYTYPE): The value to index into. This can be a list, tuple, string, tensor, or any other type that supports integer indexing.

Outputs

  • ANYTYPE: The element at the selected index. For lists/tuples this is the stored item; for strings it is a single-character string; for tensors it is the slice along the first dimension.

Usage Notes

  • Indexing is zero-based, so index = 0 returns the first element, index = 1 returns the second, and so on.
  • Because index is limited to 0–9, only the first ten elements of the input can be selected.
  • If in is shorter than index + 1, or if in does not support integer indexing, the node will raise an error.
  • This node is data-type agnostic, making it useful for switching between items inside collections or slicing a single batch dimension without needing a type-specific node.

Comments

Sign in with GitHub to join the discussion.

Loading comments…