{"id":13617432,"url":"https://github.com/receyuki/stable-diffusion-prompt-reader","last_synced_at":"2025-05-15T16:07:15.915Z","repository":{"id":149313784,"uuid":"618503555","full_name":"receyuki/stable-diffusion-prompt-reader","owner":"receyuki","description":"A simple standalone viewer for reading prompts from Stable Diffusion generated image outside the webui.","archived":false,"fork":false,"pushed_at":"2024-05-29T20:16:12.000Z","size":76751,"stargazers_count":1167,"open_issues_count":18,"forks_count":75,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-29T09:51:11.428Z","etag":null,"topics":["ai","image-generation","macos","prompt-engineering","prompt-toolkit","python","stable-diffusion","stable-diffusion-webui","tkinter","windows"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/receyuki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-24T15:57:23.000Z","updated_at":"2025-04-25T08:20:10.000Z","dependencies_parsed_at":"2024-05-21T16:09:30.282Z","dependency_job_id":"a7a511f8-2c13-4225-85d1-b9544b4dfac0","html_url":"https://github.com/receyuki/stable-diffusion-prompt-reader","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receyuki%2Fstable-diffusion-prompt-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receyuki%2Fstable-diffusion-prompt-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receyuki%2Fstable-diffusion-prompt-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/receyuki%2Fstable-diffusion-prompt-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/receyuki","download_url":"https://codeload.github.com/receyuki/stable-diffusion-prompt-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374475,"owners_count":22060611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","image-generation","macos","prompt-engineering","prompt-toolkit","python","stable-diffusion","stable-diffusion-webui","tkinter","windows"],"created_at":"2024-08-01T20:01:41.601Z","updated_at":"2025-05-15T16:07:10.905Z","avatar_url":"https://github.com/receyuki.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg alt=\"icon\" src=\"https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/sd_prompt_reader/resources/icon-cube.png\" width=20% height=20%\u003e\n    \u003ch1\u003eStable Diffusion Prompt Reader\u003c/h1\u003e\n    \u003ca href=\"https://github.com/receyuki/stable-diffusion-prompt-reader/releases/latest\"\u003e\n        \u003cimg alt=\"GitHub releases\" src=\"https://img.shields.io/github/downloads/receyuki/stable-diffusion-prompt-reader/total\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/receyuki/stable-diffusion-prompt-reader/blob/master/LICENSE\"\u003e\n        \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/receyuki/stable-diffusion-prompt-reader\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/receyuki/stable-diffusion-prompt-reader/releases/latest\"\u003e\n        \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/receyuki/stable-diffusion-prompt-reader\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/sd-prompt-reader/\"\u003e\n        \u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/sd-prompt-reader\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/psf/black\"\u003e\n        \u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n    \u003cimg alt=\"platform\" src=\"https://img.shields.io/badge/platform-windows%20%7C%20macos%20%7C%20linux-lightgrey\"\u003e\n    \u003cbr\u003e\u003cbr\u003e\n\n[简体中文](https://github.com/receyuki/stable-diffusion-prompt-reader/blob/master/README.zh-Hans.md) | [English](https://github.com/receyuki/stable-diffusion-prompt-reader/blob/master/README.md)\n\nA simple standalone viewer for reading prompt from Stable Diffusion generated image outside the webui.\n    \u003cbr\u003e\n  \u003cp\u003e\n    \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n    \u003ca href=\"#supported-formats\"\u003eSupported Formats\u003c/a\u003e •\n    \u003ca href=\"#download\"\u003eDownload\u003c/a\u003e •\n    \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n    \u003ca href=\"#cli\"\u003eCLI\u003c/a\u003e •\n    \u003ca href=\"https://github.com/receyuki/comfyui-prompt-reader-node\"\u003eComfyUI Node\u003c/a\u003e •\n    \u003ca href=\"#faq\"\u003eFAQ\u003c/a\u003e •\n    \u003ca href=\"#credits\"\u003eCredits\u003c/a\u003e\n  \u003c/p\u003e\n    \u003cimg src=\"https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/images/screenshot_v134.png\"\u003e\n\u003c/div\u003e\n\n\u003e [!TIP]\n\u003e The SD Prompt Reader is now available as a ComfyUI node. Check out \n\u003e the [ComfyUI Prompt Reader Node](https://github.com/receyuki/comfyui-prompt-reader-node) for more information.\n\n## Features\n- Support macOS, Windows and Linux.\n- Provides both GUI and CLI\n- Simple drag and drop interaction.\n- Copy prompt to clipboard.\n- Remove prompt from image.\n- Export prompt to text file.\n- Edit or import prompt to images\n- Vertical orientation display and sorting by alphabet\n- Detect generation tool.\n- Multiple formats support.\n- Dark and light mode support.\n\n## Supported Formats\n|                                                                                        | PNG | JPEG | WEBP | TXT* |\n|----------------------------------------------------------------------------------------|:---:|:----:|:----:|:----:|\n| [A1111's webUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui)               |  ✅  |  ✅   |  ✅   |  ✅   |\n| [Easy Diffusion](https://github.com/easydiffusion/easydiffusion)                       |  ✅  |  ✅   |  ✅   |      |\n| [StableSwarmUI](https://github.com/Stability-AI/StableSwarmUI)*                        |  ✅  |  ✅   |      |      |\n| [StableSwarmUI (prior to 0.5.8-alpha)](https://github.com/Stability-AI/StableSwarmUI)* |  ✅  |  ✅   |      |      |\n| [Fooocus-MRE](https://github.com/MoonRide303/Fooocus-MRE)*                             |  ✅  |  ✅   |      |      |\n| [NovelAI (stealth pnginfo)](https://novelai.net/)                                      |  ✅  |      |  ✅   |      |\n| [NovelAI (legacy)](https://novelai.net/)                                               |  ✅  |      |      |      |\n| [InvokeAI](https://github.com/invoke-ai/InvokeAI)                                      |  ✅  |      |      |      |\n| [InvokeAI (prior to 2.3.5-post.2)](https://github.com/invoke-ai/InvokeAI)              |  ✅  |      |      |      |\n| [InvokeAI (prior to 1.15)](https://github.com/invoke-ai/InvokeAI)                      |  ✅  |      |      |      |\n| [ComfyUI](https://github.com/comfyanonymous/ComfyUI)*                                  |  ✅  |      |      |      |\n| [Draw Things](https://drawthings.ai/)                                                  |  ✅  |      |      |      |\n| Naifu(4chan)                                                                           |  ✅  |      |      |      |\n\n\\* Limitations apply. See [format limitations](#TXT).\n\n\u003e [!NOTE]\n\u003e If you are using a tool or format that is not on this list, please help me to support your format \n\u003e by uploading the original file generated by your tool to the issues, thx.\n\n\u003e [!TIP]\n\u003e For ComfyUI users, the SD Prompt Reader is now available as a ComfyUI node. \n\u003e The [ComfyUI Prompt Reader Node](https://github.com/receyuki/comfyui-prompt-reader-node) is a subproject \n\u003e of this project, and it is recommended to embed the [Prompt Saver node](https://github.com/receyuki/comfyui-prompt-reader-node#prompt-saver-node--parameter-generator-node) in the [ComfyUI Prompt Reader Node](https://github.com/receyuki/comfyui-prompt-reader-node) within your workflow to ensure maximum compatibility.\n\n## Download\n### For Windows users\nDownload executable from [GitHub Releases](https://github.com/receyuki/stable-diffusion-prompt-reader/releases/latest)\n### For macOS users\nDownload executable from [GitHub Releases](https://github.com/receyuki/stable-diffusion-prompt-reader/releases/latest)\n#### Install via Homebrew Cask\nYou may also install SD Prompt Reader via [Homebrew](http://brew.sh/) cask.  \n```bash\nbrew install --no-quarantine receyuki/sd-prompt-reader/sd-prompt-reader\n```\nThe parameter `--no-quarantine` is used since the SD Prompt Reader is currently unsigned as I mentioned [here](https://github.com/receyuki/stable-diffusion-prompt-reader#sd-prompt-readerapp-is-damaged-and-cant-be-opened-you-should-move-it-to-the-trash)\n### For Linux users (not regularly tested)\n~~I'm pretty sure linux users can figure things out without an executable.~~\n- The minimum version of Python required is 3.10\n- Make sure you have the tkinter package installed in your Python.  \nIf not, install the python3-tk package with package managers.  \ne.g. `sudo apt-get install python3-tk` for Debian-based distributions  \n\nYou can choose to install with pip or run it manually\n#### Install with pip or pipx\n```bash\npip install sd-prompt-reader\n```\nor\n```bash\npipx install sd-prompt-reader\n```\nTo launch the GUI just enter `sd-prompt-reader` in the terminal.  \nFor the CLI, please use `sd-prompt-reader-cli`.\n#### Run source code manually\n1. Clone this repo.\n    ```bash\n    git clone https://github.com/receyuki/stable-diffusion-prompt-reader.git\n    ```\n   or download repo as a zip.\n2. CD to the directory and install dependencies.\n    ```bash\n    cd stable-diffusion-prompt-reader  \n    pip install -r requirements.txt\n    ```\n3. Run.\n    ```bash\n   python -m sd_prompt_reader.app\n   ```\n\n## Usage\n### Read prompt\n- Open the executable file (.exe or .app) and drag and drop the image into the window.\n\nOR\n- Right click on the image and select open with SD Prompt Reader\n\nOR\n- Drag and drop the image directly onto executable (.exe or .app).\n\n### Export prompt to a text file\n- Click \"Export\" will generate a txt file alongside the image file.\n- To save to another location, click the expand arrow and click \"select directory\".  \n![export](https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/images/export.png)\n\n### Remove prompt from image\n- Click \"Clear\" will generate a new image file with suffix \"_data_removed\" alongside the original image file.\n- To save to another location, click the expand arrow and click \"select directory\".\n- To overwrite the original image file, click the expand arrow and click \"overwrite the original image\".  \n![remove](https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/images/remove.png)\n\n### Edit image\n\u003e [!NOTE]\n\u003e The edited image will be written in A1111 format, meaning that image in any format \n\u003e will become A1111 format after editing.\n\n- Click \"Edit\" to enter edit mode.\n- Edit the prompt directly in the textbox or import a metadata file in txt format.\n- Click \"Save\" will generate a edited image file with suffix \"_edited\" alongside the original image file.\n- To save to another location, click the expand arrow and click \"select directory\".\n- To overwrite the original image file, click the expand arrow and click \"overwrite the original image\".  \n![save](https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/images/save.png)\n\n### Copy as single line prompt\nCopy image prompt and setting in a format that can be read by [Prompts from file or textbox](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompts-from-file-or-textbox) \nThe following parameters are supported:\n\n| Setting                 | Parameter            |\n|-------------------------|----------------------|\n| Seed                    | --seed               |\n| Variation seed strength | --subseed_strength   |\n| Seed resize from        | --seed_resize_from_h |\n| Seed resize from        | --seed_resize_from_w |\n| Sampler                 | --sampler_name       |\n| Steps                   | --steps              |\n| CFG scale               | --cfg_scale          |\n| Size                    | --width              |\n| Size                    | --height             |\n| Face restoration        | --restore_faces      |\n\n- Click the expand arrow and click \"single line prompt\".\n- Paste it into the textbox below the webui script \"Prompts from file or textbox\".  \n![single line prompt](https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/images/single_line_prompt.png)\n\n### ComfyUI SDXL workflow\n\u003e [!NOTE]\n\u003e The SDXL workflow does not support editing. \n\u003e If necessary, please remove prompts from image before edit. \n\nIf the image's workflow includes multiple sets of SDXL prompts, \nnamely 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. \nThere are two interface options available for the multi-set prompt display mode, and you can switch between them using buttons.  \n![comfyui_sdxl.png](https://github.com/receyuki/stable-diffusion-prompt-reader/raw/master/images/comfyui_sdxl.png)\n\n## CLI\nA CLI tool for reading, modifying, and clearing metadata is provided. \n### Platforms\n#### For Windows users\n`SD Prompt Reader CLI.exe` will be placed in the zip package as a separate executable.   \nExamples:\n`\"SD Prompt Reader CLI.exe\" -i example.png`  \n#### For macOS users\nThe executable is located at `SD Prompt Reader.app/Contents/MacOS/SD Prompt Reader`.  \nExamples:\n`/Applications/SD\\ Prompt\\ Reader.app/Contents/MacOS/SD\\ Prompt\\ Reader -i example.png`  \n#### For pip users\nExamples:\n`sd-prompt-reader-cli -i example.png`\n### Modes and Options\n#### Modes\n- Read Mode: Activated by `-r` or `--read` flag.\n- Write Mode: Activated by `-w` or `--write` flag.\n- Clear Mode: Activated by `-c` or `--clear` flag.\n#### General Options\n- `-i`, `--input-path`: Path to the input image file or directory containing image files, required parameter.\n- `-o`, `--output-path`: Path to the output file or directory where the processed files will be saved.\n- `-l`, `--log-level`: Specify the log verbosity level (e.g.DEBUG, INFO, WARN, ERROR).\n#### Read Options\n- `-f`, `--format-type`: Specifies the output metadata format, choices are \"TXT\" or \"JSON\". Default format is \"TXT\"\n#### Write Options\n- `-m`, `--metadata`: Provides a metadata file for writing.\n- `-p`, `--positive`: Provides a positive prompt string for writing.\n- `-n`, `--negative`: Provides a negative prompt string for writing.\n- `-s`, `--setting`: Provides a setting string for writing.\n### Basic Usage\n- If no output path is specified, the modified image will be saved in the current directory \nwith a suffix added to the original filename.  \n- To overwrite the source file, set the output path equal to the input path.\n- The write mode only supports modifications to a single image.\n#### Read Mode\n- Read metadata from an image.\n- Usage:  \n`sd-prompt-reader-cli [-r] -i \u003cinput_path\u003e [--format-type \u003cformat\u003e] [-o \u003coutput_path\u003e]`\n- Examples:  \n`sd-prompt-reader-cli -i example.png`  \n`sd-prompt-reader-cli -i example.png -o metadata.txt`  \n`sd-prompt-reader-cli -r -i example.png -f TXT -o output_folder/`  \n`sd-prompt-reader-cli -r -i input_folder/ -f JSON -o output_folder/`\n#### Write Mode\n- Write metadata to an image.\n- Usage:  \n`sd-prompt-reader-cli -w -i \u003cinput_path\u003e -m \u003cmetadata_path\u003e [-o \u003coutput_path\u003e]`\n- Examples:  \n`sd-prompt-reader-cli -w -i example.png -m new_metadata.txt`  \n`sd-prompt-reader-cli -w -i example.png -m new_metadata.txt -o output.png`  \n`sd-prompt-reader-cli -w -i example.png -m new_metadata.json -o output_folder/`\n#### Clear Mode\n- Remove all metadata from an image.\n- Usage:  \n`sd-prompt-reader-cli -c -i \u003cinput_path\u003e [-o \u003coutput_path\u003e]`\n- Examples:  \n`sd-prompt-reader-cli -c -i example.png`  \n`sd-prompt-reader-cli -c -i example.png -o output.png`  \n`sd-prompt-reader-cli -c -i example.png -o output_folder/`  \n`sd-prompt-reader-cli -c -i input_folder/ -o output_folder/`\n\n\n## Format Limitations\n### TXT\n1. Importing txt file is only allowed in edit mode.\n2. 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\n### StableSwarmUI\n\u003e [!IMPORTANT]\n\u003e 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.\n### ComfyUI\n\u003e [!IMPORTANT]\n\u003e When custom nodes are used or when the workflow becomes overly complex, there is a high probability that metadata may not be correctly read. \n\u003e This is because ComfyUI does not store metadata but only the complete workflow. SD Prompt Reader can only handle basic workflows.\n\u003e It is recommended to embed the [Prompt Saver node](https://github.com/receyuki/comfyui-prompt-reader-node#prompt-saver-node--parameter-generator-node) in the [ComfyUI Prompt Reader Node](https://github.com/receyuki/comfyui-prompt-reader-node) within your workflow to ensure maximum compatibility.\n\n1. 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.\n2. 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.\n(e.g. output hires. fixed image and original image simultaneously in a single flowchart)\nSD Prompt Reader will traverse all flowcharts and branches and display the longest branch with complete input and output.  \n3. [ComfyUI SDXL workflow](https://github.com/receyuki/stable-diffusion-prompt-reader#comfyui-sdxl-workflow)\n### Easy Diffusion\nBy default, Easy Diffusion does not write metadata to images. Please change the _Metadata format_ in settings to _embed_ to write the metadata to images\n### Fooocus-MRE\nSince the original version of [Fooocus](https://github.com/lllyasviel/Fooocus) does not support writing metadata to image files, \nSD Prompt Reader only supports images generated by [Fooocus MoonRide Edition](https://github.com/MoonRide303/Fooocus-MRE).\n\n## FAQ\n### Malware Alert\n\u003e [!WARNING]\n\u003e The false positive reported by some anti-malwares is caused by the packaging tool _pyinstaller_ which is a common issue for _pyinstaller_ users. \n\u003e 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. \n\u003e So, you can either trust Windows Defender or use the instruction for Linux users to use this app.\n### \"SD Prompt Reader.app\" is damaged and can't be opened. You should move it to the Trash\n\u003e [!IMPORTANT]\n\u003e This is a very common macOS issue when you run unsigned non-appstore apps, \n\u003e and developers must pay $99 per year to Apple to eliminate this issue. \n\u003e You can choose to **Allow Apps from Anywhere** in **security \u0026 privacy** settings which can be dangerous. \n\u003e The way I prefer is to remove the quarantine attributes. \n1. Open Terminal from the Applications folder. \n2. Type in the following command and hit Enter. \n\n    `xattr -r -d com.apple.quarantine /path/to/app.app`\n\n    In my case it's\n\n    `xattr -r -d com.apple.quarantine /Applications/SD\\ Prompt\\ Reader.app`\n\nIf you are still concerned about the security of the app you can use the instruction for Linux users to use this app.\n\n## TODO\n- Batch image processing tool\n- Gallery/Folder view\n- User preference\n\n## Credits\n- Inspired by [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui/)\n- App icon generated using Stable Diffusion with [IconsMI](https://huggingface.co/jvkape/IconsMI-AppIconsModelforSD)\n- Special thanks to [Azusachan](https://github.com/Azusachan) for providing SD server\n- The NovelAI stealth pnginfo parser is based on [the official metadata extraction script of NovelAI](https://github.com/NovelAI/novelai-image-metadata)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freceyuki%2Fstable-diffusion-prompt-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freceyuki%2Fstable-diffusion-prompt-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freceyuki%2Fstable-diffusion-prompt-reader/lists"}