Skip to content

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.

License

Notifications You must be signed in to change notification settings

HsienChing/PngInfo_To_Txt_ForMultiplePng_StableDiffusionWebui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Png Info to txt file for multiple png files generated by Stable Diffusion Webui

About the project

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.

Jupyter Notebook Python

License: MIT Contributor Covenant

Purpose

  1. Extract the Positive prompt value, Negative prompt value, width, and height from the png files generated by Stable Diffusion Webui.
  2. Format the Positive prompt value, Negative prompt value, width, and height for using in "Prompts from file or textbox" of Stable Diffusion Webui.
  3. Output the formatted text in the *.txt file.
  4. Batch process the above steps.

Usage 1:

  1. Put the *.ipynb file in the target folder (where you run the *.ipynb file).
  2. Create a folder named PNG files under the target folder.
  3. Put the target png files in the folder PNG files.
  4. Run all cells in the *.ipynb file. Or use the hot key Shift + Enter to run the program, since just only one cell in the program.
  5. 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.

Usage 2:

Modify the paths of the input and output folder by yourself. It's convenient for specific users.

Suitable version of Stable Diffusion Webui

v1.7.0 (tested on Mar. 09 2024)

About Stable Diffusion Webui

https://github.com/AUTOMATIC1111/stable-diffusion-webui

Version information

# 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

Limitation

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).

License

Distributed under the MIT License.

Contact

Author: Dr. Hsien-Ching Chung

ORCiD: https://orcid.org/0000-0001-9364-8858

Project Link: https://github.com/HsienChing/PngInfo_To_Txt_ForMultiplePng_StableDiffusionWebui

About

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.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published