Batch Images (Yogurt Nodes)
Up to 32 images, one batch — without the resolution headache
- images1
- images2
- images3
- images4
- images5
- images6
- images7
- images8
- images9
- images10
- images11
- images12
- images13
- images14
- images15
- images16
- images17
- images18
- images19
- images20
- images21
- images22
- images23
- images24
- images25
- images26
- images27
- images28
- images29
- images30
- images31
- images32
- images
- count
- width
- height
- channels
ComfyUI gets its speed from batching - one IMAGE tensor carrying N frames through a sampler is dramatically cheaper than running the same sampler N times. But building that batch is usually the awkward part, because the moment your images have different resolutions, the batch is illegal. Batch Images solves the boring half: it takes up to 32 image inputs, makes them uniform, and combines them into a single tensor. Then it hands you the count, width, height, and channels as plain numbers, which is a sneaky-useful bonus.
How it works
Every image input (images1 through images32) gets resized so the whole batch shares one resolution, then stacked into a single (N, C, H, W) tensor. How the resize happens is up to you:
- method -
stretch(just distort to the target size),fill / crop(scale to cover, then crop the overflow), orpad(scale to fit, pad the leftover withpad_value, default 1 = white).padis the one that won't wreck your images, which is why it's the default. - interpolation -
nearest,bilinear,bicubic,area,nearest-exact,lanczos.lanczosis the default and the right choice for most upscaling-flavored batching;nearestonly when you want pixel-crisp no-smoothing behavior.
Then the whole batch gets sliced with start_index, end_index, and step - literally Python slice semantics ([start:end:step]). end_index of 0 means "to the end," and negative values work like Python's. So you can not only combine 32 images, you can feed in a big batch and pull out a subset, or every-other-frame it with step 2. That makes the node useful even with a single input: it's a batch slicer that also reports its own dimensions.
Inputs that matter
- images1 … images32 - the images to combine. All optional; the node works with one, and the max is thirty-two.
- method / pad_value - how to reconcile resolution differences. Leave on
padunless you have a reason not to. - start_index / end_index / step - the slice. Leave at
0 / 0 / 1for "everything," or slice a subset out of a batch you already have.
Outputs
- images - the combined (or sliced) batch. Wire it into a sampler, a vision node, or a save node.
- count - number of images in the output.
- width, height, channels - the dimensions. These are handy for logic: gate a workflow on image count, or feed the resolution into a resize node. The fact that the node reports them is genuinely useful in automation, not just trivia.
Install
Standard Yogurt Nodes install. ComfyUI Manager → search "ComfyUI-YogurtNodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes && pip install -r requirements.txt
Then restart ComfyUI. Pure tensor work - no models, no downloads.
Where people get burned
Two things. First: pad pads with a solid color, and pad_value 1 is white - if your images have wildly different aspect ratios, padding leaves big white bars that downstream nodes see as content. For photo work you often want fill / crop instead, and for grids of same-size images the whole question disappears. Second, remember that slicing with step reorders nothing and drops nothing silently - it follows Python slicing exactly, so start_index 1 means you lose the first image. If your output count mysteriously looks wrong, walk the slice settings before suspecting a bug. And the one genuinely sharp edge: a batch is only as uniform as you make it, so if you combine images of very different resolutions, the resize step is doing real work - keep an eye on what method you chose or your "no distortion" batch suddenly has squished faces.
Inputs (38)
| Name | Type | Default | Description |
|---|---|---|---|
| interpolation | COMBO | lanczos | 6 options: nearest, bilinear, bicubic, area, nearest-exact, lanczos |
| method | COMBO | pad | 3 options: stretch, fill / crop, pad |
| pad_value | FLOAT | 1.00 | — |
| start_index | INT | 0 | The start index. Same as Python slicing. |
| end_index | INT | 0 | The end index. Same as Python slicing. 0 means the end. Negative values are also supported. |
| step | INT | 1 | The step. Same as Python slicing. |
| images1opt | IMAGE | The image 1 to batch. | |
| images2opt | IMAGE | The image 2 to batch. | |
| images3opt | IMAGE | The image 3 to batch. | |
| images4opt | IMAGE | The image 4 to batch. | |
| images5opt | IMAGE | The image 5 to batch. | |
| images6opt | IMAGE | The image 6 to batch. | |
| images7opt | IMAGE | The image 7 to batch. | |
| images8opt | IMAGE | The image 8 to batch. | |
| images9opt | IMAGE | The image 9 to batch. | |
| images10opt | IMAGE | The image 10 to batch. | |
| images11opt | IMAGE | The image 11 to batch. | |
| images12opt | IMAGE | The image 12 to batch. | |
| images13opt | IMAGE | The image 13 to batch. | |
| images14opt | IMAGE | The image 14 to batch. | |
| images15opt | IMAGE | The image 15 to batch. | |
| images16opt | IMAGE | The image 16 to batch. | |
| images17opt | IMAGE | The image 17 to batch. | |
| images18opt | IMAGE | The image 18 to batch. | |
| images19opt | IMAGE | The image 19 to batch. | |
| images20opt | IMAGE | The image 20 to batch. | |
| images21opt | IMAGE | The image 21 to batch. | |
| images22opt | IMAGE | The image 22 to batch. | |
| images23opt | IMAGE | The image 23 to batch. | |
| images24opt | IMAGE | The image 24 to batch. | |
| images25opt | IMAGE | The image 25 to batch. | |
| images26opt | IMAGE | The image 26 to batch. | |
| images27opt | IMAGE | The image 27 to batch. | |
| images28opt | IMAGE | The image 28 to batch. | |
| images29opt | IMAGE | The image 29 to batch. | |
| images30opt | IMAGE | The image 30 to batch. | |
| images31opt | IMAGE | The image 31 to batch. | |
| images32opt | IMAGE | The image 32 to batch. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| count | INT | — |
| width | INT | — |
| height | INT | — |
| channels | INT | — |