Skip to content

Commit ffcbbcf

Browse files
committed
add filename santization
Probably redundant, considering the model name *is* a filename, but I suppose better safe than sorry.
1 parent 6001684 commit ffcbbcf

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
@@ -305,7 +305,7 @@ class FilenameGenerator:
305305
'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),
306306
'sampler': lambda self: self.p and sanitize_filename_part(self.p.sampler_name, replace_spaces=False),
307307
'model_hash': lambda self: getattr(self.p, "sd_model_hash", shared.sd_model.sd_model_hash),
308-
'model_name': lambda self: shared.sd_model.sd_checkpoint_info.model_name,
308+
'model_name': lambda self: sanitize_filename_part(shared.sd_model.sd_checkpoint_info.model_name, replace_spaces=False),
309309
'date': lambda self: datetime.datetime.now().strftime('%Y-%m-%d'),
310310
'datetime': lambda self, *args: self.datetime(*args), # accepts formats: [datetime], [datetime<Format>], [datetime<Format><Time Zone>]
311311
'job_timestamp': lambda self: getattr(self.p, "job_timestamp", shared.state.job_timestamp),

0 commit comments

Comments
 (0)