diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-11-27 12:57:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 12:57:50 +0000 |
commit | 488f831d528f538f8c6a801e91d80c5e2ee05cf1 (patch) | |
tree | d56d013c57c4d60b00a649be03ffe69b01d165b9 /modules/extras.py | |
parent | 9ec0a41a5851a12ce289d4e2b1565d2dfbe16585 (diff) | |
parent | 904121fecc0a1f11db76a73ca8649fb21e05ac5b (diff) | |
download | stable-diffusion-webui-gfx803-488f831d528f538f8c6a801e91d80c5e2ee05cf1.tar.gz stable-diffusion-webui-gfx803-488f831d528f538f8c6a801e91d80c5e2ee05cf1.tar.bz2 stable-diffusion-webui-gfx803-488f831d528f538f8c6a801e91d80c5e2ee05cf1.zip |
Merge pull request #5012 from Nandaka/master
Support NAI style exif in PNG Info for Send... buttons
Diffstat (limited to 'modules/extras.py')
-rw-r--r-- | modules/extras.py | 14 |
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"""
|