ComfyUI Node

🎲 LDM Sampler

There's no CFG here — meet the sampler that denoises the original LDM

By Winlensky·Created 22 days ago·Updated 16 days ago· 1
🎲 LDM Sampler
  • model
  • positive
  • latent_image
  • negative
  • LATENT
seed42
steps50
enable_cfgfalse
cfg_scale7.5
sampler_name
scheduler
eta0.00
denoise1.00

Somewhere in the middle of your LDM workflow sits the node that actually does the generating. Loader gets the model, the BERT encoder turns your words into conditioning, and then this node runs the denoising loop that turns noise into a meaningful latent. If you're used to ComfyUI's KSampler, this is that - except it's a standalone re-implementation written for one specific 2021 architecture, and it's where you'll most feel that this model predates everything you know.

The giveaway is what's not here: no cfg input, no negative conditioning socket. The original LDM F8 Large was trained without classifier-free guidance, so there's no CFG scale to crank and no negative prompt to write. The single conditioning input is helpfully still labelled positive, but it's the only conditioning. Don't go looking for a second text-encode node; there isn't one.

How it works

The checkpoint stores its own noise schedule (the betas / alphas_cumprod tensors), and this node builds a sigma schedule from it, then marches the latent down that schedule over steps iterations. The samplers come in two families, and it's worth knowing which you're on because they behave differently:

  • Alpha-space - ddim, ddpm, plms. These are the samplers native to the LDM paper. ddim is deterministic (or stochastic, via eta); ddpm is the ancestral, always-random walk; plms is the multistep speed-up.
  • Sigma-space - euler, euler_ancestral, heun, dpmpp_2m. The k-diffusion family, ported over so you can use the samplers you already know.

Schedulers have a compatibility rule you'll want in your head: the alpha-space samplers only accept ddim_uniform, linear, and beta. The sigma-space samplers accept all six (karras, exponential, and cosine included). Pick a forbidden combo and the node doesn't error - it silently swaps to a compatible schedule and prints a warning to the console. If output ever looks odd, check that console.

The inputs you actually set

  • steps - 50 by default. The k-diffusion samplers converge well at 20–30; this old model likes a bit more, so if you're using ddim or plms, 50 is a fine floor and 100 won't hurt.
  • sampler_name and scheduler - your comfort pick. euler + karras, or the paper-authentic ddim + ddim_uniform are the two sane starting points. For pure history, run ddim with eta at 0.
  • seed - roll it until you like the image; ddim/euler/dpmpp_2m are deterministic for a fixed seed, ancestral ones aren't.
  • eta - stochasticity for ddim only (0 = deterministic, 1 ≈ DDPM). Ignored by everyone else; ddpm is always stochastic regardless.
  • denoise - 1.0 means full generation from noise (txt2img). Dial it below 1.0 to partially denoise an existing latent, which is how img2img works here.

The latent_image input takes either an empty latent from 🌫️ LDM Empty Latent (txt2img) or an encoded image from 📥 LDM VAE Encode (img2img).

Wire it up and get it out

The node takes model (MODEL from Load LDM Checkpoint), positive (CONDITIONING from LDM BERT Text Encode), and latent_image. Its single LATENT output feeds 🖼️ LDM VAE Decode, which turns it into pixels you can save. The chain is short and that's the whole point: Loader → Text Encode → Empty Latent → Sampler → VAE Decode.

Common issues

  • "Where's the negative prompt?" - doesn't exist here, by training design. Your best "negative" is writing the positive more carefully.
  • Inconsistent results across sampler names - expected; each family walks the schedule differently. Same seed across families gives different images.
  • Loose prompt adherence - if the image only vaguely matches your text, that's the model, not the sampler. No CFG means no sharpening of prompt-vs-image contrast; it's the defining limitation of this whole pack.
  • Weird results with karras + ddim - that combo is incompatible; the node fell back to ddim_uniform. Check the console for the warning.

One tip: keep the canvas at the model's native 256×256. A small, honest image at native resolution beats a smeared one at 1024 - and if you must go bigger, do it after generation with an upscaler, not by asking this model to stretch.

CategoryLDM

Inputs (12)

NameTypeDefaultDescription
modelLDM_MODELMODEL output from Load LDM Checkpoint.
positiveLDM_CONDITIONINGCONDITIONING from BERT Text Encode node.
latent_imageLDM_LATENTStarting latent: empty (txt2img) or encoded image (img2img).
seedINT420–18446744073709550000Random seed for initial noise.
stepsINT501–1000Number of denoising steps.
enable_cfgBOOLEANfalseEnable Classifier-Free Guidance. When True, the model uses both positive and negative conditioning to steer generation.
cfg_scaleFLOAT7.51–30CFG strength. 1.0 = no effect. Higher values follow the prompt more strictly but may cause oversaturation. Only used when enable_cfg=True.
sampler_nameCOMBOddim/ddpm/plms are alpha-space. euler/heun/dpmpp_2m are sigma-space.
schedulerCOMBOSigma schedule.
etaFLOAT0.000–1Stochasticity for DDIM only. 0=deterministic, 1≈DDPM.
denoiseFLOAT1.000–11.0 = full generation; < 1.0 = partial (img2img).
negativeoptLDM_CONDITIONINGNegative conditioning from a second BERT Text Encode node. If not connected and CFG is enabled, zero (empty) conditioning is used.

Outputs (1)

NameTypeDescription
LATENTLDM_LATENT