KSampler Advanced (Batch Seeds)
KSampler Advanced (Batch Seeds)
- model
- positive
- negative
- latent_image
- LATENT
The plain KSampler is fine until you need to refine - a second pass over an existing image, a partial denoise, an inpainting pass that shouldn't re-add full noise. That's what the Advanced variant of ComfyUI's sampler is for, and this node is exactly that, with the batch-seeds machinery bolted on. If you've read the KSampler (Batch Seeds) article, you know the pitch: one latent replicated batch_size times, a different seed per item, everything sampled in a single forward pass. KSampler Batch Advanced (the display name is "KSampler Advanced (Batch Seeds)") just adds the controls you need to not blow up your first pass when you run a second one.
This is the node you reach for when you're building a two-pass workflow - hires fix style, img2img refinement, or a partial-denoise pass - and you want to farm several seed variations per run instead of one at a time. It's also the one with the 11 Google impressions, for what that's worth: people searching for it found it.
How it works
Same engine as its sibling, from the same nodes.py: replicate the latent, build a noise tensor with a per-item seed (generated on CPU, cast to the latent's dtype), then call ComfyUI's sampler with disable_noise=True since the noise is pre-baked. It also temporarily drops the model's memory_usage_factor to ~0 so ComfyUI's memory planner doesn't silently un-batch your items - that override is the difference between a genuine single forward pass and a sequential loop in a trench coat.
The Advanced differences are real and worth knowing:
start_at_step/end_at_step(default0/10000) - the step range to sample, forwarded straight into the sampler call. This is how you express "denoise" here; there's nodenoisefield on this node. Want a 30% renoise of an existing latent? Start at step ~14 of 20 and let it run to the end.add_noise(enable/disable) - when disabled, the node feeds zeros as noise instead of generated seeds. That's your "don't corrupt what's already there" switch for img2img and refinement passes.return_with_leftover_noise(disable/enable) - leave residual noise in the output latent so another sampler downstream can keep refining. Disabled (default) means the node forces full denoise and hands you a "finished" latent.
The inputs you'll actually set beyond those: noise_seed (base seed, item i gets seed+i), batch_size (default 2, max 64), and seed_mode (incremental / random / fixed - the author's tooltip is worth reading: incremental makes each image individually reproducible, random derives fresh-but-deterministic seeds per item, fixed gives you N identical copies for testing the pipeline).
Output is a single LATENT with batch_size images stacked in the batch dimension - straight into VAEDecode, and Save Image writes each as its own file.
Reproducing a specific image
Ran noise_seed=42, batch_size=4 and want image #3 (index 2) again? A plain KSampler Advanced with noise_seed=44 reproduces it exactly. Remember the PNG metadata only stores the base seed, so the math is on you: base + index. That's the author's own tip from the README, and it's the classic place to get confused later.
Install
The pack is dependency-free - no requirements.txt, no model downloads, pure Python over ComfyUI internals.
- ComfyUI Manager: search "comfyui-ksampler-batch" (or "Batch Seeds").
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/adbrasi/comfyui-ksampler-batch, then restart ComfyUI.
One wrinkle: the README's own clone command references an older GitHub handle (adolfocesar/…). The repo is at adbrasi/comfyui-ksampler-batch - use that URL.
Common issues
- OOM at bigger batches. VRAM scales with
batch_size, and because the node forces a true single pass, an oversized batch OOMs instead of getting chunked into smaller ones. Start at 2–3; reach for a quantized (GGUF/fp8) model if you need more headroom. - Unexpected full renoise on a refinement pass. If you plugged an existing latent in and it came out a different image entirely, check
add_noise- it defaults toenable, and you probably want it off for img2img. That's the number-one "why did my second pass ignore my input" trap with Advanced-style samplers. - Chatty console. Both nodes print config, VRAM, and a per-item seed line every run. Fine for debugging, mildly annoying at scale.
batch_size=1collapses this into a slightly overengineered KSampler Advanced - which is exactly how you should sanity-check a workflow before scaling the batch.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| add_noise | COMBO | 2 options: enable, disable | |
| noise_seed | INT | 00–18446744073709550000 | Base seed. Item i uses seed + i. |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| latent_image | LATENT | — | |
| start_at_step | INT | 00–10000 | — |
| end_at_step | INT | 100000–10000 | — |
| return_with_leftover_noise | COMBO | 2 options: disable, enable | |
| batch_size | INT | 21–64 | Number of images to generate in parallel on the GPU |
| seed_mode | COMBO | incremental | incremental: seed+0, seed+1, seed+2… (each image reproducible individually). random: each item gets a unique random seed derived from the base seed. fixed: all items use the same seed (identical images, useful for testing). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |