diff options
author | Milly <milly.ca@gmail.com> | 2022-10-05 15:59:04 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2022-10-06 17:41:23 +0000 |
commit | 405c8171d1acbb994084d98770bbcb97d01d9406 (patch) | |
tree | 078bfe622d2c2ea34057e4f5f277ce4f9e16221d /modules/images.py | |
parent | 1cc36d170ac15e7f04208df32db27af1b10c867c (diff) | |
download | stable-diffusion-webui-gfx803-405c8171d1acbb994084d98770bbcb97d01d9406.tar.gz stable-diffusion-webui-gfx803-405c8171d1acbb994084d98770bbcb97d01d9406.tar.bz2 stable-diffusion-webui-gfx803-405c8171d1acbb994084d98770bbcb97d01d9406.zip |
Prefer using `Processed.sd_model_hash` attribute when filename pattern
Diffstat (limited to 'modules/images.py')
-rw-r--r-- | modules/images.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/images.py b/modules/images.py index 669d76af..29c5ee24 100644 --- a/modules/images.py +++ b/modules/images.py @@ -295,7 +295,7 @@ def apply_filename_pattern(x, p, seed, prompt): x = x.replace("[styles]", sanitize_filename_part(", ".join([x for x in p.styles if not x == "None"]) or "None", replace_spaces=False))
x = x.replace("[sampler]", sanitize_filename_part(sd_samplers.samplers[p.sampler_index].name, replace_spaces=False))
- x = x.replace("[model_hash]", shared.sd_model.sd_model_hash)
+ x = x.replace("[model_hash]", getattr(p, "sd_model_hash", shared.sd_model.sd_model_hash))
x = x.replace("[date]", datetime.date.today().isoformat())
x = x.replace("[datetime]", datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
x = x.replace("[job_timestamp]", getattr(p, "job_timestamp", shared.state.job_timestamp))
|