aboutsummaryrefslogtreecommitdiffstats
path: root/modules/images.py
diff options
context:
space:
mode:
authorTwizzes <Twizzes@users.noreply.github.com>2022-09-15 23:47:37 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-16 04:25:58 +0000
commitdeea9f4d70e079903a9a871b24d7d2c625ad7428 (patch)
treeb48d46cb7dc669f45f17665eca034e9527828bfb /modules/images.py
parent7fe00d08402b8bf9f7f0ffef59ee3f3ad0187cfc (diff)
downloadstable-diffusion-webui-gfx803-deea9f4d70e079903a9a871b24d7d2c625ad7428.tar.gz
stable-diffusion-webui-gfx803-deea9f4d70e079903a9a871b24d7d2c625ad7428.tar.bz2
stable-diffusion-webui-gfx803-deea9f4d70e079903a9a871b24d7d2c625ad7428.zip
Replace invalid filename chars with an underscore
... instead of removing them altogether. This makes the prompt editing filenames [old:new:step] easier to read
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/images.py b/modules/images.py
index 97cccf54..f37f5f08 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -252,7 +252,7 @@ def sanitize_filename_part(text, replace_spaces=True):
if replace_spaces:
text = text.replace(' ', '_')
- return text.translate({ord(x): '' for x in invalid_filename_chars})[:128]
+ return text.translate({ord(x): '_' for x in invalid_filename_chars})[:128]
def apply_filename_pattern(x, p, seed, prompt):