Nodes/CRT-Nodes/KSampler Batch (CRT)
ComfyUI Node

KSampler Batch (CRT)

Batch sampling that stops re-encoding your prompts every image

By PGCRT·Created 2 years ago·Updated 2 days ago· 132
KSampler Batch (CRT)
  • model
  • vae
  • positive
  • negative
  • latent_image
  • image
  • images
  • comparison_grid
  • latents
seed0
increment_seedtrue
steps8
cfg1.0
sampler_name
scheduler
denoise1.00
modeBatch (Parallel)
image_megapixels1.00
edit_model_flux2kleinfalse
reference_modeper_item
enable_vae_decodetrue
create_comparison_gridtrue
save_imagestrue
save_folder_path.\ComfyUI\output
save_subfolder_nameKSAMPLER_BATCH
save_filename_prefixoutput

This is the node that made CRT-Nodes worth installing. KSampler Batch (CRT) is the pack's flagship sampler, and it exists to solve the dumbest bottleneck in local batch rendering: when you run N variations, a normal KSampler reloads and re-encodes everything for every single image. This node encodes your conditioning once, then renders the whole batch in a single pass - the author's own numbers say more than 2x inference throughput, and the community post showing it ("Render Z Image faster with batch compute") was one of the pack's big moments.

It's built for the Z-Image Turbo / Flux-style distilled models that dominate 2026 batch work (see the KB's photorealism notes - Z-Image Turbo is the local batch default), but it'll sample any model you give it.

How it works

You feed it model, vae, and positive (plus optional negative), and a batch of work to do. The batch can come from two places: connect an image batch (each image gets VAE-encoded and becomes its own starting latent, or its own reference latent) or a latent_image batch, or let it auto-generate an empty latent from the VAE's channel info. Then it samples every item.

The two modes matter:

  • Batch (Parallel) - all items sampled in one batched pass. Fastest, and the whole point of the node.
  • Sequential - items one after another. Slower, but gentler on VRAM and easier to reason about.

increment_seed is the default and it's great: with it on, item 1 gets your seed, item 2 gets seed+1, and so on, so every variation is reproducible but distinct. Turn it off and every item shares the seed - which is the recipe for N identical images, so be deliberate about it.

Other inputs worth knowing: image_megapixels resizes incoming images to a target resolution before encoding (quantized to VAE boundaries - LTX video VAEs get handled specially so a batch isn't mistaken for video frames). enable_vae_decode toggles whether latents come back as images. create_comparison_grid builds a side-by-side grid of the whole batch, which is the fastest way to eyeball a variation sweep.

There's a neat special mode too: edit_model_flux2klein. For Flux Klein edit/fill models, it sets up ReferenceLatent-style conditioning - each image (or just image[0] in "shared" mode) becomes the reference latent and sampling starts from an empty latent, which is how you do batch image-editing on Klein. That one forces denoise=1.

Outputs and saving

Three outputs: images (the rendered batch), comparison_grid, and latents. It can also save to disk itself - save_images, plus save_folder_path / save_subfolder_name / save_filename_prefix control where (.\ComfyUI\output + subfolder by default) and it embeds the prompt and workflow as PNG metadata, which is a genuinely nice touch for later.

Install

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/PGCRT/CRT-Nodes.git
pip install -r requirements.txt

or ComfyUI Manager → search "CRT-Nodes", restart.

The traps

Two things bite people. First, the default save path is a Windows-style .\ComfyUI\output - on Linux or a different install, point save_folder_path at your real output folder or the "saved" messages will go somewhere you don't expect (it does create the folder, so it won't fail silently, it'll just be in the wrong place). Second, if you connect both image and latent_image, image wins - that's by design but easy to forget mid-debug. And if increment_seed is off, re-running with a changed seed but same images is how you accidentally burn a batch producing duplicates.

CategoryCRT/Sampling

Inputs (23)

NameTypeDefaultDescription
modelMODEL
vaeVAE
positiveCONDITIONING
seedINT00–18446744073709550000
increment_seedBOOLEANtrueIf enabled, each batch item gets seed+1, seed+2, etc. If disabled, all items use the same seed.
stepsINT81–10000
cfgFLOAT1.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
denoiseFLOAT1.000–1
modeCOMBOBatch (Parallel)2 options: Batch (Parallel), Sequential
image_megapixelsFLOAT1.000.1–16Target resolution in megapixels. Images are resized (lanczos) preserving aspect ratio and quantized to VAE boundaries before encoding.
edit_model_flux2kleinBOOLEANfalseEnable ReferenceLatent-style conditioning for edit/fill models (flux2klein). Forces denoise=1 and samples from an empty latent. Requires image input.
reference_modeCOMBOper_itemper_item: each image in the batch is used as its own reference latent. shared: image[0] is used as the reference for every batch item.
enable_vae_decodeBOOLEANtrueDecode latents to images using the VAE.
create_comparison_gridBOOLEANtrueCreate a horizontal side-by-side comparison grid of all batch outputs.
save_imagesBOOLEANtrueSave output images to disk.
save_folder_pathSTRING.\ComfyUI\outputRoot folder where outputs will be saved.
save_subfolder_nameSTRINGKSAMPLER_BATCHSubfolder inside the root folder for organizing outputs.
save_filename_prefixSTRINGoutputPrefix for output filenames. Seed is appended automatically.
negativeoptCONDITIONING
latent_imageoptLATENTStarting latent. If image is also connected, image takes priority. If neither input is connected, a dummy empty latent is auto-generated using VAE channel info.
imageoptIMAGEInput image batch. Resized to image_megapixels before encoding. In normal mode: VAE-encoded as the starting latent. In edit_model_flux2klein mode: used as reference latent; sampling starts from an empty latent.

Outputs (3)

NameTypeDescription
imagesIMAGE
comparison_gridIMAGE
latentsLATENT