Image ToolsBeginner

How to Batch Generate Many Image Variations in ComfyUI

Set batch size and the seed control so a single Queue Prompt produces a grid of variations, and queue many prompts at once for unattended runs.

6 minBeginner

When you are exploring ideas, generating one image at a time is slow. ComfyUI can produce several variations per run and queue dozens of runs back to back. This guide covers batch size, the seed control modes, and queuing multiple jobs so the GPU keeps working while you step away.

What you need

  • Any working text-to-image workflow
  • Enough VRAM that a few images fit at once (lower the batch if you hit out-of-memory)

Step 1: Raise the batch size

Find the Empty Latent Image node and increase batch_size from 1 to, say, 4. Each Queue Prompt now renders four images that share the prompt but differ by seed, and they all land in the Save Image node.

ComfyUI - Empty Latent Image
Empty Latent Image
----------------------
width: 1024
height: 1024
batch_size: 4
batch_size is the number of images per single run.
Batch eats VRAM
Each image in a batch is processed together, so a batch of 8 uses far more VRAM than a single image. If you see an out-of-memory error, lower batch_size or generate at a smaller resolution.

Step 2: Set the seed to randomize

In the KSampler, set the control_after_generate field to randomize. After each run ComfyUI rolls a new seed, so the next Queue Prompt gives fresh variations instead of repeating.

Step 3: Queue several runs at once

Hold the queue button or use the extra options to add many jobs to the queue. With seed set to randomize, queuing 10 runs of a batch of 4 yields 40 distinct images. Watch progress in the Queue tab.

ComfyUI console - a queued batch
got prompt
100%|####################| 20/20 [00:09<00:00, 2.10it/s]
Prompt executed in 11.2 seconds
(repeats for each queued run)
$

Step 4: Find your output files

Every image is written to the ComfyUI/output folder with an incrementing filename. The PNGs also embed the full workflow, so you can drag any one back onto the canvas to recover its exact settings.

Result: a folder full of variations from a single session. Pick the strongest composition, drag its PNG back into ComfyUI to load its settings, and refine from there.

Watch related tutorials

Tags
#comfyui#batch#seed#workflow