Nodes/ComfyUI-LZNodes/LZ KSampler & Decode
ComfyUI Node

LZ KSampler & Decode

KSampler and VAEDecode merged into one node that reads your pipe

By liz-ils·Created 7 months ago·Updated 12 days ago· 1
LZ KSampler & Decode
  • lz_pipe
  • model
  • clip
  • vae
  • positive
  • negative
  • latent_image
  • IMAGE
  • lz_pipe
  • positive_text
  • negative_text
  • width
  • height
seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00
model_presetAuto/SDXL
positive_text
negative_text

In a vanilla graph, sampling is three nodes: KSampler, VAEDecode, and a latent source. LZ KSampler & Decode collapses that chain into one node that also reads an LZ pipe, so the whole "load → sample → decode" pipeline can be two nodes end to end. If you're on the LZNodes pipe system, this is the payoff node - the one that makes the pipe feel worth it.

How it works

Two big things happen inside. First, it resolves its inputs with a clear precedence: anything wired directly to the optional sockets (model, clip, vae, positive, negative, latent_image, the text strings) wins; otherwise it pulls the same fields out of the connected lz_pipe. So you can go pure-pipe (one socket in) or mix-and-match (pipe for the model, direct text override for the prompt).

Second, the text-to-conditioning fallback: if no positive/negative CONDITIONING arrives but you've supplied positive_text/negative_text, the node encodes the text itself using the CLIP from the pipe. That means you can feed it raw prompt strings from anywhere - a prompt-builder node, a file, a log reader - and it'll turn them into conditioning on the fly. If neither conditioning nor text is available, you get a clear error naming exactly which of model/positive/negative/latent/vae is missing.

It then runs the stock KSampler (the required inputs are the familiar seed, steps, cfg, sampler_name, scheduler, denoise) and VAEDecode internally. Outputs:

  • IMAGE - the decoded picture.
  • lz_pipe - the pipe back out, updated with the sampled latent, the exact seed/steps/cfg/sampler/scheduler that ran, and the width/height.
  • positive_text / negative_text - the strings that were actually used (handy for logging).
  • width / height - computed from the latent if nothing provided them (×8 the latent dims).

There's also a model_preset dropdown ("Auto/SDXL" / "Anima") - it's a hint selector; the real correctness question is whether the pipe's contents match what you're sampling.

The two traps

CFG is 8 by default - the pack's own default. That's an SDXL-ish setting that will oversaturate and burn on any distilled model (Flux, Turbo, Anima turbo-LoRA workflows all want CFG ~1). It's not a bug; it's a default written for a generic SDXL flow. Change it per model.

The pipe is a snapshot, not a magic wand. Whatever the pipe holds is what samples. If you connect a pipe from an EZCheckpointLoader but then wire a different model socket in directly, the direct socket wins - which is the feature, but it means the pipe's other fields (ckpt_name, hashes) now describe a model that isn't the one that ran. Keep logging honest by re-packing.

Installing it

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

restart → MyCustomNodes/Sampling. ComfyUI Manager: search ComfyUI-LZNodes. No extra dependencies.

Verdict

For pipe users this is the centerpiece: EZCheckpointLoader → LZKSamplerDecode → LZSaveImageAndLog is the pack's recommended starter flow and it genuinely shrinks a beginner's graph to something legible. For people who don't use pipes, the direct-socket mode still saves you a VAEDecode node. Either way, remember the CFG default.

CategoryMyCustomNodes/Sampling

Inputs (16)

NameTypeDefaultDescription
seedINT00–18446744073709550000
stepsINT201–10000
cfgFLOAT8.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
model_presetCOMBOAuto/SDXLKrea2 (Turbo): recommended 8 steps / CFG 1.0 / euler / simple. If no negative is connected, the positive is zeroed-out as negative (official template behaviour; CFG 1.0 ignores negatives). Krea2 (Raw): recommended 52 steps / CFG 3.5. A real negative is required.
lz_pipeoptLZ_PIPE
modeloptMODEL
clipoptCLIP
vaeoptVAE
positiveoptCONDITIONING
negativeoptCONDITIONING
latent_imageoptLATENT
positive_textoptSTRING
negative_textoptSTRING

Outputs (6)

NameTypeDescription
IMAGEIMAGE
lz_pipeLZ_PIPE
positive_textSTRING
negative_textSTRING
widthINT
heightINT