Nodes/WAS Node Suite v3/HDR VAE Decode
ComfyUI Node Runs on cloud

HDR VAE Decode

Decode past white — keep the values VAE Decode throws away

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
HDR VAE Decode
  • samples
  • vae
  • images
  • peak
exposure0.0
ceiling0.0
negatives

Standard VAE Decode clamps. Whatever the decoder produces above white gets pinned at 1.0, whatever's below black gets pinned at 0.0 - which is exactly right for showing a picture and exactly wrong for a bright sky, a specular hit or a light source, because the decoder's response above white is information. A VAE trained on real photographs has opinions about what a bright region should look like, and the moment you fold those values down to a flat white shelf, you've thrown that away. HDR VAE Decode is the node that refuses to throw it away: it decodes a latent to an image keeping the values the decoder put above white and below black, so a light source comes out with its shape intact instead of as a white blob.

It slots straight into WAS v3's HDR chain. Decode past white with this, expose or grade in linear light, and park the result in EXR Save or DNG Save - or pull an exposure back with Linear Light - instead of shipping a clipped PNG that made all that headroom invisible.

How it works

The mechanism is neat and worth understanding: the node takes the same VAE the standard decode would, measures the affine transfer that VAE applies to its decoder output (probing it with test values to find the scale and offset), and then decodes without folding the result into 0–1. The decoder's actual values - the ones above white - come through as themselves rather than being pinned. Then three widgets shape what reaches the output:

  • exposure - stops applied to the decoded values. 0.0 leaves them alone, -1.0 halves them, and -2.0 brings a highlight that reached 4.0 back under white. Applied before the ceiling, so it's your main "pull it back into view" control.
  • ceiling - the highest value kept. 0.0 keeps everything the decoder produced; 4.0 holds anything brighter at 4.0; 1.0 gives you the same picture the standard VAE Decode does - which makes it the escape hatch if you ever want the boring version.
  • negatives - hold at black pins values below 0.0 at 0.0, which is what every save and blend expects; keep lets them through, for an EXR that records the ringing around a hard edge. Keep the default unless you specifically want that undershoot recorded.

What comes back

images - the decoded frames, where values above 1.0 read as white in a preview but survive into EXR Save, DNG Save and Linear Light. Don't judge by the preview; that's the whole point of the node. peak - the highest value in the batch, 1.0 or under when the decode stayed in range. Feed it to Linear Light through a To Number to pull a highlight back by a measured amount rather than guessing.

Installing it

WAS Node Suite v3: ComfyUI Manager → search WAS Node Suite v3, or clone into custom_nodes, restart. No weights of its own - it uses whatever VAE you wire in - and no extra packages. The probing and un-clamping run on torch inside the pack.

The one adjustment to expect: your first decode past white will look scary - a normal image that bright is clipped for a reason, and seeing the unclipped truth is startling. That's not a bug. Tone map it, expose it down, or just write the EXR and check it in a real viewer, and you'll see the shape the standard decode was quietly deleting.

CategoryWAS Suite/Image/HDR

Inputs (5)

NameTypeDefaultDescription
samplesLATENTThe latent to decode.
vaeVAEThe VAE that decodes it, the same one the standard VAE Decode would take.
exposureFLOAT0.0-16–16Stops applied to the decoded values. 0.0 leaves them alone, -1.0 halves them, -2.0 brings a highlight that reached 4.0 back under white. Applied before the ceiling.
ceilingFLOAT0.00–1024Highest value kept. 0.0 keeps everything the decoder produced, 4.0 holds anything brighter at 4.0, and 1.0 gives the same picture the standard VAE Decode does.
negativesCOMBO'hold at black' = values below 0.0 come out at 0.0, which is what every save and blend expects; 'keep' = they come through, for an EXR that records the ringing around a hard edge.

Outputs (2)

NameTypeDescription
imagesIMAGEThe decoded images. Values above 1.0 read as white in a preview and survive into EXR Save, DNG Save and Linear Light.
peakFLOATThe highest value in the batch, 1.0 or under when the decode stayed in range. Feed it to Linear Light through To Number to pull a highlight back by a measured amount.