ComfyUI Node

Model Matrix Lab

A/B test checkpoints without rebuilding the graph twenty times

By btitkin·Created 3 months ago·Updated 2 months ago· 34
Model Matrix Lab
  • latent_image
  • clip
  • vae
  • grid_image
positive_text
negative_text
seed0
steps20
cfg8.0
denoise1.00
sampler_name
scheduler
model_01None
model_02None
model_03None
model_04None
model_05None
model_06None
model_07None
model_08None
model_09None
model_10None
model_11None
model_12None
model_13None
model_14None
model_15None
model_16None
model_17None
model_18None
model_19None
model_20None
diffusion_weight_dtypedefault
grid_columns3
cell_scale1.00
font_size22
padding10
backgroundwhite
show_grid_linestrue
show_cell_labelstrue
show_run_headertrue
continue_on_errortrue

Choosing between checkpoints is usually: swap the model, rerun, squint, repeat. ModelMatrixLab inverts that. You load up to 20 checkpoints or standalone diffusion models into one node, it keeps the prompt, seed, steps, CFG, sampler and scheduler locked across all of them, and returns one labeled grid so you can actually see which model earns the download. It's the sibling of the pack's KSamplerMatrixLab node, from the same ComfyUI-KSampler-Matrix-Lab repo, and it exists for the same reason the original does: comparisons are only trustworthy when nothing but the thing you're testing changes.

How it works

The model slots are populated from your local ComfyUI folders - every file in checkpoints and diffusion_models shows up, prefixed checkpoint | or diffusion | so you always know which kind you're picking. For each selected model the node loads it (CheckpointLoaderSimple for checkpoints, UNETLoader for standalone diffusion models), uses the model's embedded CLIP and VAE when it has them, encodes the same prompt through that CLIP, runs one shared sampler/scheduler, decodes, and then unloads the model - nulling the references, calling gc.collect() and soft_empty_cache() - before loading the next. That unload-between-models is the clever bit: it's what lets you walk a grid of big checkpoints without the VRAM piling up as you go.

A word on fairness: seed is a single shared value for every cell. That's the point. Same noise, same settings, different model - the grid you get back is a controlled experiment, not a vibe.

The inputs that matter

latent_image is the shared starting latent. positive_text and negative_text are plain multiline prompt boxes - the tooltip is blunt: the same prompt is encoded for every selected model. Then the shared generation settings: seed, steps, cfg, denoise, plus a single sampler_name and scheduler that apply to all models. You're comparing models, not re-rolling samplers.

The model_0120 dropdowns are the grid itself; None skips a slot. diffusion_weight_dtype (default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2) only affects standalone diffusion models - if you're comparing raw UNETs and VRAM is tight, fp8 is your friend. grid_columns sets how many cells per row, and the usual layout knobs (cell_scale, font_size, padding, background, show_grid_lines, show_cell_labels, show_run_header, continue_on_error) are the same ones the sampler node uses. Output is a single grid_image IMAGE for Preview or Save.

The one thing that bites people

Checkpoints carry their own text encoder and VAE. Standalone diffusion models don't - a UNET is just the denoiser. So if you're comparing diffusion models, you must feed the optional clip and vae inputs, or the node raises "No compatible CLIP is available" (and separately "No compatible VAE"). The tooltips spell this out: the CLIP/VAE inputs are required for standalone diffusion models or checkpoints without an embedded one. This is the #1 reason a grid comes back full of red error cells, and it's not a bug - the node genuinely has nothing to encode the prompt with.

Installing it

Same pack, same one-liner:

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

Or grab it through ComfyUI Manager (search "KSampler Matrix Lab"), then restart. There's no requirements.txt and nothing extra to download - it leans entirely on ComfyUI's built-in model loaders, so install is about as painless as a custom node gets. The node appears under the ComfyUI-KSampler-Matrix-Lab category.

Honest caveats

If your model_01 slot only shows "None", it just means your checkpoints folder is empty or the dropdown didn't refresh - the list is generated from your local install at node-creation time. And be realistic about runtime: every cell is a full generation, and this one also reloads a model per cell, so a 10-checkpoint grid on SDXL is a "go make tea" run, not a "quick test." It's the price of a genuinely controlled comparison. If you only need to eyeball two checkpoints occasionally, a manual swap is fine; this earns its keep when you're shortlisting models and want the whole lineup on one image.

CategoryComfyUI-KSampler-Matrix-Lab

Inputs (41)

NameTypeDefaultDescription
latent_imageLATENT
positive_textSTRINGThe same positive prompt is encoded for every selected model.
negative_textSTRINGThe same negative prompt is encoded for every selected model.
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
denoiseFLOAT1.000–1
sampler_nameCOMBOThe sampler used for every selected model.
schedulerCOMBOThe scheduler used for every selected model.
model_01COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_02COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_03COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_04COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_05COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_06COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_07COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_08COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_09COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_10COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_11COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_12COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_13COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_14COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_15COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_16COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_17COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_18COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_19COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
model_20COMBONoneSelect a checkpoint or standalone diffusion model, or None to ignore this slot.
diffusion_weight_dtypeCOMBOdefaultWeight dtype used only for standalone diffusion models.
grid_columnsINT31–20
cell_scaleFLOAT1.000.05–4
font_sizeINT228–96
paddingINT100–96
backgroundCOMBOwhite3 options: white, gray, black
show_grid_linesBOOLEANtrue
show_cell_labelsBOOLEANtrueShow the model source and filename above every grid cell.
show_run_headerBOOLEANtrueShow sampler, scheduler, steps, CFG, and denoise above the grid.
continue_on_errorBOOLEANtrue
clipoptCLIPRequired for standalone diffusion models or checkpoints without an embedded CLIP.
vaeoptVAERequired for standalone diffusion models or checkpoints without an embedded VAE.

Outputs (1)

NameTypeDescription
grid_imageIMAGE