ComfyUI Node

Read_Prompt

Load an image and its old A1111 settings in one go

By 438443467·Created 2 years ago·Updated about a year ago· 27
Read_Prompt
    • image
    • positive
    • negative
    • seed
    • steps
    • cfg
    • width
    • height
    verbose
    image_path

    This node is called "Image Load with Metadata" in the code, but ComfyUI shows it as Read_Prompt - and the display name is the honest one. It loads an image from a file path and, in the same breath, digs the generation settings out of the file's metadata: positive and negative prompts, seed, steps, CFG, and dimensions. Handy when you've got a folder of images generated in A1111 (or any tool that writes A1111-style metadata) and you want to rebuild or tweak them in ComfyUI without retyping the prompt.

    How it works

    Give it an absolute image_path to a PNG, JPG, or WebP. It opens the file, converts to an RGB tensor for the image output, then hunts for the parameter string embedded in the file:

    • PNG - reads the parameters text chunk, which is the A1111 convention.
    • JPG / WebP - tries the EXIF UserComment first, then falls back to the image comment.

    Then it regex-splits the parameter block into keys like Positive prompt:, Negative prompt:, Steps:, Seed:, CFG scale:, Size: and routes each value to its own output. Missing values get sensible defaults - seed -1, steps 20, cfg 8.0, dimensions 512×512 - rather than crashing, which is kind of you when half your folder is legacy files.

    Inputs and outputs

    Two inputs only: image_path (the file) and verbose (true/false), which prints the parsed parameter block to your console for eyeballing.

    Outputs, in order: image, positive, negative, seed, steps, cfg, width, height. Wire positive/negative straight into a CLIP text encoder and seed, steps, cfg, width, height into a KSampler to reproduce the original generation settings.

    Where it won't help you

    It's built for A1111-style metadata, not ComfyUI's native format. ComfyUI embeds its workflow in PNG prompt/workflow chunks, which this node doesn't read - drag in a ComfyUI output and you'll get empty prompt strings and defaults. There's a small legacy branch for JPEG comment chunks written by other tools, but don't count on it. Also worth knowing: this node reads a path, not a ComfyUI image - no IMAGE input on the left. And like all the "Sanmi Simple Nodes," it was cut from the pack in the April 2025 rewrite, so a fresh clone of the repo won't have it; the code lives in the older Load_Image_Batch.py in git history.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/438443467/ComfyUI-GPT4V-Image-Captioner
    

    Restart ComfyUI, then it'll be under Sanmi Simple Nodes → Simple NODE (when present). No models to download. If your main goal is pulling prompts out of your own ComfyUI images, a node that reads the native workflow chunk will serve you better than this one.

    CategorySanmi Simple Nodes/Simple NODE

    Inputs (2)

    NameTypeDefaultDescription
    verboseCOMBO2 options: true, false
    image_pathSTRING

    Outputs (8)

    NameTypeDescription
    imageIMAGE
    positiveSTRING
    negativeSTRING
    seedINT
    stepsINT
    cfgFLOAT
    widthINT
    heightINT