Nodes/deforum-comfy-nodes/Prepare Latent Denoise | Deforum
ComfyUI Node

Prepare Latent Denoise | Deforum

The node that makes frame-by-frame animation actually work

By deforum·Created about a year ago·Updated 3 months ago· 29
Prepare Latent Denoise | Deforum
  • model
  • latent_in
  • noise
  • latent_out
  • sigmas
  • start_step
sampler_name
scheduler
steps30
denoise0.500

This is the node that separates Deforum-style animation from a slideshow. Prepare Latent Denoise | Deforum does the one piece of math that a naive per-frame render gets wrong: it figures out exactly how much noise to add to a latent for a given denoise strength, hands you the sigma ladder ComfyUI will actually sample with, and tells you which step to start at. Feed its outputs into a SamplerCustom and you can run each frame as a partial re-noise of the last, which is the whole trick behind smooth, coherent animation instead of frame-by-frame dice rolls.

Here's the mechanism, because it's worth understanding rather than trusting. ComfyUI's own scheduler math is: if you want steps at denoise d, the full run is steps / d steps, and you start at step start_at = new_steps - steps. This node replicates that exactly. It builds a KSampler with your model, sampler, and scheduler, grabs the full sigma ladder, slices out sigmas[start_at : start_at + steps + 1], and scales the first sigma by the model's latent_format.scale_factor. That scaled value, ε·σ₀, is the correct amount of noise for this frame at this denoise - and if you've supplied a noise latent (a batch of noise, say from Seed Interp Noise | Deforum), it adds exactly that much to your latent. If denoise is 0 it short-circuits and returns the latent untouched.

The outputs are three, and the author's docstring gives you the wiring: latent_out goes to SamplerCustom.latent_image, sigmas goes to SamplerCustom.sigmas, and you set add_noise on the sampler to False (the node already injected the noise). The third output, start_step, is the INT saying where in the ladder you are - handy for step-count schedules or just for understanding what's happening. It needs a model, the sampler/scheduler names, steps, denoise, and latent_in.

Two honest warnings. First, if you don't supply a noise latent, the node passes your latent through unchanged - it still gives you the sigma ladder, but it won't add noise for you, so you'd better be feeding the sampler its own. The intended pipeline is noise from Seed Interp Noise → this node → SamplerCustom, and the shape of the noise batch must match your latent batch or you'll get a ValueError. Second, this node was built for the loop-based model where the previous frame's latent flows in and the next frame's denoise strength comes from a schedule - running it as a one-off in a plain workflow is possible but it's not really the point. The denoise value per frame is typically driven by a Value Schedule | Deforum so frames evolve gradually.

It ships in deforum-comfy-nodes: ComfyUI Manager → search "ComfyUI-Deforum" or deforum-comfy-nodes → install and restart, or git clone https://github.com/deforum-art/deforum-comfy-nodes into ComfyUI/custom_nodes. No model downloads, no extra Python deps. If you're porting an old A1111 Deforum habit - the per-frame denoise slider was the heart of that workflow - this node is the honest, sigma-correct translation of it, and learning it is the single biggest unlock in this pack.

CategoryDeforum/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