Skip to content

Commit 488f831

Browse files
Merge pull request #5012 from Nandaka/master
Support NAI style exif in PNG Info for Send... buttons
2 parents 9ec0a41 + 904121f commit 488f831

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

modules/extras.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,20 @@ def run_pnginfo(image):
234234

235235
geninfo = items.get('parameters', geninfo)
236236

237+
# nai prompt
238+
if "Software" in items.keys() and items["Software"] == "NovelAI":
239+
import json
240+
json_info = json.loads(items["Comment"])
241+
geninfo = f'{items["Description"]}\r\nNegative prompt: {json_info["uc"]}\r\n'
242+
sampler = "Euler a"
243+
if json_info["sampler"] == "k_euler_ancestral":
244+
sampler = "Euler a"
245+
elif json_info["sampler"] == "k_euler":
246+
sampler = "Euler"
247+
model_hash = '925997e9' # assuming this is the correct model hash
248+
# not sure with noise and strength parameter
249+
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"]}'
250+
237251
info = ''
238252
for key, text in items.items():
239253
info += f"""

0 commit comments

Comments
 (0)