mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-27 22:27:17 +08:00
commit
06a60ac3fe
@ -176,7 +176,7 @@ Saves an image and mask as .PNG with the mask as the alpha channel.
|
|||||||
def file_counter():
|
def file_counter():
|
||||||
max_counter = 0
|
max_counter = 0
|
||||||
# Loop through the existing files
|
# Loop through the existing files
|
||||||
for existing_file in os.listdir(full_output_folder):
|
for existing_file in sorted(os.listdir(full_output_folder)):
|
||||||
# Check if the file matches the expected format
|
# Check if the file matches the expected format
|
||||||
match = re.fullmatch(fr"{filename}_(\d+)_?\.[a-zA-Z0-9]+", existing_file)
|
match = re.fullmatch(fr"{filename}_(\d+)_?\.[a-zA-Z0-9]+", existing_file)
|
||||||
if match:
|
if match:
|
||||||
@ -2981,7 +2981,7 @@ class LoadImagesFromFolderKJ:
|
|||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for file in os.listdir(folder):
|
for file in sorted(os.listdir(folder)):
|
||||||
if any(file.lower().endswith(ext) for ext in valid_extensions):
|
if any(file.lower().endswith(ext) for ext in valid_extensions):
|
||||||
path = os.path.join(folder, file)
|
path = os.path.join(folder, file)
|
||||||
try:
|
try:
|
||||||
@ -3043,7 +3043,7 @@ class LoadImagesFromFolderKJ:
|
|||||||
if any(file.lower().endswith(ext) for ext in valid_extensions):
|
if any(file.lower().endswith(ext) for ext in valid_extensions):
|
||||||
image_paths.append(os.path.join(root, file))
|
image_paths.append(os.path.join(root, file))
|
||||||
else:
|
else:
|
||||||
for file in os.listdir(folder):
|
for file in sorted(os.listdir(folder)):
|
||||||
if any(file.lower().endswith(ext) for ext in valid_extensions):
|
if any(file.lower().endswith(ext) for ext in valid_extensions):
|
||||||
image_paths.append(os.path.join(folder, file))
|
image_paths.append(os.path.join(folder, file))
|
||||||
|
|
||||||
@ -3964,7 +3964,7 @@ class LoadVideosFromFolder:
|
|||||||
raise ImportError("This node requires ComfyUI-VideoHelperSuite to be installed.")
|
raise ImportError("This node requires ComfyUI-VideoHelperSuite to be installed.")
|
||||||
videos_list = []
|
videos_list = []
|
||||||
filenames = []
|
filenames = []
|
||||||
for f in os.listdir(kwargs['video']):
|
for f in sorted(os.listdir(kwargs['video'])):
|
||||||
if os.path.isfile(os.path.join(kwargs['video'], f)):
|
if os.path.isfile(os.path.join(kwargs['video'], f)):
|
||||||
file_parts = f.split('.')
|
file_parts = f.split('.')
|
||||||
if len(file_parts) > 1 and (file_parts[-1].lower() in ['webm', 'mp4', 'mkv', 'gif', 'mov']):
|
if len(file_parts) > 1 and (file_parts[-1].lower() in ['webm', 'mp4', 'mkv', 'gif', 'mov']):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user