While using Stable Diffusion Webui, I found it costs me a lot of time to copy, paste, and modified the png info into a single *.txt file. With this *.ipynb program, the png info in the png files are automatically gathered and formated into a single *.txt file for using in "Prompts from file or textbox" of txt2img in Stable Diffusion Webui.
In this very beginning version, Positive prompt
, Negative prompt
, Width
, and Height
are formatted and written to the "*.txt" file.
- Extract the
Positive prompt value
,Negative prompt value
,width
, andheight
from the png files generated by Stable Diffusion Webui. - Format the
Positive prompt value
,Negative prompt value
,width
, andheight
for using in "Prompts from file or textbox" of Stable Diffusion Webui. - Output the formatted text in the
*.txt
file. - Batch process the above steps.
- Put the
*.ipynb
file in the target folder (where you run the*.ipynb
file). - Create a folder named
PNG files
under the target folder. - Put the target png files in the folder
PNG files
. - Run all cells in the
*.ipynb
file. Or use the hot keyShift + Enter
to run the program, since just only one cell in the program. - A file named
png_info_collection.txt
will be created in the target folder after the process. It can be used in "Prompts from file or textbox" of Stable Diffusion Webui.
Modify the paths of the input and output folder by yourself. It's convenient for specific users.
v1.7.0 (tested on Mar. 09 2024)
https://github.com/AUTOMATIC1111/stable-diffusion-webui
# | Source file | Date |
---|---|---|
4 | PngInfo_To_Txt_ForMultiplePng_v04.ipynb | 2024-04-08 |
3 | PngInfo_To_Txt_ForMultiplePng_v03.ipynb | 2024-03-09 |
2 | PngInfo_To_Txt_ForMultiplePng_v02.ipynb | 2024-02-06 |
1 | PngInfo_To_Txt_ForMultiplePng_v01.ipynb | 2024-02-06 |
Since the positive and negative prompts are enclosed by the symbol "
, if you make a typo "
in the positive and negative prompts, you will get wrong prompts and unexpected results.
For example: If you type (masterpiece: 1.2) as (masterpiece" 1.2).
Distributed under the MIT License.
Author: Dr. Hsien-Ching Chung
ORCiD: https://orcid.org/0000-0001-9364-8858
Project Link: https://github.com/HsienChing/PngInfo_To_Txt_ForMultiplePng_StableDiffusionWebui