ComfyUI Node

Image Reader

Load an Image and Get Back Its Whole Recipe, Not Just Pixels

By kinorax·Created 5 months ago·Updated about a month ago· 2
Image Reader
    • image
    • mask
    • image_info
    • infotext(raw)
    • file_stem
    • caption
    • image_reference
    image

    Most of the internet's Stable Diffusion images from the SD1.5 and SDXL era carry their generation recipe in an "A1111 infotext" - a block of text embedded in the file's EXIF metadata with the prompt, sampler, steps, CFG, model name and LoRA tags. The core LoadImage node reads pixels and cheerfully ignores all of that. IPT-ImageReader from the Info-Prompt-Toolkit pack is the version that actually cares.

    It loads an image the way you'd expect, but it also parses that metadata back into an image_info object - the pack's portable bundle of generation settings - plus a raw infotext string, a same-name .txt caption if one exists, and a file reference you can hand to other nodes. If your whole workflow philosophy is "save the recipe, reuse the recipe," this is the front door.

    How it works

    When you pick a file, it opens it, extracts the A1111 infotext via EXIF, and reconstructs image_info from it. It also reads a <filename>.txt caption sitting next to the image if there is one, and it handles multi-frame images (GIFs, animated WebP) frame by frame. The output image_reference is a pointer to the actual file on disk - which matters because the pack's Referenced Image Saver can copy that file and rewrite its metadata without re-encoding.

    There's a nice touch for inpainting workflows: if the image is a clipspace "painted-masked" file (the thing ComfyUI's built-in mask editor produces), it tries to inherit the source image's metadata, since the mask overlay file itself carries none.

    The right-click menu is the real feature

    Right-click the node and pick Check Referenced Models.... It parses every Model / Refiner / Detailer / CLIP / VAE / LoRA entry out of the infotext and shows whether each one is Present or Missing in your local models folders, with a jump to View Model Info... for details. That alone is worth it: instead of loading an image, squinting at the prompt, and guessing whether you still have that LoRA, you get a checklist.

    Outputs that matter

    • image / mask - the pixels, as usual.
    • image_info - the reconstructed settings bundle. Wire this into Image Info Context, Image Info Defaults, or straight into a saver to reproduce the generation.
    • infotext(raw) - the untouched metadata string, useful if you want to feed it to Infotext To Image Info for re-parsing or to a debug node.
    • file_stem - filename without extension, for naming outputs.
    • caption - the .txt caption if present (empty string if not).
    • image_reference - the file pointer for Referenced Image Saver.

    Installing it

    Same as every node in this pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kinorax/comfyui-info-prompt-toolkit.git
    cd comfyui-info-prompt-toolkit
    pip install -r requirements.txt
    

    Then restart ComfyUI, or install "ComfyUI-Info-Prompt-Toolkit" via ComfyUI Manager. Needs ComfyUI 0.17.0+. No model files required for this node - the heavy downloads in this pack are for SAM3 and the taggers, not for reading images.

    Common issues

    The metadata is only as good as the file you load. An image saved by plain Save Image with no metadata comes back with a mostly-empty image_info, and nothing this node does will invent it. And note that "A1111 infotext" and ComfyUI's own workflow-PNG-embedding are different things - this reads the text-parameter style metadata, the Civitai-showcase format, not ComfyUI's embedded workflow graph. Load a well-saved Civitai image and you'll be pleasantly surprised at how much comes back; load a bare PNG and don't expect magic.

    Categoryimage

    Inputs (1)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png

    Outputs (7)

    NameTypeDescription
    imageIMAGE
    maskMASK
    image_infoIPT-IMAGEINFO
    infotext(raw)STRING
    file_stemSTRING
    captionSTRING
    image_referenceIPT-ImageFileRef