Skip to content

Commit be997b8

Browse files
First step of supporting save filenames without trailing _
get_save_image_path now properly supports filenames without trailing underscores. This will be the saving behavior when using a mix of save image nodes using the old and the new format. ComfyUI_00001_.png ComfyUI_00002.png ComfyUI_00003.png ComfyUI_00004_.png
1 parent e5369c0 commit be997b8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

folder_paths.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ def map_filename(filename: str) -> tuple[int, str]:
432432
prefix_len = len(os.path.basename(filename_prefix))
433433
prefix = filename[:prefix_len + 1]
434434
try:
435-
digits = int(filename[prefix_len + 1:].split('_')[0])
435+
remainder = filename[prefix_len + 1:]
436+
base_remainder = remainder.split('.')[0]
437+
digits = int(base_remainder.split('_')[0])
436438
except:
437439
digits = 0
438440
return digits, prefix

0 commit comments

Comments
 (0)