diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-23 19:49:21 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-23 19:49:21 +0000 |
commit | 39ce23f42d9b63eff39c50a0d069a442e6416cf5 (patch) | |
tree | bf245801f544389aece3319b381232a697203e42 /modules/extras.py | |
parent | 9c92a1a9aa8f4c54f6e05a655883143fec917f67 (diff) | |
download | stable-diffusion-webui-gfx803-39ce23f42d9b63eff39c50a0d069a442e6416cf5.tar.gz stable-diffusion-webui-gfx803-39ce23f42d9b63eff39c50a0d069a442e6416cf5.tar.bz2 stable-diffusion-webui-gfx803-39ce23f42d9b63eff39c50a0d069a442e6416cf5.zip |
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.py | 6 |
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
|