main
ComfyUI's _calc_cond_batch uses model.memory_required() * 1.5 to decide sub-batch sizes. The default memory_usage_factor=2.0 is overly conservative, causing it to process batch items one-by-one even with 27GB+ free VRAM. We now temporarily reduce memory_usage_factor to 0.01 during sampling, forcing ComfyUI to process the entire batch in a single forward pass. The original value is restored after sampling. This is the key fix for TRUE parallel batch generation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ComfyUI KSampler Batch Seeds
Custom nodes for ComfyUI that generate multiple images in a single GPU batch with different seeds.
Nodes
KSampler (Batch Seeds)
Drop-in replacement for KSampler that adds a batch_size parameter. Each image in the batch uses seed + i, so every result is independently reproducible.
KSampler Advanced (Batch Seeds)
Same as above but with start/end step control, noise toggle, and leftover noise options — matching KSampler Advanced's interface.
How It Works
Instead of generating one image at a time, these nodes:
- Replicate the input latent
batch_sizetimes - Generate noise with truly different seeds per item (
seed+0,seed+1,seed+2, …) - Pass the entire batch through the model in a single forward pass
This maximizes GPU utilization — if your model uses 2GB and you have 8GB of VRAM, you can generate 2-3 images simultaneously.
Installation
Clone into your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/adolfocesar/comfyui-ksampler-batch.git
Reproducing a Specific Image
If you generated a batch with seed=42 and batch_size=4, and liked image #3 (index 2):
- Use the standard KSampler with
seed=44(42 + 2) to reproduce that exact image.
Languages
Python
100%