aboutsummaryrefslogtreecommitdiff
path: root/modules/extras.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-23 22:49:21 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-23 22:49:21 +0300
commit39ce23f42d9b63eff39c50a0d069a442e6416cf5 (patch)
treebf245801f544389aece3319b381232a697203e42 /modules/extras.py
parent9c92a1a9aa8f4c54f6e05a655883143fec917f67 (diff)
add the bitton to paste parameters into UI for txt2img, img2img, and pnginfo tabs
fixed some [send to..] buttons to work properly with all tabs
Diffstat (limited to 'modules/extras.py')
-rw-r--r--modules/extras.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/extras.py b/modules/extras.py
index 92569cff..382ffa7d 100644
--- a/modules/extras.py
+++ b/modules/extras.py
@@ -102,6 +102,7 @@ def run_pnginfo(image):
return '', '', ''
items = image.info
+ geninfo = ''
if "exif" in image.info:
exif = piexif.load(image.info["exif"])
@@ -111,13 +112,14 @@ def run_pnginfo(image):
except ValueError:
exif_comment = exif_comment.decode('utf8', errors="ignore")
-
items['exif comment'] = exif_comment
+ geninfo = exif_comment
for field in ['jfif', 'jfif_version', 'jfif_unit', 'jfif_density', 'dpi', 'exif',
'loop', 'background', 'timestamp', 'duration']:
items.pop(field, None)
+ geninfo = items.get('parameters', geninfo)
info = ''
for key, text in items.items():
@@ -132,4 +134,4 @@ def run_pnginfo(image):
message = "Nothing found in the image."
info = f"<div><p>{message}<p></div>"
- return '', '', info
+ return '', geninfo, info