Faishme Repeat Tensor Batch
One Line of PyTorch, Wrapped in a Node — Repeat Any Tensor Along the Batch Axis
- tensor
- tensor
Faishme Repeat Tensor Batch is the generic version of the pack's repeat nodes. Where the image and latent versions are typed to their specific data, this one accepts any tensor (* type) and repeats it along the batch dimension a set number of times. If you've got a tensor that isn't an IMAGE or a LATENT - a conditioning tensor, an embedding, a control signal, anything torch-based - and you need N copies of it stacked, this is the node. The implementation is literally one PyTorch call: tensor.repeat(repeat, 1, 1, ...), which tiles along the first axis and leaves every other axis untouched.
How it works
The node checks that the input is actually a torch.Tensor (and errors if it isn't - feed it a string and it'll refuse), then repeats along dimension 0. A tensor of shape [2, 4] with repeat 3 becomes [6, 4]. Same ordering semantics as the image version: the original rows come out in order, each duplicated repeat times consecutively, not interleaved. repeat runs from 1 to 128.
Why you'd reach for it
This is the "I have a weird tensor and I need a batch of it" node. Common scenarios: broadcasting a single conditioning vector across a batch of images, duplicating a per-image control tensor to match the size of the batch it's being applied to, or generally making tensor shapes line up when a downstream node expects a batch and you only have one. Because it accepts Any, it's the one repeat node you can reach for when the other two don't apply - and it's the one most likely to be overkill if you're working with images or latents, where the typed versions are clearer.
Inputs and outputs
- tensor - any torch tensor. This is the only input that requires a real tensor; everything else about the node is permissive.
- repeat - copies along the batch axis, 1 to 128 (default 1).
Output is a single tensor, its first dimension multiplied by repeat.
Installing it
The standard pack install - ComfyUI Manager, search "ComfyUI_faishme", or:
cd ComfyUI/custom_nodes
git clone https://github.com/AkashKarnatak/ComfyUI_faishme
Restart ComfyUI. It appears under FaishmeNodes with no special dependencies.
Where people get burned
Two honest caveats. First, the * type means ComfyUI won't verify the input at wiring time - you only find out it wasn't a tensor when the node throws at execution. Second, "repeat along batch" is not the same as "repeat the whole batch" - if you wanted the entire tensor tiled as a block, this gives you row-wise duplication instead, and that distinction changes what downstream sees. For shape-matching problems it's a clean little hammer; just be sure it's the hammer you want.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| tensor | * | — | |
| repeat | INT | 11–128 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tensor | * | — |