Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
ae74b44c
Commit
ae74b44c
authored
Jul 08, 2023
by
AUTOMATIC1111
Committed by
GitHub
Jul 08, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11596 from akx/use-read-info
postprocessing: use read_info_from_image
parents
9be8903c
5c6a33b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
modules/images.py
modules/images.py
+12
-5
modules/postprocessing.py
modules/postprocessing.py
+3
-1
No files found.
modules/images.py
View file @
ae74b44c
from
__future__
import
annotations
import
datetime
import
pytz
...
...
@@ -678,8 +680,15 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
return
fullfn
,
txt_fullfn
def
read_info_from_image
(
image
):
items
=
image
.
info
or
{}
IGNORED_INFO_KEYS
=
{
'jfif'
,
'jfif_version'
,
'jfif_unit'
,
'jfif_density'
,
'dpi'
,
'exif'
,
'loop'
,
'background'
,
'timestamp'
,
'duration'
,
'progressive'
,
'progression'
,
'icc_profile'
,
'chromaticity'
,
'photoshop'
,
}
def
read_info_from_image
(
image
:
Image
.
Image
)
->
tuple
[
str
|
None
,
dict
]:
items
=
(
image
.
info
or
{})
.
copy
()
geninfo
=
items
.
pop
(
'parameters'
,
None
)
...
...
@@ -695,9 +704,7 @@ def read_info_from_image(image):
items
[
'exif comment'
]
=
exif_comment
geninfo
=
exif_comment
for
field
in
[
'jfif'
,
'jfif_version'
,
'jfif_unit'
,
'jfif_density'
,
'dpi'
,
'exif'
,
'loop'
,
'background'
,
'timestamp'
,
'duration'
,
'progressive'
,
'progression'
,
'icc_profile'
,
'chromaticity'
]:
for
field
in
IGNORED_INFO_KEYS
:
items
.
pop
(
field
,
None
)
if
items
.
get
(
"Software"
,
None
)
==
"NovelAI"
:
...
...
modules/postprocessing.py
View file @
ae74b44c
...
...
@@ -54,7 +54,9 @@ def run_postprocessing(extras_mode, image, image_folder, input_dir, output_dir,
for
image
,
name
in
zip
(
image_data
,
image_names
):
shared
.
state
.
textinfo
=
name
existing_pnginfo
=
image
.
info
or
{}
parameters
,
existing_pnginfo
=
images
.
read_info_from_image
(
image
)
if
parameters
:
existing_pnginfo
[
"parameters"
]
=
parameters
pp
=
scripts_postprocessing
.
PostprocessedImage
(
image
.
convert
(
"RGB"
))
...
...
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