Skip to content

Commit 405c817

Browse files
MillyAUTOMATIC1111
authored andcommitted
Prefer using Processed.sd_model_hash attribute when filename pattern
1 parent 1cc36d1 commit 405c817

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def apply_filename_pattern(x, p, seed, prompt):
295295
x = x.replace("[styles]", sanitize_filename_part(", ".join([x for x in p.styles if not x == "None"]) or "None", replace_spaces=False))
296296
x = x.replace("[sampler]", sanitize_filename_part(sd_samplers.samplers[p.sampler_index].name, replace_spaces=False))
297297

298-
x = x.replace("[model_hash]", shared.sd_model.sd_model_hash)
298+
x = x.replace("[model_hash]", getattr(p, "sd_model_hash", shared.sd_model.sd_model_hash))
299299
x = x.replace("[date]", datetime.date.today().isoformat())
300300
x = x.replace("[datetime]", datetime.datetime.now().strftime("%Y%m%d%H%M%S"))
301301
x = x.replace("[job_timestamp]", getattr(p, "job_timestamp", shared.state.job_timestamp))

0 commit comments

Comments
 (0)