Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
904121fe
Commit
904121fe
authored
Nov 24, 2022
by
Nandaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support NAI exif for PNG Info
parent
828438b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
extras.py
modules/extras.py
+14
-0
No files found.
modules/extras.py
View file @
904121fe
...
...
@@ -233,6 +233,20 @@ def run_pnginfo(image):
geninfo
=
items
.
get
(
'parameters'
,
geninfo
)
# nai prompt
if
"Software"
in
items
.
keys
()
and
items
[
"Software"
]
==
"NovelAI"
:
import
json
json_info
=
json
.
loads
(
items
[
"Comment"
])
geninfo
=
f
'{items["Description"]}
\r\n
Negative prompt: {json_info["uc"]}
\r\n
'
sampler
=
"Euler a"
if
json_info
[
"sampler"
]
==
"k_euler_ancestral"
:
sampler
=
"Euler a"
elif
json_info
[
"sampler"
]
==
"k_euler"
:
sampler
=
"Euler"
model_hash
=
'925997e9'
# assuming this is the correct model hash
# not sure with noise and strength parameter
geninfo
+=
f
'Steps: {json_info["steps"]}, Sampler: {sampler}, CFG scale: {json_info["scale"]}, Seed: {json_info["seed"]}, Size: {image.width}x{image.height}, Model hash: {model_hash}'
# , Denoising strength: {json_info["noise"]}'
info
=
''
for
key
,
text
in
items
.
items
():
info
+=
f
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment