Latent Batch (Advanced)
Merge two latents into one batch before the expensive part
- latent_a
- latent_b
- latent_c
- latent_d
- latent_e
- latent_f
- latent_g
- latent_h
- latent_i
- latent_j
- latent_k
- latent_l
- latent_m
- latent_n
- latent_o
- latent_p
- latent_q
- latent_r
- latent_s
- latent_t
- latent_u
- latent_v
- latent_w
- latent_x
- latent_y
- latent_z
- latent
- count
WAS documents an Image Batch node for combining multiple image tensors into one batch; Latent Batch is the equivalent operation one step earlier in the pipeline, working on latents instead. It takes two (or more) latent inputs and combines them into a single batched latent - the same idea, applied before the VAE decode instead of after it.
Why batching latents specifically matters
Latents are what sit between your sampler and your VAE decode, and batching them isn't just bookkeeping - it changes how the GPU actually does the work. Running one KSampler pass over a batch of four is meaningfully more efficient than running four separate sampler calls one after another, because the GPU can process the batch in parallel rather than paying the overhead of four independent passes. The same goes for VAE Decode and any other latent-space operation downstream.
The practical case: two branches of a workflow produce different latents - maybe two different seeds you're comparing, or two different conditioning setups - and you want to merge them back into a single batch before a shared, expensive step like an upscale or a refinement pass, instead of duplicating that whole back half of the graph to run it twice.
How it works
Feed it two (or more) LATENT inputs, get back a single LATENT, batched. Wire the output into a KSampler, VAE Decode, Latent Upscale, or anywhere else downstream that expects a batched latent.
The one hard requirement: the latents being combined need matching spatial dimensions in latent space - you can't batch a latent from a 512×512 image with one from a 768×768 image without resizing one first. If your two branches generated at different resolutions, run one through WAS's Latent Upscale by Factor (or the core Latent Upscale node) to bring them into alignment before this node, not after.
Installing it
Part of the full WAS Node Suite pack:
- ComfyUI Manager - search WAS Node Suite, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/WASasquatch/was-node-suite-comfyui/, thenpip install -r requirements.txtfrom inside that folder, then restart ComfyUI.
Common issues
Dimension mismatches are the main failure mode - if this node errors or produces a malformed batch, check that both latents you're feeding in came from the same resolution, since latent space dimensions are a direct function of the pixel dimensions that produced them (downscaled by the VAE's fixed factor). Resize before you batch, not after.
And the pack-wide caveat: WAS Node Suite has been unmaintained since December 2023, and "Import Failed" errors after a ComfyUI update are a real, recurring complaint tied to older pinned dependencies colliding with newer ones. Reinstalling requirements.txt inside your ComfyUI venv is the usual fix if the whole suite stops loading.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| latent_aopt | LATENT | First latent or batch. Every connected slot has to hold the same number of channels on the same grid, and at least one slot must be connected. | |
| latent_bopt | LATENT | Latent 2, joined on after the one before it. Unconnected is skipped. | |
| latent_copt | LATENT | Latent 3, joined on after the one before it. Unconnected is skipped. | |
| latent_dopt | LATENT | Latent 4, joined on after the one before it. Unconnected is skipped. | |
| latent_eopt | LATENT | Latent 5, joined on after the one before it. Unconnected is skipped. | |
| latent_fopt | LATENT | Latent 6, joined on after the one before it. Unconnected is skipped. | |
| latent_gopt | LATENT | Latent 7, joined on after the one before it. Unconnected is skipped. | |
| latent_hopt | LATENT | Latent 8, joined on after the one before it. Unconnected is skipped. | |
| latent_iopt | LATENT | Latent 9, joined on after the one before it. Unconnected is skipped. | |
| latent_jopt | LATENT | Latent 10, joined on after the one before it. Unconnected is skipped. | |
| latent_kopt | LATENT | Latent 11, joined on after the one before it. Unconnected is skipped. | |
| latent_lopt | LATENT | Latent 12, joined on after the one before it. Unconnected is skipped. | |
| latent_mopt | LATENT | Latent 13, joined on after the one before it. Unconnected is skipped. | |
| latent_nopt | LATENT | Latent 14, joined on after the one before it. Unconnected is skipped. | |
| latent_oopt | LATENT | Latent 15, joined on after the one before it. Unconnected is skipped. | |
| latent_popt | LATENT | Latent 16, joined on after the one before it. Unconnected is skipped. | |
| latent_qopt | LATENT | Latent 17, joined on after the one before it. Unconnected is skipped. | |
| latent_ropt | LATENT | Latent 18, joined on after the one before it. Unconnected is skipped. | |
| latent_sopt | LATENT | Latent 19, joined on after the one before it. Unconnected is skipped. | |
| latent_topt | LATENT | Latent 20, joined on after the one before it. Unconnected is skipped. | |
| latent_uopt | LATENT | Latent 21, joined on after the one before it. Unconnected is skipped. | |
| latent_vopt | LATENT | Latent 22, joined on after the one before it. Unconnected is skipped. | |
| latent_wopt | LATENT | Latent 23, joined on after the one before it. Unconnected is skipped. | |
| latent_xopt | LATENT | Latent 24, joined on after the one before it. Unconnected is skipped. | |
| latent_yopt | LATENT | Latent 25, joined on after the one before it. Unconnected is skipped. | |
| latent_zopt | LATENT | Latent 26, the last slot. Unconnected is skipped. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | One latent holding every connected input end to end, in slot order, so a sampler runs them in a single pass. |
| count | INT | How many frames the batch holds, which is the total across the slots rather than the number of slots. |