aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRnDMonkey <ryandrutledge@gmail.com>2022-10-01 21:18:15 -0700
committerRnDMonkey <ryandrutledge@gmail.com>2022-10-01 21:18:15 -0700
commit70f526704721a303ae045f6406439dcceee4302e (patch)
tree6d9665b412113de3a5dfd39b62f04b83582562e7
parent3cf1a96006daffedb8ecd0ae142eca4c4da06105 (diff)
use os.path.normpath for better safety checking
-rw-r--r--modules/images.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/images.py b/modules/images.py
index e7894b4c..5ef7eb92 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -374,8 +374,8 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
save_to_dirs = (grid and opts.grid_save_to_dirs) or (not grid and opts.save_to_dirs and not no_prompt)
if save_to_dirs:
- dirname = apply_filename_pattern(opts.directories_filename_pattern or "[prompt_words]", p, seed, prompt).strip('\\ ')
- path = os.path.join(path, dirname)
+ dirname = apply_filename_pattern(opts.directories_filename_pattern or "[prompt_words]", p, seed, prompt)
+ path = os.path.normpath(os.path.join(path, dirname))
os.makedirs(path, exist_ok=True)