Nodes/ComfyUI_faishme/Faishme Unstack Latents
ComfyUI Node

Faishme Unstack Latents

Split a Latent Batch Into Single-Sample Chunks, Masks Included

By AkashKarnatak·Created 2 years ago·Updated about a year ago· 0
Faishme Unstack Latents
  • latent
  • latent
stack_size1

Faishme Unstack Latents is the teardown side of the latent batch pair - the counterpart to Faishme Stack Latents. It takes batched latents and splits them along the batch dimension into chunks of stack_size, so a sampler-produced batch of four latents becomes four separate latent dicts you can process individually. And because it operates on the whole latent dict, any noise_mask attached to the samples gets split alongside them, keeping masks glued to their latents.

How it works

For each incoming latent batch, the node slices the samples tensor into consecutive chunks of stack_size along the batch axis and emits each chunk as its own LATENT in the output list. Like the rest of the family it's list-aware, so it accepts multiple incoming batches and splits each one. A batch of four latents with stack_size 1 → four single-sample latents; with stack_size 2 → two batches of two. The noise_mask, when present, is split by the same logic so it stays matched to the samples it belongs to.

Inputs and outputs

  • latent - the batched LATENT (or several, as a list) to split.
  • stack_size - samples per output chunk, 1 to 16.

Output is a single latent - a list of LATENT dicts, each holding up to stack_size samples. It's an output node, so it can terminate a branch.

Why you'd use it

Post-sampling fan-out in latent space. Generate a batch, then unstack to decode, inspect, or re-encode each latent individually. Because it works before the VAE decode, you avoid paying for decode/encode round-trips on latents you're going to re-process - which is exactly the efficiency the pack's latent nodes are built around. It pairs naturally with Stack Latents upstream and with any per-latent step downstream, and it's the kind of node that only feels useful once you're running real batch pipelines.

Installing it

The standard pack install - ComfyUI Manager, search "ComfyUI_faishme", or:

cd ComfyUI/custom_nodes
git clone https://github.com/AkashKarnatak/ComfyUI_faishme

Restart ComfyUI. It appears under FaishmeNodes.

Where people get burned

The same alignment rule as everywhere else in this family: a batch that isn't a clean multiple of stack_size produces a ragged final chunk. Latents with a noise_mask split cleanly here, which is good - but it also means if you were expecting the mask to stay attached to the whole batch rather than following its samples, the behavior will surprise you. It's a straightforward, well-scoped utility: split the batch, keep the masks, move on.

CategoryFaishmeNodes

Inputs (2)

NameTypeDefaultDescription
latentLATENT
stack_sizeINT11–16

Outputs (1)

NameTypeDescription
latentLATENT