aboutsummaryrefslogtreecommitdiff
path: root/modules/images.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-27 13:58:34 +0300
committerGitHub <noreply@github.com>2022-11-27 13:58:34 +0300
commitca8c764af82fc1fb06910e7c1c87c52f6407be62 (patch)
treebd851856b135841b6e59e7f83269dc824b92f74f /modules/images.py
parent8de897b3daf4cf8ca928546e052c2e2f38ad6e01 (diff)
parentffcbbcf385eb847ced957510ab726291a8b20207 (diff)
Merge pull request #4986 from mcmonkey4eva/add-model-name
add model_name pattern for saving
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/images.py b/modules/images.py
index 8737ccff..b968d6a6 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -305,6 +305,7 @@ class FilenameGenerator:
'styles': lambda self: self.p and sanitize_filename_part(", ".join([style for style in self.p.styles if not style == "None"]) or "None", replace_spaces=False),
'sampler': lambda self: self.p and sanitize_filename_part(self.p.sampler_name, replace_spaces=False),
'model_hash': lambda self: getattr(self.p, "sd_model_hash", shared.sd_model.sd_model_hash),
+ 'model_name': lambda self: sanitize_filename_part(shared.sd_model.sd_checkpoint_info.model_name, replace_spaces=False),
'date': lambda self: datetime.datetime.now().strftime('%Y-%m-%d'),
'datetime': lambda self, *args: self.datetime(*args), # accepts formats: [datetime], [datetime<Format>], [datetime<Format><Time Zone>]
'job_timestamp': lambda self: getattr(self.p, "job_timestamp", shared.state.job_timestamp),