Skip to content

Commit 904121f

Browse files
committed
Support NAI exif for PNG Info
1 parent 828438b commit 904121f

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
@@ -233,6 +233,20 @@ def run_pnginfo(image):
233233

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

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

0 commit comments

Comments
 (0)