Nodes/comfyui-ksampler-batch/KSampler Advanced (Batch Seeds)
ComfyUI Node

KSampler Advanced (Batch Seeds)

KSampler Advanced (Batch Seeds)

By adbrasi·Created 6 months ago·Updated 5 months ago· 0
KSampler Advanced (Batch Seeds)
  • model
  • positive
  • negative
  • latent_image
  • LATENT
add_noise
noise_seed0
steps20
cfg8.0
sampler_name
scheduler
start_at_step0
end_at_step10000
return_with_leftover_noise
batch_size2
seed_modeincremental

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 (default 0 / 10000) - the step range to sample, forwarded straight into the sampler call. This is how you express "denoise" here; there's no denoise field 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 to enable, 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=1 collapses this into a slightly overengineered KSampler Advanced - which is exactly how you should sanity-check a workflow before scaling the batch.
Categorysampling/batch

Inputs (15)

NameTypeDefaultDescription
modelMODEL
add_noiseCOMBO2 options: enable, disable
noise_seedINT00–18446744073709550000Base seed. Item i uses seed + i.
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBO44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBO9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
start_at_stepINT00–10000
end_at_stepINT100000–10000
return_with_leftover_noiseCOMBO2 options: disable, enable
batch_sizeINT21–64Number of images to generate in parallel on the GPU
seed_modeCOMBOincrementalincremental: 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)

NameTypeDescription
LATENTLATENT