aboutsummaryrefslogtreecommitdiff
path: root/modules/images.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-12 20:47:46 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-09-12 20:47:46 +0300
commit3de44fc580681f785065565fbe63f46c5a872d43 (patch)
treea986f34beb19cd399c076df98b287e2e526227a4 /modules/images.py
parent35a4649c9e0a54272bbaae7b2489d529bf3154d1 (diff)
Include the model name (or the SHA256 of the file) in the metadata #271
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/images.py b/modules/images.py
index d742ed98..a08b549a 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -9,7 +9,7 @@ from fonts.ttf import Roboto
import string
import modules.shared
-from modules import sd_samplers
+from modules import sd_samplers, shared
from modules.shared import opts
LANCZOS = (Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.LANCZOS)
@@ -278,6 +278,8 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
file_decoration = file_decoration.replace("[height]", str(p.height))
file_decoration = file_decoration.replace("[sampler]", sd_samplers.samplers[p.sampler_index].name)
+ file_decoration = file_decoration.replace("[model_hash]", shared.sd_model_hash)
+
if extension == 'png' and opts.enable_pnginfo and info is not None:
pnginfo = PngImagePlugin.PngInfo()