Add File List to File Path converter node

This commit is contained in:
lehie
2026-02-11 11:44:48 +07:00
parent bc0e4df12d
commit 83acd7b8cd
2 changed files with 35 additions and 0 deletions
+1
View File
@@ -94,6 +94,7 @@ _safe_merge("file_list_loader")
_safe_merge("mp3_audio_loader")
_safe_merge("mp3_embed_image")
_safe_merge("file_list_to_path")
_safe_merge("adaptive_resolution")
_safe_merge("colab_nodes")
+34
View File
@@ -0,0 +1,34 @@
class FileListToFilePath:
"""
Convert file list (xử lí cùng lúc) to file path (xử lí từng file).
Giống Image List to Image Batch nhưng cho file paths.
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"file_paths": ("STRING",),
}
}
INPUT_IS_LIST = True
RETURN_TYPES = ("STRING", "INT")
RETURN_NAMES = ("file_path", "count")
OUTPUT_IS_LIST = (True, False)
FUNCTION = "convert"
CATEGORY = "comfyui-sortlist"
def convert(self, file_paths):
# Filter out empty strings
paths = [p for p in file_paths if p and p.strip()]
return (paths, len(paths))
NODE_CLASS_MAPPINGS = {
"File List To File Path": FileListToFilePath,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"File List To File Path": "File List to File Path",
}