liveBook · Manning

Batch size

As explained in Local Image Generation

Batch size is the number of images processed simultaneously in one generation iteration.

Batch size is the number of images processed at the same time during one generation iteration. Think of it as choosing how many coffee cups your GPU carries in one trip: larger batches can move more images together, but they demand more VRAM. section 1.2.2

Use batch size alongside batch count, but do not confuse their jobs:

  • Batch size processes multiple images in parallel on the GPU. section 1.2.2
  • Batch count creates images through multiple sequential sampling rounds. section 1.2.2
  • Increasing batch size definitely increases VRAM use, while the time advantage over sequential generation may be small on a particular system. section 1.2.2
  • In ComfyUI, set batch_size in the Empty Latent Image node, alongside image width and height, before connecting it to KSampler. section 8.2.4
  • For fine-tuning, Local Batch Size controls how many training images enter the model together; lower-VRAM systems may need 1 or 2. section 15.3.5

Generate 30 images without wrestling your VRAM

Set batch size to 5 and batch count to 6. If that is too demanding, try batch size 3 with batch count 10, or batch size 1 with batch count 30. The combinations still total 30 images, while spreading the work differently. section 1.2.2

Figure 8.12 The Empty Latent Images is where we specify image dimensions and batch size.

Inspect where ComfyUI exposes image dimensions and batch_size in the Empty Latent Image node. section 8.2.4

How Local Image Generation covers it

How deep it goes
Explains parallelism, sequential comparison, VRAM effects, and practical settings without detailing sampling internals.
Examples
Uses 30-image generation combinations, ComfyUI node configuration, and VRAM-based fine-tuning settings.
What it assumes
Assumes familiarity with image generation or training settings while distinguishing batch count from batch size.
What you can do after
Operate/configure batch size for image generation, ComfyUI workflows, and fine-tuning within available VRAM.
How it connects
Connects batch size with batch count, VRAM, Empty Latent Image, KSampler, training, and epochs.

Also explained in

Compare how 14 books explain batch size →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Local Image Generation. The section links point to the parts of the book it draws on.