DNG Save
Save a raw you can actually grade — write DNG from linear light
- images
- files
- white_point
Most "save" nodes write a finished picture. This one writes a raw file - DNG, the format Lightroom, Camera Raw, darktable and RawTherapee open with their raw controls rather than their image controls. If your ComfyUI work is HDR-adjacent - you reconstructed a blown highlight, decoded past white, or rebuilt a smooth gradient out of an 8-bit image - you don't want to ship that through a PNG and watch the headroom die. DNG Save writes your images as 16-bit, linear light, so a recovered highlight arrives in the developer with room to pull back, and a rebuilt gradient arrives without its 8-bit steps.
It's the photographic end of WAS v3's HDR story. The image side of that story - HDR Reconstruct, HDR VAE Decode, EXR Load - answers in linear light with values above one kept, and this node is one of the two places you can park that range. EXR Save is the compositor's exit (Nuke, Resolve); DNG Save is the raw developer's.
How it works
The images are read as linear light - that's a requirement, not a suggestion. If you feed it a picture that came straight out of a PNG or JPEG, put a Linear Light node in front of it first. Every image in the batch gets its own file, each numbered in sequence: ComfyUI_raw gives ComfyUI_raw_0001.dng, and a prefix like plates/shot writes into that subfolder. Tokens expand, so [time(%Y-%m-%d)]/shot dates the folder for you.
Two widgets shape the raw:
profile-sRGB primariesmeans colours come out of a developer exactly as they went in;generic camerauses a camera's own primaries and white balance, which a developer corrects for and which looks closer to a photograph out of the box. If your downstream is a photo developer and you want the "shot on camera" feel, generic camera is the one.layout-demosaicedkeeps red, green and blue at every pixel (nothing thrown away);colour filter arraystores one colour per pixel in a Bayer tile, the way a sensor actually holds it, and lets the developer do its own demosaicing.
What comes back
Two outputs. files is the full path of every file written this run, one per line, in batch order - a file that couldn't be written is left out of the list rather than crashing the run. white_point is the linear value written as the top of the 16-bit range: 1.0 means the images fitted as they were, while 2.99 means a recovered highlight reached that far and the whole range was fitted under it. It's your record of how much headroom actually survived.
Installing it
WAS Node Suite v3, standard: ComfyUI Manager → search WAS Node Suite v3, or clone into custom_nodes. The DNG writer is implemented inside the pack on torch - no extra packages, no downloads.
The honest caveat: DNG is a big, fiddly format, and this node deliberately writes a linear raw. If you open the file and it looks flat or dark in your developer, that's not a bug - you're seeing linear data with the tone curve deliberately absent. Grade it like a raw, not like a finished JPEG, and the point of the exercise reveals itself.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | The images to write, read as linear light. Every image in the batch gets its own file, each with the next number in the sequence. Put Linear Light in front of a picture that came straight out of a PNG or a JPEG. | |
| filename_prefix | STRING | ComfyUI_raw | Name and folder under the output directory, before the number. `ComfyUI_raw` gives `ComfyUI_raw_0001.dng`; `plates/shot` puts it in that subfolder. Tokens expand, so `[time(%Y-%m-%d)]/shot` dates the folder. |
| profile | COMBO | 'sRGB primaries' = the colours come out of a developer exactly as they went in; 'generic camera' = a camera's own primaries and white balance, which a developer corrects for and which looks closer to a photograph out of the box. | |
| layout | COMBO | 'demosaiced' = red, green and blue kept at every pixel, so nothing is thrown away; 'colour filter array' = one colour per pixel in a Bayer tile, which is what a sensor holds and which a developer demosaics itself. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| files | STRING | Full path of every file written this run, one per line, in batch order. A file that could not be written is left out of the list. |
| white_point | FLOAT | The linear value written as the top of the 16-bit range. 1.0 = the images fitted as they were; 2.99 = a recovered highlight reached that far and the whole range was fitted under it. |