CivArchive
    Preview 470249

    Stable Diffusion Prompt Reader

    Github Repo:
    preview badge

    https://github.com/receyuki/stable-diffusion-prompt-reader

    简体中文

    GitHub releases GitHub GitHub release (latest by date) PyPI Code style: black platform

    The SD Prompt Reader is now available as a ComfyUI node. Check out the ComfyUI Prompt Reader Node for more information.

    A simple standalone viewer for reading prompts from Stable Diffusion generated image outside the webui.

    There are many great prompt reading tools out there now, but for people like me who just want a simple tool, I built this one.

    No additional environment or command line or browser is required to run it, just open the app and drag and drop the image in.

    Features

    • Support macOS, Windows and Linux.

    • Provides both GUI and CLI

    • Simple drag and drop interaction.

    • Copy prompt to clipboard.

    • Remove prompt from image.

    • Export prompt to text file.

    • Edit or import prompt to images

    • Vertical orientation display and sorting by alphabet

    • Detect generation tool.

    • Multiple formats support.

    • Dark and light mode support.

    Supported Formats

    * Limitations apply. See format limitations.

    If you are using a tool or format that is not on this list, please help me to support your format by uploading the original file generated by your tool to the issues, thx.

    For ComfyUI users, the SD Prompt Reader is now available as a ComfyUI node. The ComfyUI Prompt Reader Node is a subproject of this project, and it is recommended to embed the Prompt Saver node in the ComfyUI Prompt Reader Node within your workflow to ensure maximum compatibility.

    Download

    For Windows users

    Download executable from above or from the GitHub Releases

    For macOS users

    Download executable from above or from GitHub Releases

    Install via Homebrew Cask

    You may also install SD Prompt Reader via Homebrew cask.

    brew install --no-quarantine receyuki/sd-prompt-reader/sd-prompt-reader

    The parameter --no-quarantine is used since the SD Prompt Reader is currently unsigned as I mentioned here

    For Linux users (not regularly tested)

    Usage

    Read prompt

    • Open the executable file (.exe or .app) and drag and drop the image into the window.

    OR

    • Right click on the image and select open with SD Prompt Reader

    OR

    • Drag and drop the image directly onto executable (.exe or .app).

    Export prompt to text file

    • Click "Export" will generate a txt file alongside the image file.

    • To save to another location, click the expand arrow and click "select directory".

      export

    Remove prompt from image

    • Click "Clear" will generate a new image file with suffix "_data_removed" alongside the original image file.

    • To save to another location, click the expand arrow and click "select directory".

    • To overwrite the original image file, click the expand arrow and click "overwrite the original image".

      export

    Edit image

    Please note that the edited image will be written in A1111 format, it meaning that image in any format will become A1111 format after editing.

    • Click "Edit" to enter edit mode.

    • Edit the prompt directly in the textbox or import a metadata file in txt format.

    • Click "Save" will generate a edited image file with suffix "_edited" alongside the original image file.

    • To save to another location, click the expand arrow and click "select directory".

    • To overwrite the original image file, click the expand arrow and click "overwrite the original image".

      save

    Copy as single line prompt

    Copy image prompt and setting in a format that can be read by Prompts from file or textbox

    Supported parameters

    • Click the expand arrow and click "single line prompt".

    • Paste it into the textbox below the webui script "Prompts from file or textbox".
      single line prompt

    ComfyUI SDXL workflow

    The SDXL workflow does not support editing. If necessary, please remove prompts from image before edit.
    If the image's workflow includes multiple sets of SDXL prompts, namely Clip G(text_g), Clip L(text_l), and Refiner, the SD Prompt Reader will switch to the multi-set prompt display mode as shown in the image below. There are two interface options available for the multi-set prompt display mode, and you can switch between them using buttons.
    comfyui_sdxl.png

    CLI

    Format Limitations

    TXT

    1. Importing txt file is only allowed in edit mode.

    2. Only A1111 format txt files are supported. You can use txt files generated by the A1111 webui or use the SD prompt reader to export txt from A1111 images

    StableSwarmUI

    StableSwarmUI is still in the Alpha testing phase, and its format may change in the future. I will keep track of upcoming updates of StableSwarmUI.

    ComfyUI

    1. If there are multiple sets of data (seed, steps, CFG, etc.) in the setting box, this means that there are multiple KSampler nodes in the flowchart.

    2. Due to the nature of ComfyUI, all nodes and flowcharts in the workflow are stored in the image, including those that are not being used. Also, a flowchart can have multiple branches, inputs and outputs.
      (e.g. output hires. fixed image and original image simultaneously in a single flowchart)
      SD Prompt Reader will traverse all flowcharts and branches and display the longest branch with complete input and output.

    3. ComfyUI SDXL workflow

    4. When custom nodes are used or when the workflow becomes overly complex, there is a high probability that metadata may not be correctly read. This is because ComfyUI does not store metadata but only the complete workflow. It is recommended to embed the Prompt Saver node in the ComfyUI Prompt Reader Node within your workflow to ensure maximum compatibility.

    Easy Diffusion

    By default, Easy Diffusion does not write metadata to images. Please change the Metadata format in settings to embed to write the metadata to images

    Fooocus-MRE

    Since the original version of Fooocus does not support writing metadata to image files, SD Prompt Reader only supports images generated by Fooocus MoonRide Edition.

    FAQ

    Malware Alert

    The false positive reported by some anti-malwares is caused by the packaging tool pyinstaller which is a common issue for pyinstaller users. I spent a lot of time trying to fix the Windows Defender false positive before, but I couldn't do it for every antivirus software. So, you can either trust Windows Defender or use the instruction for Linux users to use this app.

    "SD Prompt Reader.app" is damaged and can't be opend. You should move it to the Trash

    This is a very common macOS issue when you run non appstore apps, and developers must pay $99 per year to Apple to eliminate this issue. You can choose to Allow Apps from Anywhere in security & privacy settings which can be dangerous. The way I prefer is to remove the quarantine attributes.

    1. Open Terminal from the Applications folder.

    2. Type in the following command and hit Enter.

      xattr -r -d com.apple.quarantine /path/to/app.app

      In my case it's

      xattr -r -d com.apple.quarantine /Applications/SD\ Prompt\ Reader.app

    If you are still concerned about the security of the app you can use the instruction for Linux users to use this app.

    TODO

    • Batch image processing tool

    • Gallery/Folder view

    • User preference

    Credits

    Description

    • Add support for more formats

    • Refactor image data reader

    • Remove AGPL code and change license to MIT

    FAQ

    Comments (16)

    MrsunshineApr 11, 2023· 1 reaction
    CivitAI

    Thank you very useful tool, great work !!!

    336907Apr 11, 2023· 1 reaction
    CivitAI

    simple and useful, great work and thanks for sharing.

    creedukApr 11, 2023· 4 reactions
    CivitAI

    Could be useful. I have been dragging them into notepad as metadata is easily found.

    Would be cool if this could also read comfyui images and extract the prompts, model etc.

    receyuki
    Author
    Apr 11, 2023· 1 reaction

    I'm also considering whether I should add support for ComfyUI, but at the moment you are the only user with this requirement. Since ComfyUI's metadata structure is not quite the same as other UI's, I will add support for ComfyUI if there are multiple users request it.

    creedukApr 11, 2023

    Sounds good :) . Maybe asking on Reddit what others would be useful, probably you would get requests for InvokeAI as well I know the prompt weighting differs although I think it might be stored the same way as 1111.

    yepeishengApr 12, 2023· 1 reaction

    ComfyUI +1

    receyuki
    Author
    Apr 24, 2023· 1 reaction

    ComfyUI support has been added. Due to the complexity of the format, there will still be some limitations. See description page for details.

    CyrilSamosaApr 11, 2023
    CivitAI

    Interesting! I'm actually building something that may be of some use to you. See https://github.com/d3x-at/sd-parsers

    receyuki
    Author
    Apr 12, 2023

    Awsome work! Your code looks much nicer than mine. But I just removed the last bit of AGPL code in order to change the repo to a MIT license. I may still choose to rebuild the wheel for my own convenience. Many thanks!

    CyrilSamosaApr 12, 2023

    @receyuki don't worry about the AGPL. I'll be putting that library on PyPi soon (when it's somewhat stable). Edit: as i was somewhat in the same situation, the code is now cleaned of anything forcing a license.

    MinagiApr 12, 2023
    CivitAI

    thank you this is a great software,very useful,and i always have an idea that if there would be a software could manage pictures generated from AI ,and i can search tags like "black hair",then all pics with black hair tag would come out(search inside tags,built in tags), this would be perfect if someone develop.T_T

    CyrilSamosaApr 12, 2023

    There is Breadboard. (https://github.com/cocktailpeanut/breadboard)

    I think it does what you said you wanted.

    receyuki
    Author
    Apr 12, 2023

    Diffusion Toolkit (https://github.com/RupertAvery/DiffusionToolkit) will work for you if ur using windows. I want to keep my app simple so I probably won't add similar functionality.

    lx652060211Apr 12, 2023· 1 reaction
    CivitAI

    cool tool!good job

    SenaaApr 12, 2023· 1 reaction
    CivitAI

    It's better than I drag n drop it to Notepad, hahaha.
    Thank you (〃 ̄︶ ̄)人( ̄︶ ̄〃)

    MirabilisApr 12, 2023· 1 reaction
    CivitAI

    Outstanding work

    Other
    Other

    Details

    Downloads
    413
    Platform
    CivitAI
    Platform Status
    Available
    Created
    4/11/2023
    Updated
    5/13/2026
    Deleted
    -

    Files

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.