Nodes/ComfyUI-MetaData-ZaKo/MetaData Injection (ZaKo)
ComfyUI Node

MetaData Injection (ZaKo)

Stick the original workflow back into your edited image

By xiaoshengyvlin·Created 10 months ago·Updated 2 months ago· 4
MetaData Injection (ZaKo)
  • workflow
  • image
    filename_prefix我的元信息/ima_

    The one job this node does

    ComfyUI has a cultural norm: images carry their workflow. SaveImage bakes your current graph into the PNG as text metadata, and anyone who drags the file back into ComfyUI gets the whole pipeline reconstructed - "workflow included" became the expectation in the community, to the point that posts withholding it drew actual backlash.

    But that cuts both ways. Grab someone's base image, run it through your own upscale or img2img pass, save it with a plain SaveImage, and the output now proudly advertises your chain while the original creator's workflow is gone forever. MetaDataZaKo (shown as "MetaData Injection (ZaKo)") exists to put it back. It re-saves your edited image carrying the workflow metadata from the source image that started the chain. For posting "here's what I did to this" - or crediting a base workflow you built on - that's the whole feature.

    How it actually works

    Two IMAGE inputs and one string, plus two hidden inputs (prompt, unique_id) that ComfyUI fills in automatically for graph introspection:

    • workflow - a pointer, not pixels. The node walks the graph backwards from this wire looking for a LoadImage / LoadImageMask node, following Reroutes only. When it finds one, it opens that source file on disk and pulls out PNG metadata keys named prompt, workflow, or anything containing comfy.
    • image - the actual pixels you want saved.
    • filename_prefix - the save path. The default is 我的元信息/ima_ ("my metadata/"). Everything before the last / becomes a subfolder inside ComfyUI's output directory, so the default run drops ima_00001_.png into ComfyUI/output/我的元信息/.

    Nothing comes out of the node - it's an output/save node (RETURN_TYPES is empty). You wire in and read the console, where it logs [ZaKo] progress lines.

    Honest framing: this is a scratch tool

    The README is a screenshot and a one-line confession (the pack's README is in Chinese; roughly: "I'm a beginner, the code is purely AI-generated, not hand-modified, and I can't update or maintain it"). So this is a personal utility someone published to the registry, not a maintained ecosystem staple - its comfy.icu page has zero impressions. It does one narrow thing and does it for free with zero dependencies. Set expectations accordingly.

    Where people get burned

    • The trace is fragile. It only walks through Reroute and LoadImage/LoadImageMask. Any other node sitting between the source LoadImage and the workflow input kills the hunt mid-way (you'll see "追踪中断" / trace interrupted in the logs) and nothing gets injected - the image still saves, silently metadata-free. Feed workflow straight from the source LoadImage's output.
    • It only copies ComfyUI-shaped PNG text chunks. A1111 parameters chunks, Civitai resource blobs, and JPEG EXIF are all ignored. The source needs to be a PNG carrying actual ComfyUI metadata, or there's nothing to swap.
    • No metadata is not an error. If extraction finds zero chunks it logs a red warning but saves the output anyway. A "successful" run can quietly hand you a file with no workflow attached - glance at the console before you post.

    Install

    Boring, which is a relief here. No requirements.txt, no models, nothing but what ComfyUI already ships:

    cd ComfyUI/custom_nodes
    git clone https://github.com/xiaoshengyvlin/ComfyUI-MetaData-ZaKo
    

    Restart ComfyUI. Or use Manager - search "ComfyUI-MetaData-ZaKo" and install from there. The node lands under the ZaKo category, and it's the kind of thing you'll use precisely when you care whose workflow ends up in the file.

    CategoryZaKo

    Inputs (3)

    NameTypeDefaultDescription
    workflowIMAGE
    imageIMAGE
    filename_prefixSTRING我的元信息/ima_

    Outputs (0)

    No outputs