Nodes/comfyUI-tool-2lab/latent batch 潜空间批处理
ComfyUI Node

latent batch 潜空间批处理

The latent-side batch node — nine inputs, one tensor, fewer KSampler passes

By AI2lab·Created 2 years ago·Updated 2 years ago· 23
latent batch 潜空间批处理
  • samples1
  • samples2
  • samples3
  • samples4
  • samples5
  • samples6
  • samples7
  • samples8
  • samples9
  • image

LatentBatch9 (2lab) is the latent-space sibling of the pack's ImageBatch9, and it does for compressed samples what that one does for pixels. Core ComfyUI's LatentBatch joins two latent tensors into one; this node joins up to nine - two required, seven optional - and hands you a single batched LATENT out the other side.

The whole point of batching in latent space is efficiency. Latents are the compressed representations that the sampler actually works on, so if you want to run the same sampling pass across several inputs - variations on a theme, a grid of seeds, a batch of img2img edits - you batch the latents before the KSampler and let the sampler chew through the whole stack in one go. Do it with LatentBatch chained three times and your graph turns into a tower; do it with this and it's one node with numbered slots. For a workflow that runs a dozen variations, that's not cosmetic - it's the difference between a graph you can read and a graph you can't.

How it works

Required inputs:

  • samples1, samples2 - the first two latent samples.

Optional inputs:

  • samples3 through samples9 - seven more latent slots.

The output is image (the name's a little misleading - the type is LATENT), the concatenated batch. Wire it into a KSampler for batched sampling, then a VAE Decode that turns the whole batch into images, typically ending in a grid or batch preview.

The gotcha is the same as its image twin: concatenation demands matching shapes. Every latent in the batch needs to have the same dimensions - which practically means they all came from the same resolution. If you VAE-Encode images of different sizes and try to batch them here, you'll hit a shape mismatch. Normalize your inputs to one resolution before encoding and you're fine.

Installing it

Part of AI2lab/comfyUI-tool-2lab. ComfyUI Manager → search comfyUI-tool-2lab → Install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AI2lab/comfyUI-tool-2lab

Restart ComfyUI after. No downloads, no dependency hell - the pack is a Chinese dev's collection of small utilities, README one word long, all nodes labeled in 中文. If you're already stacking LatentBatch nodes to get more than two samples into a pass, this is the cleaner version. If two is plenty, the core node will do.

Category🦊2lab/util/batch

Inputs (9)

NameTypeDefaultDescription
samples1LATENT
samples2LATENT
samples3optLATENT
samples4optLATENT
samples5optLATENT
samples6optLATENT
samples7optLATENT
samples8optLATENT
samples9optLATENT

Outputs (1)

NameTypeDescription
imageLATENT