Nodes/ComfyUI_agilly1989_motorway/RepeatLatentBatch_motorway_edition
ComfyUI Node

RepeatLatentBatch_motorway_edition

RepeatLatentBatch from the bus — stack a latent into a batch, by key

By agilly1989·Created 2 years ago·Updated about a year ago· 7
RepeatLatentBatch_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_samples_keysamples
amount1
OUTPUT_LATENT_keyLATENT

RepeatLatentBatch is the latent-world version of copy-paste. It takes a latent sample and stacks it amount times into a single batch - same data, just repeated. One latent becomes a batch of four, ready for whatever node insists on seeing four.

It's the utility you reach for when a batch-shaped consumer meets a single-item producer. Some sampling and video nodes assume a minimum batch size, or a specific frame count, and your latent arrives as a lone sample. You repeat it, feed the batch, and the pipeline stops complaining. It's the latent twin of RepeatImageBatch, and like its sibling it does literally nothing else - no resizing, no cropping, no magic.

On the bus

The _motorway_edition version reads its input from the MOTORWAY 🚌💨 bus by key:

  • INPUT_samples_key (default samples) - the bus key holding the latent to repeat.
  • amount (default 1, range 1–64) - copies to stack. Note the ceiling: latents are memory-hungry, so the node caps you at 64 repeats. If you genuinely need more than that, you're probably doing something unwise.
  • OUTPUT_LATENT_key (default LATENT) - where the repeated batch is written back onto the bus.

The only return is the bus; the stacked latents ride inside under LATENT. Keys are case-sensitive and shared by name across the workflow - the sampler may have stored the latent as LATENT or latent_image, so match the key rather than fighting the defaults.

Repetition order is the same as the image version: a batch of 2 repeated 3 times comes out A A A B B B, not A B A B A B. If the consumer cares about ordering, plan upstream.

Install

No dependencies, no models - pure code:

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

or via ComfyUI Manager under the pack title ComfyUI_agilly1989_motorway, then restart.

The fine print

The pack is a self-described beta - "IF THINGS BREAK ITS BECAUSE I BROKE IT" is the README's opening line - and the _motorway_edition clones were auto-generated by a cloner that build 1.1.7 disabled. A fresh install may not include this node; the stock RepeatLatentBatch in core is always there and behaves identically.

Bus failure is the standard KeyError: 'hash_...' doesn't exist in motorway - the key was never stored upstream, usually a name or case mismatch between the producer and your INPUT_samples_key.

And the one real trap with latent repeats is VRAM. Every copy is a full latent tensor in memory, and they add up fast - a 1024×1024 latent batch of 16 is a lot more VRAM than the single latent you started with. If ComfyUI starts OOMing after you bump amount, that's the repeat, not the bus.

Categoryagilly1989 Nodes/Motorway-ed/latent/batch

Inputs (4)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_samples_keySTRINGsamples
amountINT11–64
OUTPUT_LATENT_keySTRINGLATENT

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨