Nodes/WAS Node Suite v3/HDR Reconstruct
ComfyUI Node Runs on cloud

HDR Reconstruct

Put the light back into a blown highlight

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
HDR Reconstruct
  • images
  • images
  • peak
dequantisetrue

When a camera clips a highlight - a blown sky, a lamp, a specular hit on metal - the light information is simply gone, stored as flat white. A normal image lets it stay that way. HDR Reconstruct tries to invent the missing light back, using a network trained to rebuild what a clipped highlight would have looked like. The result comes back as a gradient rather than one flat white shelf: a sun and its glow stay apart under a grade, a specular highlight keeps its falloff, and the whole frame is answered as linear light with everything above one kept.

This is the piece that makes the rest of WAS v3's HDR story hold together. Decode past white (HDR VAE Decode) or load a linear plate (EXR Load), and you've got headroom - but for a finished 8-bit image, the headroom was never there. Run the image through HDR Reconstruct and suddenly there's something above white to work with, which you can then expose down, tone map, or park in an EXR or DNG for a real grading program.

How it works

Each frame is run through an HDRCNN autoencoder - a network built on the classic architecture for reconstructing HDR from a single exposure - running on torch on ComfyUI's device. It answers linear light on a 0-to-1 scale with the recovered highlights sitting above it. Two settings shape the run:

  • dequantise (on) - before the network sees the frame, this rebuilds the levels an 8-bit file threw away first, smoothing the posterization that JPEG and PNG code-levels introduce. Leave it on for a PNG or JPEG; turn it off for footage that's already in float, where there's nothing to dequantise.
  • The images input takes a batch; every frame is reconstructed on its own and comes back at the size it went in at.

Outputs: images - the reconstruction as linear light with recovered highlights above white; and peak - the largest value anywhere in the result. 40.07 means a clipped disc was rebuilt to 40 times white; 1.0 means nothing above white was recovered. Divide by peak to scale the frame back into range, or use it to know how much headroom you actually got.

A preview clips the result back to white, which is the single most confusing thing about this node at first: you look at the output and it looks blown. It isn't - the range is there on the wire, the preview just can't show it. Tone map it or write it to EXR to see what you actually made.

Installing it and the weights story

Pack install is the usual WAS Node Suite v3 story (ComfyUI Manager → WAS Node Suite v3, or clone into custom_nodes), but this node needs weights, and the pack ships the architecture, not the file. The HDRCNN checkpoint (hdrcnn.safetensors) comes from WAS's published weights repo and lives in ComfyUI/models/hdr/. With network: true under features: in the pack's config.yaml, a run fetches it on first use; with the network toggle off, the node stops and names exactly where the missing file should go. Drop it in and restart, and the message goes away. It's a gated node, but the gate is on by default in a fresh install - the thing that stops you is usually just the missing weight file.

CategoryWAS Suite/Image/HDR

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEThe frames to reconstruct. Each one is run on its own and comes back at the size it went in at.
dequantiseBOOLEANtrue'true' = rebuild the levels an 8-bit file threw away first; 'false' = run the frames as they arrived. Leave it on for a PNG or a JPEG, off for footage already in float.

Outputs (2)

NameTypeDescription
imagesIMAGEThe reconstruction, as linear light on a 0 to 1 scale with the recovered highlights above it. A preview clips it back to white, so tone map it or write it to EXR to see the range.
peakFLOATThe largest value anywhere in the result. 40.07 = a clipped disc rebuilt to 40 times white; 1.0 = nothing above white was recovered. Divide by it to scale the frame back into range.