comfyui-ksampler-batch

comfyui-ksampler-batch
★ 0

批量采样多样化种子显存优化ComfyUI 自定义节点
在单次 GPU 批处理中用不同 seed 并行生成多张图像,通过复制潜变量并一次前向传递提高显存利用与生成速度。
💡 在有限显存下同时生成多张不同 seed 的图像以提速。
🍴 1 Forks💻 Python🔄 2026-03-10
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/8f9eee5e2cdb
📄 README

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_size times
  • 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.