Save SDR Preview (PNG/JPEG)
The boring node that actually gets your film look onto a screen
- sdr_image
Every pack needs a boring node, and this is the good boring one. Save SDR Preview takes an SDR image - normally the preview_sdr output of FilmSimNode - and writes it out as a plain PNG or JPEG into ComfyUI's output folder. That's the file you actually post, email, drop in a Discord, or look at on a normal monitor. The whole HDR side of this pack produces files most screens can't show; this node produces the one everyone can. It's also the node that does the final color-space conversion for the SDR path, so it earns its keep beyond just "write a file."
How it works. It sanitizes the input (clamps negatives and NaN, keeps values non-negative), then - if apply_srgb_gamma is on - applies a 1/2.2 power to convert linear scene values into sRGB display values, clamps to 0–1, and saves 8-bit via OpenCV's imwrite (remembering to flip RGB to BGR, the classic OpenCV gotcha). PNG ignores quality and uses a fixed compression level; JPEG uses it properly as a quality setting.
The inputs that matter. Honestly, three:
sdr_image- wirepreview_sdrfrom FilmSimNode here. It's an output-only node, so nothing leaves it; it just saves.apply_srgb_gamma(default true) - keep it on for the film node's linearpreview_sdr. If your input is already gamma-encoded (say you disabled gamma upstream, or you're feeding a normal ComfyUI image), turn it off or everything comes out washed out and bright. This is the one knob that bites people.format(PNG default, JPEG),quality(default 95),filename_prefix- PNG or JPEG, how lossy, and the base name. Files get a_00000-style counter appended, which means you never overwrite a previous save.
Install. Same as the rest of Comfy-FilmSimulator: ComfyUI Manager → search "Comfy-FilmSimulator", or cd ComfyUI/custom_nodes && git clone https://github.com/zhuyanan/Comfy-FilmSimulator, then restart. It only needs numpy and OpenCV, both of which ComfyUI already has. No models, no downloads - the pack is pure Python image math.
Where people get burned. Two spots. First, wiring the linear hdr_image into this node instead of preview_sdr - gamma will make it less wrong, but highlights that were legal in linear get clipped hard in the 0–1 clamp, so the SDR you save won't match the HDR you graded. Second, the gamma toggle above: if the saved file looks gray and lifted, your input was already display-encoded and you're double-converting. And one mild trap to expect: because this is an output node with no image output, dragging a wire out of it does nothing - the only place your image ends up is the file on disk. If you want to keep processing, branch before this node.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| sdr_image | IMAGE | — | |
| filename_prefix | STRING | SDR_Image | — |
| format | COMBO | PNG | 2 options: PNG, JPEG |
| quality | INT | 951–100 | — |
| apply_srgb_gamma | BOOLEAN | true | — |
Outputs (0)
No outputs