Nodes/ComfyUi-Load-Image-And-Display-Prompt-Metadata/Load Image And Display Prompt Metadata
ComfyUI Node

Load Image And Display Prompt Metadata

That ComfyUI PNG Hides Its Prompt — This Node Hands It Over

By BigStationW·Created about a year ago·Updated 8 months ago· 25
Load Image And Display Prompt Metadata
    • IMAGE
    • MASK
    • positive_prompt
    • negative_prompt
    image
    positive_prompt
    negative_prompt

    The prompt is in the file. This node just takes it out

    You've got an image someone generated in ComfyUI, and you want to know exactly what prompt made it. The obvious move - dragging the PNG onto the canvas - loads the whole workflow with it, which then whines about missing custom nodes, and suddenly you're 20 minutes into a dependency hunt. LoadImageX skips all of that. It's the ordinary Load Image node with one party trick: it reads the prompt that's already baked into the file and hands it to you as plain text.

    Here's why that works. ComfyUI's whole sharing culture runs on embedding: every output image carries its generation workflow as JSON tucked into the PNG's tEXt/iTXt metadata chunks. That's the "workflow included" convention - share the image, and the recipe travels with it. This node is a small, honest utility that digs out just the positive and negative prompt from that embedded JSON. Use it in img2img, when you're remixing someone's image, or when you want to audit what a stranger's PNG actually was generated with.

    How it works: a LoadImage fork with a frontend doing the real job

    The Python side is a near-copy of ComfyUI's core LoadImage node - same IMAGE tensor conversion, same EXIF orientation fix, same alpha-channel-to-MASK handling, even animated images get split into a batch. Nothing exotic, and no extra dependencies beyond what ComfyUI already ships.

    The interesting part lives in the JavaScript extension. When you pick or upload an image, the frontend fetches the raw file, walks the PNG chunks looking for a prompt metadata chunk, and then walks the workflow graph: it starts at the sampler's positive/negative/guider inputs and follows the wiring back to text. It knows the common shapes - plain CLIPTextEncode, Flux's CLIPTextEncodeFlux and BasicGuider, ConditioningCombine, WAS Suite's Text Concatenate and Text Multiline, ImpactWildcardProcessor, String Literal, even primitive nodes. Whatever it finds gets written into the node's two text widgets, which then flow straight out as outputs. If the workflow was Flux-shaped, the negative usually comes from the prompt data and the positive can also be pulled from the embedded workflow chunk if there's a Display Any (rgthree) node holding it.

    The inputs and outputs that matter

    Only three fields exist, and you really only set one:

    • image - the dropdown of everything in your ComfyUI/input folder, plus an upload button. This is the one you touch.
    • positive_prompt / negative_prompt - multiline STRING, default empty. These get auto-filled by the frontend, and whatever they contain is what the node outputs. You can edit them like any text widget.

    Outputs: IMAGE, MASK (from the alpha channel, inverted like core LoadImage), positive_prompt, negative_prompt (STRING). Wire the prompt strings into a fresh CLIPTextEncode, or feed the IMAGE straight into img2img.

    Install and finding it

    The README's path is simple:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BigStationW/ComfyUi-Load-Image-And-Display-Prompt-Metadata
    

    Then restart ComfyUI. It's also registered for ComfyUI Manager - search "Load Image And Display Prompt Metadata" or "BigStationW" - but the README only documents the clone, and there are no model downloads or heavy pip requirements either way.

    To place it: double-click empty canvas space and type "Load Image And Display Prompt Metadata". Don't go hunting through the menu categories - the author left the category as literally testt, a placeholder that never got renamed. Search by name.

    Where people get burned

    • Prompts don't appear. Almost always because the image has no embedded metadata left. Reposted, re-saved, or screenshot images get it stripped, and this node is not magic - it parses raw text that's in the file; if it isn't there, it isn't there. It only reads ComfyUI's prompt chunk, so A1111 images (which use a parameters chunk) won't populate either.
    • It only parses PNG. The upload dialog happily accepts JPEG and WebP, but the metadata reader bails on anything without a PNG signature - so you'll get no prompts from those.
    • Author's own caveat. On launch the author admitted it "won't work with every settings at the moment" - and one early user reported blank prompts until they updated ComfyUI. If you're on an old version, update before debugging your image.

    Honest verdict: it's a modest one-trick node, not a revolution. If you already run Crystools, its "Load image with metadata" node overlaps with this. But as a drop-in LoadImage that also recovers the recipe from a PNG, it's the thing I'd grab for img2img remixing.

    Categorytestt

    Inputs (3)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    positive_promptoptSTRING
    negative_promptoptSTRING

    Outputs (4)

    NameTypeDescription
    IMAGEIMAGE
    MASKMASK
    positive_promptSTRING
    negative_promptSTRING