diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-12 17:47:46 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-12 17:47:46 +0000 |
commit | 3de44fc580681f785065565fbe63f46c5a872d43 (patch) | |
tree | a986f34beb19cd399c076df98b287e2e526227a4 /modules/images.py | |
parent | 35a4649c9e0a54272bbaae7b2489d529bf3154d1 (diff) | |
download | stable-diffusion-webui-gfx803-3de44fc580681f785065565fbe63f46c5a872d43.tar.gz stable-diffusion-webui-gfx803-3de44fc580681f785065565fbe63f46c5a872d43.tar.bz2 stable-diffusion-webui-gfx803-3de44fc580681f785065565fbe63f46c5a872d43.zip |
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.py | 4 |
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()
|