Nodes/ComfyUI-LZNodes/LZ XY Sampler
ComfyUI Node

LZ XY Sampler

The flexible sweep sampler that can live off raw text

By liz-ils·Created 7 months ago·Updated 12 days ago· 1
LZ XY Sampler
  • lz_pipe
  • model
  • clip
  • vae
  • positive
  • negative
  • latent_image
  • images
  • lz_pipe
  • width
  • height
  • x_labels
  • y_labels
seed0
steps20
cfg8.0
sampler_nameeuler
schedulernormal
denoise1.00
x_typenone
x_values
y_typenone
y_values
x_type_str
y_type_str
x_replace_key
y_replace_key
replace_escapetrue
x_labels
y_labels
positive_text
negative_text

Of the pack's two XY samplers, this is the modular one - and the one I'd tell a beginner to use. LZ XY Sampler can consume a pipe that LZXYPlot already configured, or take its axis fields directly; it accepts models and conditioning as either direct inputs or from the pipe; and unlike LZXYPlotSampler, it auto-encodes raw positive_text/negative_text if no conditioning is wired in. That last bit is the difference that saves you a CLIPTextEncode and an hour of head-scratching.

The flow that makes it shine: LZSimpleCheckpointLoaderLZPipePackLZXYPlot (declare the sweep) → LZXYSampler (run it) → LZXYGridOutput (grid it). Config stays separate from sampling, so you can re-grid one batch, tweak the plot, and re-run without rebuilding the sampler.

The inputs

The sampler settings are required: seed, steps, cfg, sampler_name (stock list, default euler), scheduler (default normal), denoise. Everything else is optional, and the precedence logic is forgiving:

  • x_type/y_type with the usual seven options, or a x_type_str/y_type_str string that overrides the dropdown (useful when driving the axis type from another node).
  • x_values/y_values, multiline, one per line.
  • x_replace_key/y_replace_key and replace_escape for the prompt axes.
  • model, clip, vae, positive, negative, positive_text, negative_text, latent_image, and lz_pipe - direct inputs beat the pipe, the pipe fills in what's missing, and text gets encoded if conditioning is absent (as long as a clip is available).
  • x_labels/y_labels - optional overrides for the labels the node emits.

Outputs

images (the batch, row-major), an updated lz_pipe (carrying the last model/conditioning, the settings, seed, and labels), width, height, and x_labels/y_labels. Same seed-stepping scheme as LZXYPlotSampler - seed + (y_index × x_count + x_index) - so reruns are reproducible.

The differences that matter

Compared to LZXYPlotSampler: you can feed this node bare text and a model and it just works, whereas the all-in-one requires pre-encoded conditioning. This one also re-packs the pipe with sampler_name, scheduler, seed, steps, cfg after the run, so the values that actually produced the grid ride along for logging via LZSaveImageAndLog. That's a genuinely nice provenance touch - your log shows exactly what the sweep ran with.

The usual gotchas apply: one value per line, at least one axis needs values or it errors, and with replace_escape on, underscores become spaces when matching placeholders. The checkpoint axis hot-swaps and garbage-collects models between cells, so a checkpoint sweep can be slow - that's inherent to the job, not a bug.

Installing it

Part of the ComfyUI-LZNodes pack:

cd ComfyUI/custom_nodes
git clone https://github.com/liz-ils/ComfyUI-LZNodes

Restart ComfyUI, or ComfyUI Manager → search "ComfyUI-LZNodes". No extra dependencies, no model downloads.

One final thought, from the KB's sampler panel: a sweep is only as good as the range you test, and sampler families behave very differently across architectures. If you're on a flow-matching model, sweeping the Karras/exponential corner of the space will mostly produce noise - pick a sane neighborhood for your checkpoint's family before you spend GPU cycles mapping it.

CategoryMyCustomNodes/XY

Inputs (26)

NameTypeDefaultDescription
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.00–100
sampler_nameCOMBOeuler44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38
schedulerCOMBOnormal9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
denoiseFLOAT1.000–1
lz_pipeoptLZ_PIPE
x_typeoptCOMBOnone8 options: none, checkpoint, diffusion_model, lora, sampler, scheduler, +2
x_valuesoptSTRING
y_typeoptCOMBOnone8 options: none, checkpoint, diffusion_model, lora, sampler, scheduler, +2
y_valuesoptSTRING
x_type_stroptSTRING
y_type_stroptSTRING
x_replace_keyoptSTRING
y_replace_keyoptSTRING
replace_escapeoptBOOLEANtrue
x_labelsoptSTRING
y_labelsoptSTRING
modeloptMODEL
clipoptCLIP
vaeoptVAE
positiveoptCONDITIONING
negativeoptCONDITIONING
positive_textoptSTRING
negative_textoptSTRING
latent_imageoptLATENT

Outputs (6)

NameTypeDescription
imagesIMAGE
lz_pipeLZ_PIPE
widthINT
heightINT
x_labelsSTRING
y_labelsSTRING