ComfyUI Node

FEExtraInfoAdd

Stamp any value into your saved PNG's metadata

By fexli·Created 3 years ago·Updated about a year ago· 3
FEExtraInfoAdd
  • enter
    save_fieldpositive_prompt

    When you save a PNG from ComfyUI, the workflow itself is already embedded in the file's metadata - but values are not, not reliably. If you want to know what prompt, seed, or LoRA actually produced a given image after the fact, FEExtraInfoAdd is how you force that data to ride along. You give it a value and a key name; when the image saves, that value lands in the PNG's extra info under your key. Later, load the file anywhere and the value is right there in the metadata.

    The mechanism is neat: the node grabs ComfyUI's extra_pnginfo (the same dict the save node writes into the file) and does extra_pnginfo[your_key] = your_value. Because it's an output node, it runs whenever the graph runs, even though it has no outputs to connect. The only moving parts are the key name and the value you feed it.

    The inputs

    • save_field - the metadata key, default "positive_prompt". Rename it to describe what you're storing.
    • enter - *-typed, the value. Anything that flows through a wire, including a dict.

    Where it gets genuinely useful is combining it with the pack's data nodes. This is the intended pairing with the loader nodes' EXTRA output - the safetensors metadata (trained words, base model) that FEEncLoraLoader and FEEncLoraAutoLoader expose. Stamp that onto the PNG alongside your prompt and you've built a self-documenting image: the exact text that generated it and the LoRA that shaped it, both embedded in the file. You can also pipe a prompt string in directly - wire your positive prompt here under save_field: positive_prompt and every image you save carries its prompt with it.

    There's no output socket, which trips people up the first time. It's a side-effect node: it doesn't return anything, it just writes into the save path. If you're not seeing the value in the saved file, the usual suspects are:

    • The save node is writing PNG without extra info, or the value is a type the PNG metadata can't serialize cleanly (strings and dicts are fine; huge tensors are not).
    • You're viewing metadata with a tool that only shows the workflow chunk, not custom keys.
    • The node isn't actually in the execution path - output nodes force execution, so that's rarely it, but bypassing it disables the write.

    A small node with a very concrete payoff: "which settings made this image" stops being a guess. If you share images or come back to your own outputs weeks later, it pays for itself instantly.

    Categoryfexli/utils

    Inputs (2)

    NameTypeDefaultDescription
    save_fieldSTRINGpositive_prompt
    enter*

    Outputs (0)

    No outputs