Commit deea9f4d authored by Twizzes's avatar Twizzes Committed by AUTOMATIC1111

Replace invalid filename chars with an underscore

... instead of removing them altogether.
This makes the prompt editing filenames [old:new:step] easier to read
parent 7fe00d08
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment