Nodes/ComfyUI_ColorMod/Save Image (HDR)
ComfyUI Node

Save Image (HDR)

Your HDR image, out-of-range values included

By city96·Created 3 years ago·Updated 2 years ago· 111
Save Image (HDR)
  • images
    filename_prefixHDR/ComfyUI

    Normal images live in [0, 1]: black to white, full stop. HDR images break that rule on purpose - a bright light can sit at 3.0, a shadow at 0.02, and the whole point is that you haven't decided yet how those extremes should map to screen values. That mapping decision is tonemapping, and it happens later. The problem is that PNG can't store any of it: it's 8-bit and it's clamped to [0, 1], so the instant you save an HDR image as PNG, the dynamic range is gone and you're committing to a look.

    Save Image (HDR) is the escape hatch. It writes the .hdr Radiance format via OpenCV, which stores floating-point values - the 3.0 highlight stays a 3.0 highlight. You can reload it later (with Load Image (HDR)) or hand the file to any HDR-aware tool like Blender or Photoshop.

    The inputs

    • images - the IMAGE to save. Works with out-of-range float values, which is the whole point.
    • filename_prefix - default HDR/ComfyUI. Note the slash: your files land in output/HDR/ by default, keeping HDR exports out of your normal PNG pile. Change it to whatever subfolder you like.

    No outputs - it's an output node.

    Installing

    Part of the ColorMod pack, and it needs OpenCV:

    cd ComfyUI/custom_nodes
    git clone https://github.com/city96/ComfyUI_ColorMod
    cd ComfyUI_ColorMod
    pip install -r requirements.txt
    

    Restart ComfyUI (or use ComfyUI Manager, search "ComfyUI_ColorMod"). If the HDR nodes are missing from your menu, opencv isn't installed - the startup console prints "ColorMod: Can't find opencv!" to tell you so. The requirement is opencv-contrib-python specifically, because some of the tonemap operators in this pack come from the contrib edition.

    What it's actually for

    Honest answer: mostly round-tripping. The typical HDR workflow in this pack is generate three differently-brightened passes → merge into HDR → tonemap back to SDR. You don't strictly need to save the middle step to disk. But saving it lets you:

    • pause a slow trial-and-error tonemapping session and reload the HDR instead of regenerating it,
    • edit or grade the HDR in an external editor,
    • or just keep the asset around, since generated HDRs are cheap to re-merge but annoying to re-tune.

    One thing to be clear about: an .hdr file won't preview in most places, and ComfyUI can't display it either until you tonemap it back. That's expected, not a bug. The README is blunt that using HDR images directly, without tonemapping, is "probably useless" and risks errors since the values are outside the [0, 1] range the VAE expects. Save the HDR, tonemap it, and ship the tonemapped PNG.

    CategoryColorMod/hdr

    Inputs (2)

    NameTypeDefaultDescription
    imagesIMAGE
    filename_prefixSTRINGHDR/ComfyUI

    Outputs (0)

    No outputs