Prepare Latent Denoise | akatz-loops
Exact sigma ladders and one-shot noise injection for custom sampling
- model
- latent_in
- noise
- latent_out
- sigmas
- start_step
PrepareLatentDenoise | akatz-loops is the node that makes custom sampling paths behave like a stock KSampler. It takes a model, a sampler/scheduler/steps/denoise recipe, and a latent, and returns the exact sigma ladder ComfyUI's own KSampler would compute for a partial-denoise (img2img-style) pass - plus, optionally, the correctly scaled noise already injected into the latent. You then feed its latent_out and sigmas into a SamplerCustom with add_noise off, and you get a hand-controlled sampling path that matches what the standard KSampler would do, no surprises.
Why it exists
ComfyUI's KSampler hides the sigma schedule and the noise scaling behind its widget set. The moment you want to drive sampling yourself - to inject your own noise batch (like the pack's SeedInterpNoise output), to reuse one noise across a loop, to slice a denoise range precisely - you need those internals on a wire. That's what this node does, and it does it the boring, correct way: it builds a real KSampler, reads its sigmas, slices them exactly like ComfyUI's partial-denoise logic (new_steps = steps / denoise, start_at = new_steps - steps), and scales the injected noise by σ₀ / the model's latent scale factor.
Inputs and outputs
- model (MODEL), sampler_name, scheduler, steps (default 30), denoise (default 0.5), latent_in (LATENT) - the recipe.
- noise (LATENT, optional) - the ε batch. Leave unwired and the latent passes through unchanged; wire it (shape must match
latent_in) and the node addsε · σ₀. - latent_out (LATENT) - the latent to sample from. Feed to
SamplerCustom.latent_image. - sigmas (SIGMAS) - the sliced ladder. Feed to
SamplerCustom.sigmas. - start_step (INT) - where in the full ladder the slice begins, so downstream logic knows the offset.
Two sensible short-circuits: denoise = 0 returns the latent untouched with an empty sigma ladder, and denoise ≥ 0.9999 runs the full schedule from step 0.
The wiring it's built for
SeedInterpNoise ──noise──▶ PrepareLatentDenoise ──latent_out──▶ SamplerCustom.latent_image
└────sigmas───────▶ SamplerCustom.sigmas
(add_noise = false)
Installing it
Part of the Akatz-Loop-Nodes pack (repo ComfyUI-Execution-Inversion):
cd ComfyUI/custom_nodes
git clone https://github.com/akatz-ai/ComfyUI-Execution-Inversion
# restart ComfyUI
Or ComfyUI Manager → "Akatz-Loop-Nodes". No model downloads; opencv-python is the only pip dependency (and unused by this node).
Gotchas
The noise batch must exactly match latent_in's batch and dimensions or you get a hard shape error - that's the most common trip-up, and it's why the pair with SeedInterpNoise works: both use the same latent downscale. Also remember this node does not sample - it prepares. If you feed its outputs into a KSampler instead of SamplerCustom you've defeated the purpose, and you must disable add_noise on the SamplerCustom or the injected noise gets doubled.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| steps | INT | 301–10000 | — |
| denoise | FLOAT | 0.5000–1 | — |
| latent_in | LATENT | — | |
| noiseopt | LATENT | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| latent_out | LATENT | — |
| sigmas | SIGMAS | — |
| start_step | INT | — |