Image Batch Repeat
Pad a short clip out to exactly 81 frames
- images
- images
- batch_size
Video models are picky about how many frames you hand them. Wan's native context is 81 frames. LTX wants a frame count divisible by 8 plus 1. Feed either one a 33-frame clip and you're fighting the sampler or its wrapper instead of making art. Image Batch Repeat is the short answer: stretch whatever you've got to exactly the length the model demands, by repeating frames.
It comes from WAS Node Suite, WASasquatch's MIT pack that's been around since the start of the ComfyUI custom-node scene. v3 (current) ships 457 nodes and, refreshingly, installs nothing extra - no pip packages, no model downloads.
Two modes, one job
The mode dropdown picks how the repeating works:
times- use the input frames as many times as you ask. 4 frames attimes3 gives you 12 frames, A B C D A B C D A B C D.times1 leaves the batch unchanged. This is pure tiling.to length- repeat until there are exactlylengthframes, cutting the last repeat short. 4 frames tolength10 gives A B C D A B C D A B. This is the one to reach for when a model wants a fixed count: setlengthto 81 and your 33-frame clip comes out exactly 81 frames. A length under your batch size trims it instead.
Each mode ignores the other's widget, so there's no ambiguity about which number rules. The each_frame toggle changes the character entirely: instead of repeating the whole run, every frame is repeated in place. A B C at times 2 becomes A A B B C C - that's how a single image becomes a still run, or how you slow a clip down evenly (hold every frame twice and play it back at the same rate). On to length, each frame gets an even share, so 3 frames to length 7 comes out A A A B B C C.
The two outputs are images (the repeated run, same size and channel count as the input) and batch_size (exactly how many frames came out - which in to length mode is precisely length). Feed batch_size to anything downstream that wants the run length told to it rather than inferred.
Where it fits
If you're doing any image-to-video work you'll meet the "this clip is too short" problem constantly. Instead of hand-wiring a loop of tiles and a slice, one node does it. There's a sibling in the same pack, Image Batch Ends, whose last output hands the seed frame to a continuation pass - Repeat is the node that gets the returned clip shaped into what the next stage wants.
Don't confuse this with making a video longer in a way that looks good. Repeating frames is a placeholder - it holds a pose, it stretches a beat, it feeds a model that needs the count - it doesn't synthesize motion. If you genuinely want 81 frames of new content, that's the chaining workflow (generate, take the last frame as seed, repeat), not this node. But for feeding models that demand exact lengths, or making a clip breathe in slow motion, it's exactly right.
The practical notes
Install is the standard pack dance: ComfyUI Manager and search "WAS Node Suite v3", or git clone https://github.com/WASasquatch/was-node-suite-comfyui into ComfyUI/custom_nodes and restart. Needs ComfyUI 0.14.0+ and Python 3.10+. v3's first start is a second or two slower while it writes its config and compiles; every start after is quick.
Worth knowing before you chase a "wrong" result: to length with each_frame on distributes frames evenly, so your original sequence order survives but the spacing isn't a straight hold-each-twice at odd lengths. And remember repeated frames are literally identical pixels - if you're sending the output to a video model as context, a pile of duplicate frames can read as a frozen camera. When the goal is genuinely new motion between frames, look to frame interpolation instead.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The frames to repeat, in order. A single image is a batch of one. | |
| mode | COMBO | times | `times` = use the frames as many times as asked; `to length` = repeat until there are exactly length frames, cutting the last repeat short. `times` ignores length, `to length` ignores times. |
| times | INT | 21–16384 | How many times the frames are used, so 1 = unchanged and 3 = three copies. 4 frames at times 3 answer 12 frames. Ignored while mode is `to length`. |
| length | INT | 161–16384 | Exactly how many frames come out, eg 81 for a model that wants 81. 4 frames to length 10 answer A B C D A B C D A B. A length under the batch size trims it instead. Ignored while mode is `times`. |
| each_frame | BOOLEAN | false | Repeat each frame in place rather than the whole run. A B C at times 2: false = A B C A B C; true = A A B B C C. On `to length` each frame is held an even share: 3 frames to length 7 = A A A B B C C. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | The repeated frames, in order, at the same size and channel count as the input. |
| batch_size | INT | How many frames came out, which is exactly length in `to length` mode. Feed it to anything that needs the run's frame count told to it. |