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 to0, with a valid range from0to9in steps of1. - 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 = 0returns the first element,index = 1returns the second, and so on. - Because
indexis limited to0–9, only the first ten elements of the input can be selected. - If
inis shorter thanindex + 1, or ifindoes 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.