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
This commit is contained in:
AUTOMATIC
2022-09-23 22:49:21 +03:00
parent 9c92a1a9aa
commit 39ce23f42d
6 changed files with 236 additions and 40 deletions

View File

@@ -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