Nodes/Save Image (copy EXIF from source)/Save Image (copy EXIF from source)
ComfyUI Node

Save Image (copy EXIF from source)

Your edited photos can keep their camera EXIF — here's the node that does it

By kevinkessler·Created 3 months ago·Updated 3 months ago· 0
Save Image (copy EXIF from source)
  • images
    source_image
    filename_prefixComfyUI
    format
    quality95

    The name is exactly what the node does, which is rarer in ComfyUI than it should be. Save Image (copy EXIF from source) saves your processed image and stamps it with the EXIF bytes from an original photo - the date it was taken, the camera, the lens, even GPS. This is the node you reach for when you run a real photograph through ComfyUI.

    Here's the problem it solves. The stock Save Image node writes a brand-new file with zero metadata, so when you upscale a vacation photo, run a face-restore pass, or do generative cleanup on a portrait, the output loses the date, camera, and location tags. Your photo manager suddenly can't tell you when the shot was taken, and the location pin on your maps disappears. This node keeps the file looking like the original - same EXIF, same story - while your edits live on top. If you only generate images from scratch, you don't need it: an AI image has no camera EXIF worth copying anyway. It's for the photo-editing workflows, and it's one of the few things that handles them politely.

    How it works

    Mechanically it's simple, which is why it's reliable. source_image is a dropdown that lists the image files sitting in ComfyUI's input/ folder. When you hit save, the node opens that source with Pillow and grabs the raw EXIF bytes - it prefers the untouched exif blob from the file's info dict, which preserves vendor-private data like MakerNote, and falls back to getexif().tobytes() if that's missing. Those exact bytes get written into your new output file. No re-encoding, no tag-by-tag copying, just the original bytes carried over.

    Two format-dependent behaviors worth knowing:

    • JPEG - EXIF only, saved with quality and subsampling=0 (that's 4:4:4 chroma, i.e. no color smear on red text - nicer than what most quick exports produce).
    • PNG - EXIF plus the usual ComfyUI workflow metadata (prompt/extra_pnginfo). So if you want to reload your workflow from the output later, pick PNG; if you want a small file photo software recognizes on sight, pick JPG.

    The node is a terminal output node (OUTPUT_NODE, no return types), so nothing wires out of it - it's the end of the line, just like Save Image.

    The inputs that matter

    You'll touch maybe three of them:

    • source_image - pick the original photo from the dropdown, or hit the upload button to drop a new file into input/. This is the one that does the work.
    • format - jpg or png, per the metadata tradeoff above.
    • quality - JPEG quality, 1–100, default 95. Lower it if you're saving a contact sheet or preview, leave it if you care about the file.

    filename_prefix defaults to ComfyUI and just names the file (outputs land in output/ as ComfyUI_00001_.jpg). One subtle trap: the copied EXIF includes the camera's orientation tag, but ComfyUI's Load Image already rotates the pixels to upright - so a phone photo with an orientation tag can end up rotated twice when a viewer re-applies it. Keep an eye on that first output.

    Installing it

    No models, no heavy dependencies - it's a single Python file that uses only Pillow, which ComfyUI already ships. In ComfyUI Manager, search for "Save Image (copy EXIF from source)" and install. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kevinkessler/comfyui-save-with-exif
    

    Then restart ComfyUI. That's the whole install.

    When it quietly does nothing

    The one failure mode that confuses people: if your source photo has no EXIF - a screenshot, an AI image, something re-saved by a messenger app - the node saves the file anyway, no error, and you might think it worked. Check the console for the [SaveImageWithSourceExif] wrote … (no EXIF available) line. That's the author's deliberate choice: save the image, don't crash on missing metadata. It just means your source is a dead end for metadata, not that the node broke.

    Categoryimage

    Inputs (5)

    NameTypeDefaultDescription
    imagesIMAGE
    source_imageCOMBOOriginal file in input/ whose EXIF should be copied. Use the upload button to add a new file.
    filename_prefixSTRINGComfyUI
    formatCOMBO2 options: jpg, png
    qualityINT951–100

    Outputs (0)

    No outputs