Nodes/radiance/◎ Radiance VAE Decode
ComfyUI Node

◎ Radiance VAE Decode

VAE decode that won't OOM at 4K and won't clamp your HDR highlights

By fxtdstudios·Created 7 months ago·Updated 9 days ago· 242
◎ Radiance VAE Decode
  • samples
  • vae
  • alpha
  • image
  • metadata
  • latent_format
target_spaceLinear
tile_sizeAuto
overlap128
exposure_adjust0.0
hdr_modeClip (SDR)
inverse_tonemapfalse
target_stops12.0
crop_padding
export_rhdrfalse
rhdr_precisionf16
source_spaceLinear
processing_modesequential
force_hdr_decodefalse
hdr_outputfalse

Every ComfyUI pipeline ends the same way: latent in, VAE decode, image out. The stock node does it at any size the VRAM allows and clamps the result to a 0–1 SDR range - which is exactly why HDR and 4K workflows replace it. ◎ Radiance VAE Decode is the production decode: it tiles so 4K+ latents decode without OOM, and it can output true float HDR instead of a clamped, banded mess.

The KB's VAE essay frames the baseline - the VAE turns the latent back into pixels, and the wrong VAE or wrong channel count produces garbage rather than a subtly wrong image. This node adds the two things the stock decode silently refuses to do: decode at sizes beyond your VRAM, and not clamp. That second one is the whole HDR story.

How it works

Like its encode sibling, it tiles the latent (tile_size from Auto to 1536, overlap 32–256) with cosine blending so seams stay invisible - that's the "decode a 4K latent on an 8GB card" trick. It auto-detects the VAE factor and channel count (it'll tell you the latent format, e.g. flux_16ch). Then it gives you control over what the output means:

  • target_space - what color space to hand you: Linear, ACEScg, sRGB, or a log curve (LogC3/LogC4, S-Log3, V-Log, RED Log3G10, etc.).
  • hdr_mode - must match your encode setting. Compress (Log) (v2.3) is the true-HDR path: soft-shouldered, highlight-denoised, no hard clamp, so the full log-curve dynamic range comes out clean. Soft Clip inverts a tanh rolloff; Passthrough gives extended sRGB range.
  • hdr_output - the honest switch: when on, it skips the final [0,1] clamp, so the output tensor carries real scene-linear values above 1.0 and below 0. This is what you want for EXR/HDR delivery, and what you must turn off when feeding SDR nodes (previews, PNG export) or you'll confuse everything downstream.
  • inverse_tonemap + target_stops - expand an SDR latent up to a chosen dynamic range (8–16 stops) to recover highlight shape.
  • crop_padding - paste the encode's metadata here to auto-crop the padding the tiled encode added, for a clean round-trip.

Outputs: image, metadata (JSON), and latent_format (for validating downstream).

The inputs that matter

  • samples and vae - required.
  • target_space - set to match where the image is going.
  • hdr_output - the big one: on for HDR pipelines, off for SDR.
  • force_hdr_decode - the sharp edge: it forces the HDR path even when no radiance_meta is in the latent. The tooltip is blunt - keep it False when decoding after a sampler (the sampler produces sRGB-encoded latents, and forcing log/softclip inversion there gives wrong color); it's for direct encode→decode pipelines.

How to install it

In the radiance pack. ComfyUI Manager → "Radiance", or:

cd ComfyUI/custom_nodes
git clone https://github.com/fxtdstudios/radiance.git
cd radiance
pip install -r requirements_windows.txt

Restart, and it's under FXTD Studios/Radiance/Generate.

Common issues

The failure modes are almost all "mode agreement." Decode's hdr_mode/source_space must mirror what the encode used, and force_hdr_decode will produce wrong color if you flip it on after a sampler - the tooltip is there because people did exactly that. And hdr_output left on while feeding an SDR preview is the classic "my image is all wrong in the viewer but fine on export" moment; the pack's own docs remind you to disable it for SDR nodes. If output looks noisy in brights under Compress (Log), that's the decode-side denoise doing its thing - dial expectations on log-range material. Everything else about "decode at scale, keep the floats" just works, which is the point.

CategoryFXTD Studios/Radiance/Generate

Inputs (17)

NameTypeDefaultDescription
samplesLATENT
vaeVAE
target_spaceCOMBOLinearOutput color space.
tile_sizeoptCOMBOAutoTile size for decode. Auto queries VRAM.
overlapoptINT12832–256Overlap between tiles. 128px optimal for cosine blending.
exposure_adjustoptFLOAT0.0-10–10Post-decode exposure in stops.
alphaoptIMAGEAlpha channel from Radiance VAE 4K Encode.
hdr_modeoptCOMBOClip (SDR)Must match encode setting. 'Compress (Log)' (v2.3): true HDR — soft-shouldered, highlight-denoised, no hard clamp. Produces clean HDR output across the full log-curve dynamic range. 'Soft Clip': inverts tanh rolloff to recover highlights. 'Passthrough': extended sRGB range.
inverse_tonemapoptBOOLEANfalseExpand SDR to HDR (recover highlights).
target_stopsoptFLOAT12.08–16Target dynamic range for inverse tonemap.
crop_paddingoptSTRINGJSON metadata from encode (auto-crops padding). Leave empty to skip.
export_rhdroptBOOLEANfalseExport .rhdr sidecar for Radiance Viewer.
rhdr_precisionoptCOMBOf16RHDR export precision. 'f16' (fp16, default): smaller files, values capped at 65504 — adequate for most VFX material. 'f32' (fp32): full 32-bit range, ~2× file size — use for shots with extreme linear values (direct sun, fire VDBs).
source_spaceoptCOMBOLinearSource space used during encode. Required when hdr_mode is 'Compress (Log)' to invert the exact same log curve.
processing_modeoptCOMBOsequential'sequential' processes one tile at a time with minimal VRAM usage.
force_hdr_decodeoptBOOLEANfalseHDR DIRECT PATH — enables 32-bit HDR output for direct encode→decode pipelines (no sampler between nodes). When True: hdr_mode is always respected, even if radiance_meta is absent from the latent. Keep False when decoding after diffusion sampling — the sampler produces sRGB-encoded latents and Log/SoftClip inversion would produce incorrect color output.
hdr_outputoptBOOLEANfalse32-BIT HDR OUTPUT — when True, skips the final [0,1] clamp so the output IMAGE tensor carries full 32-bit scene-linear values (>1.0 for bright highlights, <0.0 for below-black). Required for Linear/ACEScg/Log target spaces in HDR VFX pipelines. Disable when feeding SDR nodes (preview, PNG export, etc.).

Outputs (3)

NameTypeDescription
imageIMAGEDecoded image tensor.
metadataSTRINGDecode metadata JSON.
latent_formatSTRINGLatent format detected from VAE (e.g. 'flux_16ch').