Change Latent Batch Size (Inspire)
Resize a latent batch to an exact count
- latent
- LATENT
Same job as Change Image Batch Size, but in latent space - which is usually where you actually want to do it. It forces a LATENT batch to an exact count, padding a short batch or trimming a long one, before you ever decode to pixels. If a downstream node (a video sampler, a batch combiner) demands a specific frame count and your latent has the wrong number, this makes them match.
Doing it on latents rather than images is the smart move: latents are far smaller than decoded frames, so reshaping the batch here is cheaper and you avoid decoding frames you're only going to throw away. It's a utility node, not a creative one, but it's the correct place to fix a count mismatch in a latent pipeline.
How it works
You give it a LATENT batch and a target batch_size, and it reshapes to hit that number. The simple mode follows the same rule as its image sibling: grow the batch and the last latent is duplicated to fill; shrink it and the batch is cropped to length. No blending or interpolation - a plain pad-or-truncate on the batch dimension.
The inputs and outputs that matter
latent- the LATENT batch to resize.batch_size(default 1, up to 4096) - the exact count you want out. This is the control.mode-simple, the duplicate-last / crop behavior above.
Output is a single LATENT batch at your target count. Feed it onward to your sampler, combiner, or VAE Decode.
Installing it
Ships with the Inspire Pack by Dr.Lt.Data, author of ComfyUI Manager and the Impact Pack - mainstream, well-kept tooling. Via ComfyUI Manager: search ComfyUI Inspire Pack, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Inspire-Pack
then restart. No dependencies or downloads.
Common issues
Padded latents decode to repeated frames. Expected - simple mode fills by duplicating the last latent, so the added frames are copies, not new content. If you needed genuine new frames, this isn't the tool; use frame interpolation after decode. This node makes counts agree, nothing more.
It cropped the frames I wanted to keep. It keeps the first N and drops the tail. Select or reorder the batch upstream if you need a different slice.
Latent vs image version - which? Prefer this latent one whenever the mismatch is before VAE Decode; it's lighter than reshaping decoded images. Only reach for Change Image Batch Size when the count problem appears after you've already decoded to pixels.
Nodes won't load after install. Check the terminal log - usually a version mismatch. Update Inspire Pack and Impact Pack together and restart.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| batch_size | INT | 11–4096 | — |
| mode | COMBO | 1 options: simple |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |