A simple standalone viewer for reading prompt from Stable Diffusion generated image outside the webui.
Project description
Stable Diffusion Prompt Reader
A simple standalone viewer for reading prompt from Stable Diffusion generated image outside the webui.
Features • Supported Formats • Download • Usage • FAQ • Credits
Features
- Support macOS, Windows and Linux.
- 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
PNG | JPEG | WEBP | TXT* | |
---|---|---|---|---|
A1111's webUI | ✅ | ✅ | ✅ | ✅ |
Easy Diffusion | ✅ | ✅ | ✅ | |
InvokeAI | ✅ | |||
NovelAI | ✅ | |||
Draw Things | ✅ | |||
ComfyUI* | ✅ | |||
Naifu(4chan) | ✅ |
* 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 as a zip file to the issues, thx.
Download
For Windows users
Download executable from GitHub Releases
For macOS users
Download executable 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)
I'm pretty sure linux users can figure things out without an executable.
- The minimum version of Python required is 3.10
- Make sure you have the tkinter package installed in your Python.
If not, install the python3-tk package with package managers.
e.g.sudo apt-get install python3-tk
for Debian-based distributions
You can choose to install with pip or run it manually
Install with pip or pipx
pip install sd-prompt-reader
or
pipx install sd-prompt-reader
To launch app just enter sd-prompt-reader
in the terminal.
Run source code manually
- Clone this repo.
git clone https://github.com/receyuki/stable-diffusion-prompt-reader.git
or download repo as a zip. - CD to the directory and install dependencies.
cd stable-diffusion-prompt-reader pip install -r requirements.txt
- Run.
python main.py
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 a 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".
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".
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".
Copy as single line prompt
Copy image prompt and setting in a format that can be read by Prompts from file or textbox The following parameters are supported:
Setting | Parameter |
---|---|
Seed | --seed |
Variation seed strength | --subseed_strength |
Seed resize from | --seed_resize_from_h |
Seed resize from | --seed_resize_from_w |
Sampler | --sampler_name |
Steps | --steps |
CFG scale | --cfg_scale |
Size | --width |
Size | --height |
Face restoration | --restore_faces |
- Click the expand arrow and click "single line prompt".
- Paste it into the textbox below the webui script "Prompts from file or textbox".
Format Limitations
TXT
- Importing txt file is only allowed in edit mode.
- 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
ComfyUI
Support for comfyUI requires more testing. If you believe your image is not being displayed properly, please upload the original file generated by ComfyUI as a zip file to the issues.
- 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.
- 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.
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
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 opened. You should move it to the Trash
This is a very common macOS issue when you run unsigned 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.
-
Open Terminal from the Applications folder.
-
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
Credits
- Inspired by Stable Diffusion web UI
- App icon generated using Stable Diffusion with IconsMI
- Special thanks to Azusachan for providing SD server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sd_prompt_reader-1.3.2.post3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b77a8044309f751550ca6c1e2ec273594b31487d3e20f5c709b9f8a183849d |
|
MD5 | e32d545d943eede5b62bb300b8b29a55 |
|
BLAKE2b-256 | 7cbe5895db031bb8e01f2cb27488613288c0f38083800e5e07bc72f805aa1ac4 |
Hashes for sd_prompt_reader-1.3.2.post3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a241e30cde4398e85760df36967e0092d6f4d2c93b46e6cc641b69354ff9dcbb |
|
MD5 | 9afb7a9850eb933acdfc6bef6b2e8751 |
|
BLAKE2b-256 | 2e3b54562f1e3bc7965c17f29d9d1c3b67add3662223374abca4ce0a267d06b2 |