Nodes/RC Image Compositor/RC Save Image (Transfer Metadata)
ComfyUI Node

RC Save Image (Transfer Metadata)

Stamp your original workflow back onto an edited image

By kj863257·Created 11 months ago·Updated 10 months ago· 16
RC Save Image (Transfer Metadata)
  • target_image
    source_image_file
    filename_prefixComfyUI

    Here's a ComfyUI annoyance that has no built-in answer: you generate an image, then run it through a bunch of editing nodes - upscale, color grade, composite - and the final saved PNG embeds the editing workflow. The original prompt and the generation graph are gone, overwritten. Drag that image back into ComfyUI later and you reconstruct the edit, not the image you actually care about.

    RC Save Image (Transfer Metadata) is the fix. It's an output node that takes your processed image, reads the workflow metadata out of a source image file - the original render - and writes that metadata into the new PNG. The result: an edited file that still carries the original generation workflow, so anyone who drags it into ComfyUI sees the graph that made the base image.

    How it works

    The mechanics are straightforward and visible in the source. The node reads the PNG text chunks (tEXt) from a source file in your ComfyUI input folder, extracts the workflow and prompt keys, and merges them into the PNG info it writes for the target image. It also hashes the source file on each run (IS_CHANGED), so if you swap the source image, the preview re-executes - you don't have to force a rerun yourself.

    The save itself uses the same output folder and counter naming as the standard Save Image, so your file lands where you expect, just with the extra metadata attached.

    The inputs that matter

    • target_image - the image you're actually saving.
    • source_image_file - a dropdown listing image files in your input folder, with an upload button. Pick the original render whose workflow you want to carry over.
    • filename_prefix - default ComfyUI, same formatting support as the built-in node.

    There are no outputs - it's a terminal node, as a save should be.

    How to install it

    It's part of the RC Image Compositor pack, so one install gets you this and the other 30+ nodes:

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

    Restart ComfyUI, or install via ComfyUI Manager by searching "RC Image Compositor". Requirements are just pillow, numpy, and opencv-python - nothing heavy, no models.

    Common issues

    The one thing to remember: the source file must live in your input folder, and it needs to actually contain text metadata. A PNG you generated in a different app, or one that's already been stripped, has nothing to transfer - the node just writes the target with no extra info, which is easy to mistake for a bug. Also note it transfers text metadata, not arbitrary binary chunks, so if you're hoping to preserve an obscure proprietary tag you may be out of luck.

    And a privacy word: if you're transferring metadata on purpose, you're on the good side of this. If you'd rather remove it, the pack's sibling node RC Save Image (No Metadata) does the opposite.

    CategoryRC/Utilities

    Inputs (3)

    NameTypeDefaultDescription
    target_imageIMAGETarget image to save with transferred metadata
    source_image_fileCOMBOSource image file containing workflow metadata to extract
    filename_prefixSTRINGComfyUIFilename prefix for saved images

    Outputs (0)

    No outputs