This one's not glamorous, it's just useful. Feed it an image (or, more usefully, a batch of images - a loaded GIF or video) and it hands back three numbers: width, height, and batch_size. That's it. Where it earns its keep is at the front of an AnimateDiff graph. Say you load a reference clip with this pack's LoadVideo node to drive a vid2vid or ControlNet workflow - instead of eyeballing the resolution and frame count and typing them into EmptyLatentImage by hand, you plug the loaded frames straight into ImageSizeAndBatchSize and wire its outputs into EmptyLatentImage's width, height, and batch size. Now your generated latent always matches whatever you loaded, automatically, even if you swap the source clip later.
There's no real "mechanism" to explain here - it inspects the image tensor's shape and splits it into three outputs. There’s exactly one input: image (IMAGE) - whatever batch you want measured. Restart ComfyUI afterward. batch_size comes back as 1 when I expected more. That almost always means the upstream node only loaded a single image rather than a sequence - check that LoadVideo (or whatever fed this node) is actually reading multiple frames and not just grabbing frame zero.
I matched EmptyLatentImage to a weird resolution and my motion looks worse. This pack's own AnimateDiff model was trained on 512x512 images, and results degrade outside that ballpark - more so than a typical image model, because the motion module is fighting an unfamiliar resolution on top of everything else. Nothing downstream changes when I swap the input video.
Practical setup and best practices
Enable VAE tiling. In the VAE Decode node, check “tile” if available. Use FP16 precision. When loading your checkpoint, select the fp16 variant if your GPU supports it (all RTX cards do). Generate at lower resolution, then upscale. Generate at 512x512 with SDXL Turbo (fastest), then run a second batch through a 2x upscaler node. Queue multiple small batches instead of one large batch. Close other GPU-consuming applications. Discord, browser hardware acceleration, and video players all compete for VRAM. Pin your model in memory. If using ComfyUI Manager, enable “keep models in VRAM” to avoid reloading the checkpoint between queues.
For production workloads generating 500+ images per day, consider a dedicated Mac Mini M4 (24GB) running ComfyUI as a headless image server. Need help implementing AI workflows in your business? Schedule a free consultation to design a pipeline tailored to your needs.
Working with batch size and related nodes
Restart ComfyUI. The ChangeImageBatchSize __Inspire node is designed to adjust the batch size of a given set of images, making it easier to manage and process image data in batches. This node is particularly useful when you need to ensure that your image batches are of a consistent size, either by expanding the batch with repeated images or trimming it to the desired number. The primary goal of this node is to provide flexibility in handling image batches, which can be crucial for various image processing and AI art generation tasks.
This parameter represents the input image batch that you want to resize. It is expected to be in the format of a tensor containing multiple images. This parameter specifies the desired batch size for the output image batch. It accepts integer values with a default of 1, a minimum of 1, and a maximum of 4096. The batch_size parameter determines how many images the output batch will contain. If the input batch has fewer images than the specified batch size, the last image in the batch will be repeated to meet the required size. This parameter defines the mode of operation for resizing the image batch. Currently, the only available option is "simple". In this mode, the node either repeats the last image to expand the batch or trims the batch to the specified size. The output parameter is the resized image batch, which is returned as a tensor. This tensor contains the images adjusted to the specified batch size, either by repeating the last image or trimming the batch.
Lots of cables and wires… I’ve been using ComfyUI for a few weeks now and noticed that when producing generations in batches, each image in that batch does not have a unique seed whereas in Automatic1111’s WebUI they do. So if you produced a batch of 20 images, and you dragged any one of those 20 images into ComfyUI, each one will load up the same workflow that created that exact batch and not the specific individual image itself. The reason for this is that during a batch, all the required randomness in a batch of images is derived from that single seed. This works differently from Automatic1111’s WebUI in that each image in a batch is an increment of the starting seed.
Back to ComfyUI. So let’s say out of that batch of 20 images, you like image #15 and wish to do further work on that either by tweaking things or passing it through other processing nodes. How would you do that? At first it would seem as if I would have to generate the batch again just to get the 15th image. This is very time and compute expensive. This is where the Latent From Batch node comes in. It can be used to pick a slice from a batch of latents and isolate it.
It needs to sit between the Empty Latents Node and the Sampler Node. The trick is to use that node before anything compute-expensive is going to happen to the batch. So if it is placed before any of the samplers, the sampler will only keep itself busy with generating the images you picked with Latent From Batch. So your entire workflow and all of the settings will work the same (including the batch count), but it will only generate and or save the images you have specified. We select Index 14 (the 15th image). 14 because the index is zero-based. Batch Index refers to the image you are wanting. Length refers to how many images after that image you wish to also generate. Be sure to lock the seed number and have control_after_generate set to fixed. This is so that if you need to do it a few times, the seed does not change. This will help those who might be a bit like me and are sometimes a bit forgetful.
To bypass this node and to run the batch as normal, simply put the node in bypass mode, this disables the node but keeps the connections intact. Do note that results can vary slightly, ranging from imperceptible to a few differences in details. Also keep in mind that that ancestral and SDE samplers and results can vary even more. An alternative to this is to not use or rather increase batch_size at all and keep that set to 1. Instead, just increase the batch_count found under Extra Options in the Menu panel. With batch_size and batch_count configured, you can fine-tune how many images are generated per run and how many runs are queued in sequence.
Batch size vs batch count: a practical metaphor
Batch size: Think of this as how many cookies you place on a baking tray. This is how many you can bake at the same time - in parallel. Batch count: Think of this as the number of times to bake the tray. So with batch count = 1, batch size = 1, you would be putting a single cookie on a tray and baking that tray.
Example scenarios:
- Batch count = 2, batch size = 10: bake 2 trays of 10 to reach 20 images quickly, using more VRAM but fewer passes.
- Batch count = 10, batch size = 2: bake 10 passes with 2 images each, slower and lighter on VRAM.
If you're familiar with ComfyUI, you might know about a powerful feature it offers called Batch. In Comflowy, we offer a similar feature, but our Batch functionality can also handle some scenarios that are difficult to achieve with ComfyUI. Whether it's in ComfyUI or Comflowy, to generate images in succession, you just need to set the Batch Size in the Empty Latent Image node to continue generating images (as shown below). However, not all workflows will utilize the Empty Latent Image node, such as those that incorporate ControlNet or high-definition restoration. This is where the Batch feature comes into play. Aside from generating images in succession, the Batch feature grants more formidable capabilities. However, the efficiency is significantly low if you have to upload an image, click Run, upload another, and run it again. To solve this problem, we introduced the Custom Batch feature. Once there, you can select the parameters you want to configure in bulk from the filter box at the top. You can then upload other photos here. After adding one, click New Item again to add the second one. If you need to upload three or more pictures, just click New Item more times. Besides uploading images, you might also need to test various parameters. Or, you might add multiple CLIP nodes and KSampler nodes in the workflow for testing. Finally, click the Start New Run button.

Introduction to Deep Learning - Module 3 - Video 51: Choosing Batch Size
Таблица: ключевые параметры и их эффекты
| Параметр | Описание | Типично применимо |
|---|---|---|
| width, height | размеры изображения, соответствующие источнику | vid2vid, ControlNet, изображение/видео |
| batch_size | количество изображений в одной паре обработки | генерация серий, ускорение через параллелизм |
| batch_count | число проходов по пачке | управляет общим количеством изображений |
| seed | начальное значение для рандомности | важен для детерминированности |
| tile | повторение тайлов в VAE Decode | тильная обработка больших изображений |
| fp16 | использование половинной точности | совместимо с RTX, экономия VRAM |
- Drag the downloaded .json file onto the ComfyUI canvas.
- Replace [PRODUCT] and [STYLE] with your specifics.
- Click “Queue Prompt” - your batch generates automatically.
- Restart ComfyUI to apply changes when needed.