Nodes/ComfyUI-NynxzNodes/Get from Index
ComfyUI Node

Get from Index

Takes one item out of a batch of ANY type — images, masks, latents, audio, conditionings, or any list. Core needs a different node per type; this works the batch dimension out from the value, and the output socket takes the type you wired in. Negative indices count from the end, and the result keeps its batch dimension, so it drops straight back into anything that took the original.

By Nynxz·Created 11 months ago·Updated 4 days ago· 3
Get from Index
  • batch
  • item
  • index
  • count
◄index0►
◄length1►
◄out_of_rangeclamp►
CategoryNynxz/Batch

Inputs (4)

NameTypeDefaultDescription
batchCOMFY_MATCHTYPE_V3Any batched value: an IMAGE or MASK batch, a LATENT, an AUDIO, a CONDITIONING, or a list.
indexINT0-4096–4096Which item, from 0. Negative counts from the end, so -1 is the last — the same convention as core's Get Image from Batch.
lengthoptINT11–4096How many items to take from `index`. 1 is a single item; more returns a smaller batch. Trimmed to what is actually there.
out_of_rangeoptCOMBOclampWhat an index past the end means. 'clamp' takes the nearest real item, matching core's nodes. 'wrap' counts round, for driving this from a counter. 'error' stops the run, for when an out-of-range index means something upstream is wrong.

Outputs (3)

NameTypeDescription
itemCOMFY_MATCHTYPE_V3—
indexINTThe index actually used, after negatives and out_of_range were resolved — so a wrapped or clamped index is visible rather than guessed.
countINTHow many items the incoming batch held.