Package: sd-prompt-reader
Stable Diffusion Prompt Reader简体中文|EnglishA simple standalone viewer for reading prompt from Stable Diffusion generated image outside the webui.Features•Supported Formats•Download•Usage•FAQ•CreditsThe SD Prompt Reader is now available as a ComfyUI node. Check out
theComfyUI Prompt Reader Nodefor more information.FeaturesSupport 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 imagesVertical orientation display and sorting by alphabetDetect generation tool.Multiple formats support.Dark and light mode support.Supported FormatsPNGJPEGWEBPTXT*A1111's webUI✅✅✅✅Easy Diffusion✅✅✅StableSwarmUI*✅✅Fooocus-MRE*✅✅InvokeAI✅ComfyUI*✅NovelAI✅Draw Things✅Naifu(4chan)✅* Limitations apply. Seeformat 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.
TheComfyUI Prompt Reader Nodeis a subproject
of this project, and it is recommended to embed thePrompt Saver nodein theComfyUI Prompt Reader Nodewithin your workflow to ensure maximum compatibility.DownloadFor Windows usersDownload executable fromGitHub ReleasesFor macOS usersDownload executable fromGitHub ReleasesInstall via Homebrew CaskYou may also install SD Prompt Reader viaHomebrewcask.brewinstall--no-quarantinereceyuki/sd-prompt-reader/sd-prompt-readerThe parameter--no-quarantineis used since the SD Prompt Reader is currently unsigned as I mentionedhereFor 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.10Make 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-tkfor Debian-based distributionsYou can choose to install with pip or run it manuallyInstall with pip or pipxpipinstallsd-prompt-readerorpipxinstallsd-prompt-readerTo launch app just entersd-prompt-readerin the terminal.Run source code manuallyClone this repo.gitclonehttps://github.com/receyuki/stable-diffusion-prompt-reader.gitor download repo as a zip.CD to the directory and install dependencies.cdstable-diffusion-prompt-readerpipinstall-rrequirements.txtRun.pythonmain.pyUsageRead promptOpen the executable file (.exe or .app) and drag and drop the image into the window.ORRight click on the image and select open with SD Prompt ReaderORDrag and drop the image directly onto executable (.exe or .app).Export prompt to a text fileClick "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 imageClick "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 imagePlease 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 promptCopy image prompt and setting in a format that can be read byPrompts from file or textboxThe following parameters are supported:SettingParameterSeed--seedVariation seed strength--subseed_strengthSeed resize from--seed_resize_from_hSeed resize from--seed_resize_from_wSampler--sampler_nameSteps--stepsCFG scale--cfg_scaleSize--widthSize--heightFace restoration--restore_facesClick the expand arrow and click "single line prompt".Paste it into the textbox below the webui script "Prompts from file or textbox".ComfyUI SDXL workflowThe 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.Format LimitationsTXTImporting 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 imagesStableSwarmUIStableSwarmUI is still in the Alpha testing phase, and its format may change in the future. I will keep track of upcoming updates of StableSwarmUI.ComfyUISupport for comfyUI requires more testing. If you believe your image is not being displayed properly, please upload the original file generated by ComfyUI 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.ComfyUI SDXL workflowWhen 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 thePrompt Saver nodein theComfyUI Prompt Reader Nodewithin your workflow to ensure maximum compatibility.Easy DiffusionBy default, Easy Diffusion does not write metadata to images. Please change theMetadata formatin settings toembedto write the metadata to imagesFooocus-MRESince the original version ofFooocusdoes not support writing metadata to image files,
SD Prompt Reader only supports images generated byFooocus MoonRide Edition.FAQMalware AlertThe false positive reported by some anti-malwares is caused by the packaging toolpyinstallerwhich is a common issue forpyinstallerusers.
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 TrashThis 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 toAllow Apps from Anywhereinsecurity & privacysettings 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.appIn my case it'sxattr -r -d com.apple.quarantine /Applications/SD\ Prompt\ Reader.appIf you are still concerned about the security of the app you can use the instruction for Linux users to use this app.TODOBatch image processing toolGallery/Folder viewUser preferenceCreditsInspired byStable Diffusion web UIApp icon generated using Stable Diffusion withIconsMISpecial thanks toAzusachanfor providing SD server