Inversed Euler Sampler
The Inversed Euler Sampler
- SAMPLER
Every img2img workflow has the same dirty secret: the "noise" it adds to your image is just random gaussian, dolloped on at whatever denoise strength you picked. That's why composition drifts - the model isn't re-sampling your image, it's re-sampling noise that only vaguely resembles it. This node is for people who want the real thing: the actual noise that made the image in the first place.
The Inversed Euler Sampler is the heart of logtd/ComfyUI-InversedNoise, a small experimental pack built around unsampling - also called sample inversion or "DDIM inversion." It's a SAMPLER node with no inputs at all. You drop it into a custom-sampling graph and wire its single SAMPLER output into a SamplerCustom node.
How it works
Under the hood it's a faithful port of Algorithm 2 (Euler steps) from Karras et al. 2022 - the same NVIDIA paper that gave the world the Karras schedule - wrapped in ComfyUI's KSAMPLER object. That alone is a sampler you've effectively used before. The twist is how you run it.
Normal sampling walks the sigma schedule from high noise to low, scrubbing noise out step by step. Unsampling does the reverse: you flip the schedule with FlipSigmas, feed the sampler your VAE-encoded latent, and it walks low-to-high, adding back exactly what denoising would have removed. What comes out the other end is the latent's own noise, with the image's structure baked into it. Point a normal sampler at that noise with a new prompt and you get an edit that keeps the original composition in a way a denoise slider never does.
The source is worth a skim if you're curious - it even reproduces the EDM paper's special first-step handling (d = (x - denoised) / (2 * sigmas[i])), which is the kind of detail that separates a working inversion from a mushy one.
Wiring it up
The minimal graph is: LoadImage → VAEEncode → SamplerCustom, with BasicScheduler → FlipSigmas → SamplerCustom's sigmas input, and this node's SAMPLER output into its sampler input. The pack ships an example workflow (example_noise_inversion.json) that does exactly this, then runs the recovered noise through a partial KSamplerAdvanced pass to regenerate.
Installing it
Nothing heavy here. The pack has no requirements.txt, downloads no models, and only needs torch, tqdm, and ComfyUI's own comfy.samplers module - everything a stock install already has.
- Via ComfyUI Manager: search "InversedNoise", install, restart.
- Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/logtd/ComfyUI-InversedNoise
# restart ComfyUI
Where people get burned
The README says it plainly: this is Experimental/WIP. Inversion is approximation, not magic - the recovered noise won't be byte-identical to whatever seed originally generated the image, so you'll get artifacts and "pinching" on some images. That's not a bug in this node so much as the physics of the technique, and it's why the pack also ships a noise-mixing node to paper over it.
A few real gotchas: it only inverts cleanly on converging samplers in the forward pass - if you're stepping with an ancestral sampler, there's no clean noise to recover. And because the node takes no inputs, all your tuning happens elsewhere: step count, scheduler, and how much fresh noise you allow on the way back. Don't expect this to behave on every model; treat it as a toy you can get real results from once you respect its limits.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SAMPLER | SAMPLER | — |