Clamp Denoised
The clamp that keeps pixel-space renders from drifting into the weeds
- model
- vae
- MODEL
Clamp Denoised is the safety rail on AsymFlow pixel-space generation. In a normal latent-space model, the denoiser's output is a latent that can happily hold any float value - the VAE decode handles the range at the end. In AsymFlow, the thing being denoised is the image, in Oklab color space, and if the values drift outside the valid image range during sampling, you get blown-out colors, banding, or straight-up NaN garbage. This node makes sure that can't happen.
It's a two-line idea executed properly: after the CFG step, take the denoised output, decode it through the VAE, clamp to [0, 1], and re-encode. The Oklab Color Encoder stands in as the "VAE" here, so decode-then-clamp-then-encode is really "convert Oklab→sRGB, clamp pixels to valid range, convert back." The node only does this when the tensor is 4D - it's patched onto the model as a post-CFG function, so it runs on every sampling step.
Two inputs: model (your loaded AsymFlow model) and vae (the Oklab Color Encoder's output). Output is the patched MODEL, wired on into the sampler - in the shipped AsymFLUX.2 workflow it sits right after Load AsymFlow Model, before the scheduler's sampling starts.
When you need it
Only for pixel-space models. The moment your "latent" is actually pixels, you want this clamp. It's cheap insurance against the most common AsymFlow failure mode: a render that looks fine in the first preview steps and then blows out to grey or white mush because values escaped the valid range mid-sampling.
Where people get burned: bolting it onto a pi-Flow (latent-space) workflow "just in case." There it does a pointless VAE round-trip on every step - it slows you down and fixes nothing, because latent-space denoisers are already operating in a safe range by design. Save it for AsymFlow.
Install
It ships with the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Lakonik/ComfyUI-piFlow
Restart ComfyUI (or ComfyUI Manager → search "ComfyUI-piFlow"). Requires ComfyUI 0.17.0+ - the pack targets current releases, so update ComfyUI before installing or the loader nodes won't even start. No separate Python dependencies.
One practical note: because the clamp runs on every step, it adds a small per-step cost - negligible next to the model forward pass, but it's there. That's the deal: a couple of milliseconds per step for never seeing a washed-out pixel-space render again.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| vae | VAE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |