Nodes/Light-x02 Nodes/📝✅ Image Metadata Saver
ComfyUI Node

📝✅ Image Metadata Saver

Save a PNG that still carries its generation metadata — Civitai included

By Light-x02·Created 11 months ago·Updated 8 months ago· 11
📝✅ Image Metadata Saver
  • images
  • metadata
    filename_prefixComfyUI
    subdirectory_name

    ComfyUI's default save node writes the workflow into your PNG, but the image you export doesn't have to lose anything along the way. The 📝✅ Image Metadata Saver saves an image with whatever metadata you hand it embedded verbatim in the PNG file - which is the whole trick for keeping generation info intact through an upscale or edit chain, and for getting your posts to display correctly on Civitai.

    How it works

    It's the mirror image of the pack's Image Metadata Loader. You feed it images, optionally feed it metadata (connect the loader's METADATA output, or any source that emits one), and it writes the PNG with every metadata key re-embedded via PIL's PngInfo. Because it writes the same keys that came in, a loader → saver loop preserves metadata byte-for-byte through any intermediate processing - exactly the "upscale without destroying my generation info" loop the pack advertises.

    Metadata is optional, which is the forgiving part: leave the metadata input unconnected and it behaves like a plain save node. The tooltip on metadata doesn't lie about that being the whole point - "the metadata to include."

    The filename system

    Two inputs control where things land, and both support datetime placeholders:

    • filename_prefix - supports %date:yyyy-MM-dd%, %date:yyyy%, %time:HH-mm-ss%, %time:HH%, and %datetime:full%, among others. Defaults to ComfyUI.
    • subdirectory_name - same placeholder set (minus one), so you can auto-organize by date, e.g. %date:yyyy-MM%.

    One hard rule, stated in both the README and the source: %datetime:full% is not allowed in subdirectory_name - the node raises an error rather than nesting folders by the second. Date-placeholders in subdirectories are fine; full-timestamp subdirectories are not. If you see that ValueError, that's what it is.

    What to expect

    • Outputs: none - it's an output node; saved files appear in your output folder (with subfolders if you set one).
    • Inputs: images (IMAGE), filename_prefix (STRING), subdirectory_name (STRING), metadata (METADATA, optional).
    • PNG only for the metadata-carrying path - metadata doesn't survive JPEG.

    The metadata it writes is exactly what you give it. If you want Civitai to recognize the generation details, you need the metadata to be in a format Civitai parses - which is where the author points to edelvarden's ComfyUI-ImageMetadataExtension as the companion tool, and where the pack's LoRA-loader-to-text node helps you produce the right LoRA lines.

    Install

    Ships in Light-x02 Nodes - ComfyUI Manager → search "ComfyUI-Lightx02-Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Light-x02/ComfyUI-Lightx02-Nodes
    

    Restart ComfyUI. Like the loader, this used to live in its own standalone repo (ComfyUI-Image-Metadata-Nodes) - if you have that, delete it from custom_nodes first or you'll get duplicate-registration errors alongside this pack.

    Category💡Lightx02/utilities

    Inputs (4)

    NameTypeDefaultDescription
    imagesIMAGEThe images to save.
    filename_prefixSTRINGComfyUIThe prefix for the file to save. Supports: %date:yyyy-MM-dd%, %date:yyyy-MM%, %date:yyyy%, %date:MM%, %date:dd%, %time:HH-mm-ss%, %time:HH%, %time:mm%, %time:ss%, %datetime:full% (filename only).
    subdirectory_nameSTRINGOptional subdirectory. Avoid using %datetime:full% here to prevent excessive nesting.
    metadataoptMETADATA

    Outputs (0)

    No outputs