Nodes/radiance/Float32 Convert
ComfyUI Node

Float32 Convert

Get your image into float and linear without losing the top end

By FXTD-Studios·Created 8 months ago·Updated about 18 hours ago· 246
Float32 Convert
  • image
  • image
◄normalizefalse►
◄source_gamma1.00►

Two small jobs, one node. Make sure the tensor is 32-bit float, and if it's gamma-encoded, linearise it. Both sound trivial and both are the difference between an HDR chain that works and one where the highlights quietly vanish at step two.

What it does

image goes in and comes out as float32 with no clamping - values above 1.0 and below 0.0 survive. That matters more than it sounds. Any node that clamps is a node that has just thrown away the only data in your image that isn't reproducible downstream, and clamping happens by accident all over the place.

source_gamma says what encoding the input is in: 1.0 for already-linear, 2.2 for sRGB-ish, 2.6 for DCI. It linearises accordingly. If you're coming from a plain ComfyUI decode - an 8-bit PNG through a standard loader - you're at 2.2-ish and you want this node; if you already linearised upstream, leave it at 1.

normalize is per-frame, and only fires when that frame's maximum is above 1.0: it divides so the frame peaks at 1.0. Frames already inside 0–1 are left alone. Note this is a per-frame behaviour (it was a global batch max in the dim and distant past) - so on a batch, each frame gets its own scale. That's what you want for a one-off still and what you don't want for a sequence, where per-frame scaling means a slowly-dimming shot comes out flat.

Output is a single image.

Where it fits

Think of it as the entry door to the float half of the graph. A typical chain: Read or LoadImage → Float32 Convert with source_gamma: 2.2 → whatever passes you need in linear (denoise, curves, GPU Tensor Ops) → write EXR. Everything after the convert is doing maths on light; everything before it was doing maths on display values.

If you only need an operation - an exposure bump, a gamma tweak - Radiance's GPU Tensor Ops does it in one node. Use this one when you want to change the nature of the data, not just adjust it.

Install

Part of Radiance. ComfyUI Manager → search Radiance → install, restart, hard-refresh the browser. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/fxtd-studios/radiance.git
cd radiance
python -m pip install -r requirements.txt

On Windows portable, run that pip line with python_embeded\python.exe. Nothing downloads for this node.

Where people get burned

Assuming float32 means "no clipping on the way in." It doesn't. If the image arrived as an 8-bit PNG, the highlights were already gone before this node saw them, and converting to float won't conjure them back. Float is a container, not a recovery.

Double-linearising. Applying source_gamma: 2.2 to something that's already linear gives you a washed-out, low-contrast image that looks vaguely "film-like" - which is exactly why people don't notice they've done it. Check what your upstream node hands you; if you're unsure, set source_gamma: 1 and see if the image looks right.

Leaving normalize on in a batch. Each frame gets its own peak, so a sequence with any exposure variation comes out with the variation removed. For stills it's a handy "give me 0–1" button; for video it's a bug you'll spend an afternoon on.

CategoryFXTD STUDIOS/Radiance/HDR

Inputs (3)

NameTypeDefaultDescription
imageIMAGEImage to convert to float32. Values are not clamped.
normalizeoptBOOLEANfalsePer frame, divide by the frame's maximum when that maximum is above 1.0, so each frame peaks at 1.0. Frames already within 0 to 1 are left as they are.
source_gammaoptFLOAT1.000.1–4Source gamma to linearize. 1.0 = already linear, 2.2 = sRGB-ish, 2.6 = DCI.

Outputs (1)

NameTypeDescription
imageIMAGE—