diff options
author | Alex "mcmonkey" Goodwin <git_commits@alexgoodwin.dev> | 2022-11-23 14:44:20 +0000 |
---|---|---|
committer | Alex "mcmonkey" Goodwin <git_commits@alexgoodwin.dev> | 2022-11-23 14:44:20 +0000 |
commit | ffcbbcf385eb847ced957510ab726291a8b20207 (patch) | |
tree | 2265c7c5ba04c0be961057191101538c36a3bdcb /modules/images.py | |
parent | 6001684be3e7b023346326b9dfc771219b8fe47e (diff) | |
download | stable-diffusion-webui-gfx803-ffcbbcf385eb847ced957510ab726291a8b20207.tar.gz stable-diffusion-webui-gfx803-ffcbbcf385eb847ced957510ab726291a8b20207.tar.bz2 stable-diffusion-webui-gfx803-ffcbbcf385eb847ced957510ab726291a8b20207.zip |
add filename santization
Probably redundant, considering the model name *is* a filename, but I suppose better safe than sorry.
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 420828b0..8fa96b16 100644 --- a/modules/images.py +++ b/modules/images.py @@ -305,7 +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: shared.sd_model.sd_checkpoint_info.model_name,
+ '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),
|