From 3de44fc580681f785065565fbe63f46c5a872d43 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Mon, 12 Sep 2022 20:47:46 +0300 Subject: Include the model name (or the SHA256 of the file) in the metadata #271 --- modules/images.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/images.py') 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() -- cgit v1.2.1