LZ XY Sampler
The flexible sweep sampler that can live off raw text
- lz_pipe
- model
- clip
- vae
- positive
- negative
- latent_image
- images
- lz_pipe
- width
- height
- x_labels
- y_labels
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: LZSimpleCheckpointLoader → LZPipePack → LZXYPlot (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_typewith the usual seven options, or ax_type_str/y_type_strstring 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_keyandreplace_escapefor the prompt axes.model,clip,vae,positive,negative,positive_text,negative_text,latent_image, andlz_pipe- direct inputs beat the pipe, the pipe fills in what's missing, and text gets encoded if conditioning is absent (as long as aclipis 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.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 201–10000 | — |
| cfg | FLOAT | 8.00–100 | — |
| sampler_name | COMBO | euler | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 |
| scheduler | COMBO | normal | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
| denoise | FLOAT | 1.000–1 | — |
| lz_pipeopt | LZ_PIPE | — | |
| x_typeopt | COMBO | none | 8 options: none, checkpoint, diffusion_model, lora, sampler, scheduler, +2 |
| x_valuesopt | STRING | — | |
| y_typeopt | COMBO | none | 8 options: none, checkpoint, diffusion_model, lora, sampler, scheduler, +2 |
| y_valuesopt | STRING | — | |
| x_type_stropt | STRING | — | |
| y_type_stropt | STRING | — | |
| x_replace_keyopt | STRING | — | |
| y_replace_keyopt | STRING | — | |
| replace_escapeopt | BOOLEAN | true | — |
| x_labelsopt | STRING | — | |
| y_labelsopt | STRING | — | |
| modelopt | MODEL | — | |
| clipopt | CLIP | — | |
| vaeopt | VAE | — | |
| positiveopt | CONDITIONING | — | |
| negativeopt | CONDITIONING | — | |
| positive_textopt | STRING | — | |
| negative_textopt | STRING | — | |
| latent_imageopt | LATENT | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| lz_pipe | LZ_PIPE | — |
| width | INT | — |
| height | INT | — |
| x_labels | STRING | — |
| y_labels | STRING | — |