Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shenjinti/pnginfo
Stable Diffusion prompts extractor for golang
https://github.com/shenjinti/pnginfo
pnginfo prompt-toolkit stable-diffusion stable-diffusion-webui
Last synced: 2 days ago
JSON representation
Stable Diffusion prompts extractor for golang
- Host: GitHub
- URL: https://github.com/shenjinti/pnginfo
- Owner: shenjinti
- License: bsd-3-clause
- Created: 2023-11-05T03:09:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-05T03:42:56.000Z (about 1 year ago)
- Last Synced: 2024-11-10T17:11:51.861Z (2 months ago)
- Topics: pnginfo, prompt-toolkit, stable-diffusion, stable-diffusion-webui
- Language: Go
- Homepage:
- Size: 1.24 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Extract Stable Diffusion Prompts from a png file
=====## Usage
```shell
go get -u github.com/shhenjinti/pnginfo
```## Example
Quick example, see [cmd/main.go](cmd/main.go)
```go
package mainimport (
"fmt"
"os""github.com/shenjinti/pnginfo"
)func main() {
if os.Args == nil || len(os.Args) != 2 {
panic("expected one argument")
}for _, arg := range os.Args[1:] {
info, err := pnginfo.ReadPNGInfoFromFile(arg)
if err != nil {
fmt.Println(arg, err)
continue
}
fmt.Println("Extract", arg)
fmt.Println("\tWidth:", info.Width)
fmt.Println("\tHeight:", info.Height)
fmt.Println("\tModel:", info.Model)
fmt.Println("\tLora:", info.Lora)
fmt.Println("\tModelHash:", info.ModelHash)
fmt.Println("\tVersion:", info.Version)
fmt.Println("\tPrompt:", info.Prompt)
fmt.Println("\tNegativePrompt:", info.NegativePrompt)
fmt.Println("\tSeed:", info.Seed)
fmt.Println("\tSampler:", info.Sampler)
fmt.Println("\tSteps:", info.Steps)
fmt.Println("\tCFGscale:", info.CFGscale)
fmt.Println("\tSize:", info.Size)
fmt.Println("\tParameters:", info.Parameters)
}
}
```