Nodes/Akatz-Loop-Nodes/Prepare Latent Denoise | akatz-loops
ComfyUI Node

Prepare Latent Denoise | akatz-loops

Exact sigma ladders and one-shot noise injection for custom sampling

By akatz-ai·Created about a year ago·Updated 8 months ago· 23
Prepare Latent Denoise | akatz-loops
  • model
  • latent_in
  • noise
  • latent_out
  • sigmas
  • start_step
sampler_name
scheduler
steps30
denoise0.500

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.

CategoryAkatz Loop Nodes/Latent

Inputs (7)

NameTypeDefaultDescription
modelMODEL
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
stepsINT301–10000
denoiseFLOAT0.5000–1
latent_inLATENT
noiseoptLATENT

Outputs (3)

NameTypeDescription
latent_outLATENT
sigmasSIGMAS
start_stepINT