LTKSampler
A KSampler That Lets You Feed It the Noise
- model
- positive
- negative
- latent_image
- latent_noise
- LATENT
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_indexof 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 yourlatent_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.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model used for denoising the input latent. | |
| extra_seed | INT | 00–18446744073709550000 | The random seed used for creating the noise. |
| steps | INT | 201–10000 | The number of steps used in the denoising process. |
| cfg | FLOAT | 8.00–100 | The 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_name | COMBO | The algorithm used when sampling, this can affect the quality, speed, and style of the generated output. | |
| scheduler | COMBO | The scheduler controls how noise is gradually removed to form the image. | |
| positive | CONDITIONING | The conditioning describing the attributes you want to include in the image. | |
| negative | CONDITIONING | The conditioning describing the attributes you want to exclude from the image. | |
| latent_image | LATENT | The latent image to denoise. | |
| latent_noise | LATENT | The latent noise to use for denoising. | |
| denoise | FLOAT | 1.000–1 | The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | The denoised latent. |