Nodes/Latent Tools/LTKSampler
ComfyUI Node

LTKSampler

A KSampler That Lets You Feed It the Noise

By Machines-of-Disruption·Created about a year ago·Updated 8 months ago· 27
LTKSampler
  • model
  • positive
  • negative
  • latent_image
  • latent_noise
  • LATENT
extra_seed0
steps20
cfg8.0
sampler_name
scheduler
denoise1.00

A normal KSampler generates its starting noise internally and keeps the seed private. LTKSampler is that same sampler with one extra required input: latent_noise, a LATENT you supply. It's the receiver for everything else this pack builds - you hand it the noise you made with LTGaussianLatent, LTBlendLatent, LTLatentLoad or LTLatentOp, and it runs a completely ordinary denoising pass on top of it.

The name is a small lie, in a good way: it's not a new sampling algorithm. It's a fork of ComfyUI's own KSampler (the source even carries the GPL header from ComfyUI's nodes.py) with the noise-generation step swapped out for "take noise from this input instead."

How it works

Instead of calling ComfyUI's internal noise generator, it reads latent_noise["samples"], verifies the channel count and spatial shape match your latent_image, then hands that tensor to the same comfy.sample.sample routine the stock KSampler uses. Two niceties in there:

  • If your latent holds a batch but you supply a single noise frame, it broadcasts the noise across the whole batch.
  • It respects the batch_index of the latent, so in a video batch each frame picks its own slice of your noise.

The inputs that matter

Everything a KSampler has: model, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise. Plus the two differences:

  • latent_noise - the LATENT that replaces the sampler's internal noise. This is where LTGaussianLatent plugs in.
  • extra_seed - the sampler seed. It's called "extra" because the main noise seed lives in whatever generated your latent_noise.

A typical graph: LTGaussianLatent → latent_noise, EmptyLatentImage → latent_image, and the sampler's LATENT output into VAE Decode.

Where people get burned

Shape mismatch. latent_noise and latent_image must agree on channels and spatial size or it throws. If you generated noise at width 1024 but your EmptyLatentImage is 768, it errors immediately - set them to the same numbers.

The subtler gotcha is mental: once you're feeding noise in, changing the sampler's seed stops changing the starting pattern. The pattern is fully owned by the noise node's seed now. For the pack's sweeps that's the whole point - you keep the sampler seed fixed and vary only the noise parameters to see how the image responds.

For sampler/scheduler choice, the usual rules apply (this thing has all 44 samplers and 9 schedulers): DPM++ 2M Karras is the safe default for SD 1.5/SDXL, and ancestral samplers stay less predictable. See ComfyUI's KSampler docs for the full rundown - nothing changes there.

Installing it

Ships in xl0's Latent Tools pack. ComfyUI Manager → search Latent Tools → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/xl0/latent-tools

Restart and it's under LatentTools in the node menu. The pack's only dependency is lovely-tensors (Manager installs it; manual cloners may need pip install lovely-tensors). No model downloads - if you can run KSampler, you can run this.

CategoryLatentTools

Inputs (11)

NameTypeDefaultDescription
modelMODELThe model used for denoising the input latent.
extra_seedINT00–18446744073709550000The random seed used for creating the noise.
stepsINT201–10000The number of steps used in the denoising process.
cfgFLOAT8.00–100The Classifier-Free Guidance scale balances creativity and adherence to the prompt. Higher values result in images more closely matching the prompt however too high values will negatively impact quality.
sampler_nameCOMBOThe algorithm used when sampling, this can affect the quality, speed, and style of the generated output.
schedulerCOMBOThe scheduler controls how noise is gradually removed to form the image.
positiveCONDITIONINGThe conditioning describing the attributes you want to include in the image.
negativeCONDITIONINGThe conditioning describing the attributes you want to exclude from the image.
latent_imageLATENTThe latent image to denoise.
latent_noiseLATENTThe latent noise to use for denoising.
denoiseFLOAT1.000–1The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling.

Outputs (1)

NameTypeDescription
LATENTLATENTThe denoised latent.