Nodes/ComfyUI-IcyHider/Icy LatentFromBatch
ComfyUI Node

Icy LatentFromBatch

Pull One Latent Out of a Batch Without Re-rolling

By icekiub-ai·Created 9 months ago·Updated 9 months ago· 31
Icy LatentFromBatch
  • samples
  • LATENT
batch_index0
length1

When you sample with a batch size bigger than one, ComfyUI hands you back a stack of latents, not a single image. Most of the time that's fine - you decode all of them or you don't care. But occasionally you want just the third one, and that's the entire job of IcyLatentFromBatch: it slices one latent out of the batch so the rest of your graph only sees that one.

The "Icy" tag means the preview hides until hover - IcyHider's whole gimmick is wrapping core ComfyUI nodes with the same inputs, outputs, and code, then covering their previews. So IcyLatentFromBatch is core LatentFromBatch with a privacy coat and a new home in the IcyHider Comfy Core category. If you've used the core node, you've used this one.

The three inputs

From the schema, it's minimal:

  • samples - the LATENT batch.
  • batch_index - which item you want, default 0. Negative indexes work and count from the end, which is handy when you want "the last one."
  • length - how many items to pull out, default 1, up to 64. Set length > 1 and you get a sub-batch instead of a single latent.

Output is a single LATENT. Note that even with length: 1 the result is still a batch-of-one tensor, so don't be surprised when downstream nodes treat it like a tiny batch - that's normal and everything handles it.

Where this earns its keep

The classic pattern is batch diversity testing: run a KSampler with a batch of 4-8 seeds, then feed only the winner into the expensive stuff - VAE decode, an upscaler, a detail pass, a second-stage model. Decoding and upscaling just one latent instead of all of them saves VRAM and time. It's also how you build the "roll a batch, keep the good one, feed it onward" loop that shows up in a lot of serious workflows, and it pairs nicely with LatentFromBatch's sibling RepeatLatentBatch when you need to control batch shapes for a second pass.

One warning: batch_index is zero-based and indexes latent positions, not your seeds. If you sampled seeds [10, 20, 30], the latent at index 0 is seed 10's output - keep your seed list handy or you'll grab the wrong one.

Install and gotchas

It's the same frontend-only pack, so no dependencies and no downloads:

# ComfyUI Manager: search "IcyHider", Install, restart

# or:
cd ComfyUI/custom_nodes
git clone https://github.com/icekiub-ai/ComfyUI-IcyHider.git
# restart ComfyUI

Two things that bite IcyHider users generally: the cover is DOM-based, so the newer Nodes 2.0 canvas frontend may not hide previews at all, and it's on-screen privacy only - whatever a SaveImage downstream writes is still on disk. Also remember that changing IcyHider's Avalanche or hide mode needs a page reload to take effect.

CategoryIcyHider Comfy Core

Inputs (3)

NameTypeDefaultDescription
samplesLATENT
batch_indexINT0-16384–16384
lengthINT11–64

Outputs (1)

NameTypeDescription
LATENTLATENT