Replace invalid filename chars with an underscore

... instead of removing them altogether.
This makes the prompt editing filenames [old🆕step] easier to read
This commit is contained in:
Twizzes 2022-09-15 16:47:37 -07:00 committed by AUTOMATIC1111
parent 7fe00d0840
commit deea9f4d70

View file

@ -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):