aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-27 15:57:50 +0300
committerGitHub <noreply@github.com>2022-11-27 15:57:50 +0300
commit488f831d528f538f8c6a801e91d80c5e2ee05cf1 (patch)
treed56d013c57c4d60b00a649be03ffe69b01d165b9
parent9ec0a41a5851a12ce289d4e2b1565d2dfbe16585 (diff)
parent904121fecc0a1f11db76a73ca8649fb21e05ac5b (diff)
Merge pull request #5012 from Nandaka/master
Support NAI style exif in PNG Info for Send... buttons
-rw-r--r--modules/extras.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/extras.py b/modules/extras.py
index 3d65d90a..0057bf9c 100644
--- a/modules/extras.py
+++ b/modules/extras.py
@@ -234,6 +234,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\nNegative 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"""