ComfyUI Node

KSampler Matrix Lab

One node, every sampler × scheduler combo, one labeled grid

By btitkin·Created 3 months ago·Updated 2 months ago· 34
KSampler Matrix Lab
  • model
  • positive
  • negative
  • latent_image
  • vae
  • grid_image
seed0
steps20
cfg8.0
denoise1.00
sampler_01euler
sampler_02None
sampler_03None
sampler_04None
sampler_05None
sampler_06None
sampler_07None
sampler_08None
sampler_09None
scheduler_01simple
scheduler_02None
scheduler_03None
scheduler_04None
scheduler_05None
scheduler_06None
scheduler_07None
scheduler_08None
scheduler_09None
seed_modesame_seed_for_all
cell_scale1.00
font_size22
padding10
header_height72
left_header_width180
backgroundwhite
show_grid_linestrue
show_cell_labelstrue
show_run_headertrue
continue_on_errortrue
max_combinations100

You've done the dumb version of this: duplicate a KSampler four times, set one to euler, one to dpmpp_2m, one to heun, squint at four tabs, and still not remember which was which. KSampler Matrix Lab does that whole ritual in a single node - you pick up to 9 samplers and up to 9 schedulers, and it runs every combination with the same prompt, model, seed and latent, then hands you one labeled grid. Rows are samplers, columns are schedulers. Done.

It's from the small ComfyUI-KSampler-Matrix-Lab pack (btitkin, MIT licensed), which shipped two nodes: this one and its sibling ModelMatrixLab for comparing checkpoints instead. The author launched it on r/StableDiffusion in mid-2026 specifically because manually duplicating KSamplers is a chore nobody should have to do.

Why this beats doing it by hand

The community rule that actually pays off is "lock the seed, change one parameter, compare." That's literally all this node enforces for you. Same seed, same latent, same conditioning - the only thing that changes between cells is the sampler/scheduler pair. That's what makes the differences you see real. And since samplers split into converging ones (euler, dpmpp_2m, heun) that settle into a stable image and ancestral ones (euler_ancestral, dpmpp_sde) that keep injecting noise, a side-by-side is genuinely the fastest way to feel the difference instead of reading about it.

How it works

The mechanism is refreshingly honest. The sampler and scheduler dropdowns are pulled straight from your local ComfyUI via comfy.samplers.KSampler.SAMPLERS and .SCHEDULERS, so the options always match your build - no hardcoded stale list. For each selected pair it calls the exact same common_ksampler a normal KSampler uses, cloning the input latent each time so one cell's run never disturbs the next. It decodes through your VAE and tiles the results together with PIL, labels and all.

Two details worth knowing. It runs sequentially, calling soft_empty_cache() and gc.collect() between cells, so a 30-cell grid doesn't try to hold 30 images in VRAM at once. And if one combo errors out, continue_on_error (on by default) drops a placeholder cell in the grid and keeps going, so one bad sampler doesn't kill the whole run.

The inputs that matter

Wire model, positive, negative, latent_image and vae exactly like you would into a regular KSampler - it's a drop-in replacement, not a new paradigm. Then set seed, steps, cfg, denoise as usual.

The matrix itself is sampler_0109 and scheduler_0109. Each slot is a dropdown with a None option, and None means "skip this slot." The tooltip says it plainly: samplers are rows, schedulers are columns. Two seed modes: same_seed_for_all (the fair comparison) and increment_per_cell if you want to farm a seed range while you're at it. max_combinations defaults to 100 and hard-stops you from accidentally firing a 9×9 = 81-cell run when you only meant 6 - bump it up to 1000 if you really want.

Layout stuff you'll touch maybe once: cell_scale, font_size, padding, background (white/gray/black), show_grid_lines, show_cell_labels (repeats the sampler/scheduler names inside every cell for zoomed inspection), and show_run_header, which stamps model/VAE/CLIP/steps/CFG/denoise across the top. The single grid_image IMAGE output feeds straight into a Preview Image or Save Image node.

Installing it

No dependencies beyond what ComfyUI already ships - no requirements.txt, no model downloads. Either install via ComfyUI Manager (search "KSampler Matrix Lab") or:

cd ComfyUI/custom_nodes
git clone https://github.com/btitkin/ComfyUI-KSampler-Matrix-Lab.git

Restart ComfyUI, then grab the node from the ComfyUI-KSampler-Matrix-Lab category. The repo also includes a ready-made Workflows/KSamplerMatrixLab_Workflow.json - drag it into ComfyUI to see it wired up.

Where people get tripped up

The dropdowns only show samplers your ComfyUI knows, so if a newer sampler is missing from the matrix, update ComfyUI, not the node. And remember the cost model: every cell is a full generation. A 9×9 run is 81 samples at your steps/CFG - plan for it to take a while, and use None slots to keep the grid tight. If you're comparing on a big SDXL or Flux checkpoint, don't expect this to be fast; expect it to be fair. That's the trade it's actually making.

If you need to sweep CFG, prompt variations or arbitrary values rather than just samplers and schedulers, an XY-plot style node is the more general tool - this one deliberately does one job.

CategoryComfyUI-KSampler-Matrix-Lab

Inputs (39)

NameTypeDefaultDescription
modelMODEL
positiveCONDITIONING
negativeCONDITIONING
latent_imageLATENT
vaeVAE
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
denoiseFLOAT1.000–1
sampler_01COMBOeulerSelect a sampler for a matrix row, or None to ignore this slot.
sampler_02COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_03COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_04COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_05COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_06COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_07COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_08COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
sampler_09COMBONoneSelect a sampler for a matrix row, or None to ignore this slot.
scheduler_01COMBOsimpleSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_02COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_03COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_04COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_05COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_06COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_07COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_08COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
scheduler_09COMBONoneSelect a scheduler for a matrix column, or None to ignore this slot.
seed_modeCOMBOsame_seed_for_all2 options: same_seed_for_all, increment_per_cell
cell_scaleFLOAT1.000.05–4
font_sizeINT228–96
paddingINT100–96
header_heightINT7224–256
left_header_widthINT18048–512
backgroundCOMBOwhite3 options: white, gray, black
show_grid_linesBOOLEANtrue
show_cell_labelsBOOLEANtrueRepeat sampler and scheduler labels inside every grid cell for easier zoomed inspection.
show_run_headerBOOLEANtrueAdd a top header with model, VAE, CLIP, steps, CFG, and denoise metadata.
continue_on_errorBOOLEANtrue
max_combinationsINT1001–1000Safety limit for sampler x scheduler combinations.

Outputs (1)

NameTypeDescription
grid_imageIMAGE