Nodes/AAA Metadata System/Eric Civitai Prompt Extractor
ComfyUI Node

Eric Civitai Prompt Extractor

Pull the prompt back out of a Civitai download

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric Civitai Prompt Extractor
    • image
    • mask
    • filename
    • full_path
    • positive_prompt
    • negative_prompt
    • sampler
    • cfg
    • seed
    • clip_skip
    • resources
    • raw_exif
    • file_count
    • current_index
    image
    use_folderfalse
    folder_path
    folder_index0
    auto_incrementfalse
    write_txtfalse
    txt_directory
    exiftool_path

    You downloaded a gallery image from Civitai, and somewhere inside it is the exact prompt, negative prompt, sampler, cfg, seed, and the list of LoRAs that made it. Eric Civitai Prompt Extractor is the node that digs those out. Give it an image, and it returns the recipe as structured outputs - no typing the prompt out by eye, no third-party PNG-Info site.

    It's part of the AAA Metadata System pack, and it sits in the metadata category with a sibling, the AutoLoader version, that goes one step further and applies the LoRAs for you. This plain version is the read-and-browse tool: extract the recipe, batch-walk a folder of downloads, and export each to a .txt sidecar if you want a plain-text record.

    How it works

    Civitai-style metadata lives in the image's EXIF UserComment field - a text block (sometimes JSON) that records the generation info. This node reads that field, parses it, and splits it into structured outputs: positive/negative prompt, sampler, cfg, seed, clip_skip, and a resources string listing the LoRAs and their strengths.

    The important dependency: it uses ExifTool to read the EXIF, not Python's built-in image library. The node resolves ExifTool from the exiftool_path input or from your PATH (it also checks common Windows install locations). If ExifTool isn't installed, the node's input validation will tell you - it refuses to run with a clear message rather than silently returning garbage. Install ExifTool once (it's a single executable) and point the node at it.

    Beyond single images, it can walk a folder: flip use_folder on, give it a folder_path, and use folder_index plus auto_increment to step through files, with file_count and current_index outputs so you know where you are. write_txt dumps each recipe to a text file in txt_directory.

    Inputs and outputs that matter

    • image - the file to read (an upload dropdown of your input folder).
    • use_folder / folder_path / folder_index / auto_increment - the batch-browsing mode. Use folder mode for a whole download directory.
    • exiftool_path - where ExifTool lives, if it's not on PATH.
    • write_txt / txt_directory - optional plain-text export.

    Outputs: image and mask (so you can preview or mask the source), filename, full_path, positive_prompt, negative_prompt, sampler, cfg, seed, clip_skip, resources (the LoRA list), raw_exif (the untouched UserComment, useful when parsing gets weird), plus file_count and current_index for folder mode.

    Installing it

    Part of AAA Metadata System by Eric Hiss (GitHub: EricRollei). Via ComfyUI Manager (search "AAA Metadata System") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EricRollei/AAA_Metadata_System.git
    cd AAA_Metadata_System
    pip install -r requirements.txt
    

    Then install ExifTool separately - the pack lists it as optional, but this node really wants it. On Windows grab the binary from exiftool.org; on Linux/macOS brew install exiftool or your package manager. Restart ComfyUI after.

    Common issues

    The dominant failure is ExifTool missing or not on PATH - the node validates and refuses to proceed, so the fix is installing it and setting exiftool_path. If the extractor runs but outputs are mostly empty, the image simply wasn't saved with Civitai-style metadata (a re-save or a different uploader can strip it); the console prints a warning when the parsed result is empty, and raw_exif will show you what's actually in the field. Some older metadata is plain text, some is JSON - the parser handles both, but genuinely malformed blocks come through as raw_exif for you to eyeball. And remember: reading metadata is always legal-ish and local, but sharing someone's exact prompt+seed+LoRA recipe is a Civitai norms question, not a technical one.

    Categorymetadata

    Inputs (8)

    NameTypeDefaultDescription
    imageCOMBO1 options: example.png
    use_folderBOOLEANfalse
    folder_pathSTRING
    folder_indexINT00–10000000
    auto_incrementBOOLEANfalse
    write_txtBOOLEANfalse
    txt_directorySTRING
    exiftool_pathSTRING

    Outputs (14)

    NameTypeDescription
    imageIMAGE
    maskMASK
    filenameSTRING
    full_pathSTRING
    positive_promptSTRING
    negative_promptSTRING
    samplerSTRING
    cfgFLOAT
    seedINT
    clip_skipINT
    resourcesSTRING
    raw_exifSTRING
    file_countINT
    current_indexINT