7.3 KiB
SD Prompt Reader Node
This project is currently in beta status. If you encounter any issues or have any suggestions, please let me know.This is a subproject of the SD Prompt Reader. It helps you extract metadata from images in any format supported by the SD Prompt Reader and saves the images with additional metadata to ensure compatibility with metadata detection on websites such as Civitai.
Supported Formats • Installation • Usage • Credits
Supported Formats
| PNG | JPEG | WEBP | TXT* | |
|---|---|---|---|---|
| A1111's webUI | ✅ | ✅ | ✅ | ✅ |
| Easy Diffusion | ✅ | ✅ | ✅ | |
| StableSwarmUI* | ✅ | ✅ | ||
| Fooocus-MRE* | ✅ | ✅ | ||
| InvokeAI | ✅ | |||
| ComfyUI* | ✅ | |||
| NovelAI | ✅ | |||
| Draw Things | ✅ | |||
| Naifu(4chan) | ✅ |
See SD Prompt Reader for details
Installation
While ZIP package is available, it is strongly recommended not to use it for installation.
Install and update via ComfyUI Manager (Recommended)
Search for SD Prompt Reader in the ComfyUI Manager and install it.
Install manually
Please make sure to install the submodules along with the main repository.
cdto thecustom_nodefolder- Clone this repo
git clone --recursive https://github.com/receyuki/comfyui-prompt-reader-node.git - Install dependencies
cd comfyui-prompt-reader-node pip install -r requirements.txt
Update
When updating, don't forget to include the submodules along with the main repository.
git pull --recurse-submodules
Usage
The following section may be outdated and could differ from the actual nodes.
Prompt Reader Node
- The Prompt Reader Node works exactly the same as the standalone SD Prompt Reader. It uses the Image Data Reader from the standalone SD Prompt Reader, allowing it to support the same formats and receive updates along with the SD Prompt Reader.
For images containing multiple sets of parameters, such as those processed through hires-fix or refiner,
you will need to modify the data_index to select the parameters you need
For images generated by SDXL and containing multiple sets of prompts, the text_g will be combined with text_l into a single prompt
Prompt Saver Node & Parameter Generator Node
- The Prompt Saver Node and The Parameter Generator Node are designed to be used together.
- The Prompt Saver Node will write additional metadata in the A1111 format to the output images to be compatible with any tools that support the A1111 format, including SD Prompt Reader and Civitai. Due to custom nodes and complex workflows potentially causing issues with SD Prompt Reader's ability to read image metadata correctly, it is recommended to embed this node within the workflow to ensure maximum compatibility.
- Since it's not possible to directly extract metadata from KSampler, it is necessary to use the Parameter Generator Node to generate parameters and simultaneously output them to both the Prompt Saver Node and KSampler.
Prompt Merger Node & Type Converter Node
- Since the A1111 format cannot store
text_gandtext_lseparately, SDXL users need to use the Prompt Merger Node to combinetext_gandtext_linto a single prompt. - In some cases, inputs like
model_name,sampler_name, andschedulermay conflict with other custom nodes. You can use the SD Type Converter to convert them intoSTRINGtype and then input them intomodel_name_str,sampler_name_str, andscheduler_str. Please note that inputs of typeSTRINGhave higher priority, so do not connectSTRINGinputs unless necessary, as the Prompt Saver will prioritize readingSTRINGinputs over regular ones.
Example Workflow
The example workflow is outdated and will be updated in the stable release.
Credits
- The SD Prompt Reader node is based on ComfyUI Load Image With Metadata
- The SD Prompt Saver node is based on Comfy Image Saver & Stable Diffusion Webui
- The seed generator in the SD Parameter Generator is modified from rgthree's Comfy Nodes
- A special thanks to @alessandroperilli and his AP Workflow for providing numerous suggestions



