Faishme Stack Latents
Batch-Building for Latent Dicts, Not Just Images
- latent
- latent
- stack_size
Faishme Stack Latents does for latent space what Stack Images does for pixels: it collects multiple latent sources and merges them into batched latents. The complication it handles quietly is that a latent in ComfyUI isn't a plain tensor - it's a dictionary holding the samples tensor plus optional extras like noise_mask. This node concatenates every key in the dict, not just the main tensor, so the batch stays internally consistent.
How it works
Like its image sibling, it's list-aware (INPUT_IS_LIST): multiple latent sources wired into the latent input arrive as a list, get grouped into consecutive chunks of stack_size, and each group's dictionaries are merged key-by-key with torch.cat along the batch dimension. If your latents carry a noise_mask, that gets batched too, so a mask attached to each sample stays aligned with it. Feed six latent sources with stack_size 2 and you get three batched latents of two.
Inputs and outputs
- latent - accepts multiple latent sources (list-aware).
- stack_size - latents per output batch, 1 to 16.
Outputs:
- latent - a list of batched LATENT dicts, each holding up to
stack_sizesamples. - stack_size - the value you set, passed through.
It's an output node, so it can terminate a branch - though feeding the batched latents into a sampler is the actual play.
Why you'd use it
Same rationale as the image version, one stage earlier: samplers are far happier with a real batch than with one latent at a time. If you're assembling several pre-encoded latents - different crops, different masks, different sources - and you want them sampled together, stack them here before the sampler. It's also the natural partner to the pack's Repeat Latent Batch: repeat a latent N times, or stack N distinct latents, and both end up as a sampler-ready batch. In the Faishme workflow, that's how a set of masked garment crops becomes a single efficient sampling pass.
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 chunk-divisibility rule as its image sibling: if your source count isn't a clean multiple of stack_size, the last group comes out short and can break the sampler. And while this node batches every key in the latent dict, it concatenates - so if your sources have different keys (one has a noise_mask, another doesn't), the merged dict is only as consistent as its inputs. Check your sources match in structure before stacking, keep stack_size dividing your count, and it does exactly the job it promises.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| stack_size | INT | 11–16 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| stack_size | INT | — |