Nodes/Yaser-nodes for ComfyUI/๐Ÿ” Repeat Images - Yaser
ComfyUI Node

๐Ÿ” Repeat Images - Yaser

The batch-stretching utility you didn't know you needed

By YaserJaradehยทCreated about a year agoยทUpdated 11 months agoยท 8
๐Ÿ” Repeat Images - Yaser
  • images
  • IMAGE
โ—„amount1โ–บ

Repeat Images - Yaser does exactly what the name says: it takes an image (or a batch of images) and makes amount identical copies of it. One input, one output, no settings beyond a count. It sounds trivial, and it mostly is - but "repeat the batch" is a problem that shows up constantly once you start building real workflows, and ComfyUI has never given you a first-class button for it.

Why you'd ever need copies

The whole trick of ComfyUI is that batches are just tensors stacked along one dimension, and lots of nodes operate per-batch-item. That opens the door to things like: run one image through an img2img pass at denoise 0.3, 0.5, and 0.7 by feeding it in three times - batch-of-3, all the same frame. Or take a single reference image and feed it to a batch process that expects a full batch. Or stretch a 1-frame batch up to n frames so a video pipeline doesn't choke on a single-element batch.

That's the hidden value. A batch with one image isn't a problem until some node upstream demands a real batch, and then it is the problem. This node is the 10-second fix.

What it actually does

Mechanically it's one line of PyTorch: images.repeat(amount, 1, 1, 1). That repeats along the batch dimension only - the width, height, and channel dimensions stay untouched, so you're not tiling the image, you're stacking identical copies. amount runs from 1 to 1024, default 1. Feed it a batch of three and set amount = 2, and you get six frames (frame 0, frame 1, frame 2, frame 0, frame 1, frame 2) - the whole input batch is repeated, not each frame individually. If you need each frame repeated N times in place (frame 0, frame 0, frame 1, frame 1...), that's a different operation and this isn't the node for it.

The output is a plain IMAGE, same type as the input, so it drops straight into anything a normal image batch would feed: a sampler's latent_image, an upscale node, a save node, an img2img pass.

The two inputs

  • images - the IMAGE (or batch) to repeat.
  • amount - how many times to repeat the whole thing. Keep it sane; a 1024-copy batch of 4K frames will make your VRAM sad in ways you'll notice.

That's the entire interface. If you want a repeat that's aware of masks or latents instead of images, look elsewhere - this one is deliberately, usefully dumb.

Install

It ships in the YaserJaradeh pack, same as the rest:

cd ComfyUI/custom_nodes
git clone https://github.com/YaserJaradeh/comfyui-yaser-nodes.git

then restart ComfyUI, or grab it via ComfyUI Manager under "Yaser-nodes". No models, no dependencies beyond what ComfyUI already has.

Honest take

This is a tiny utility, and you won't build a workflow around it. But when a batch node upstream starts silently dropping frames or an img2img comparison needs the same image at three strengths, this is the node you'll grab rather than hand-editing a tensor. Five minutes from "why is my batch wrong" to "oh, right, repeat the batch." That's a fair trade for one node slot in a pack that's already in your custom_nodes folder.

CategoryYaser/Utils

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEโ€”
amountINT11โ€“1024โ€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEโ€”