From deea9f4d70e079903a9a871b24d7d2c625ad7428 Mon Sep 17 00:00:00 2001 From: Twizzes Date: Thu, 15 Sep 2022 16:47:37 -0700 Subject: [PATCH] Replace invalid filename chars with an underscore ... instead of removing them altogether. This makes the prompt editing filenames [old:new:step] easier to read --- modules/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):