Nodes/ControlFlowUtils/๐Ÿ“ Folder Search
ComfyUI Node

๐Ÿ“ Folder Search

Scans a specified folder for files matching a specific pattern. Set Folder_Path to the absolute or relative (to ComfyUI's root folder) path of the directory you wish to scan. Set Search_Mask to the pattern you wish to match files to. '*' will match all characters, '?' will match a single character and '#' should match a single numeric character. Characters within [brackets] must all be matched unless the sequence begins with the '[!brackets]' character, which will exclude those characters instead. You can also specify an entire range to search for such as [a-z]. You may select Output_Type to be either the entire list of files that were found matching the pattern, or only the current file, in which case one file will be returned each time this node is executed, until all files have been processed, at which point the node will return an empty string and reset the search query. If Recursive is set to True, then subfolders within the main specified directory will also be scanned. If Return_Full_Path is set to True, found files will be returned with their full qualified path, otherwise only the filename and extension will be returned. You may optionally point Save_Output_To to a file to save the output of this node to a log file of your choice, which you could then process separately. HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.

By VykosXยทCreated 2 years agoยทUpdated 2 years agoยท 147
๐Ÿ“ Folder Search
    • output
    โ—„folder_path/โ–บ
    โ—„search_mask*.*โ–บ
    โ—„output_typefalseโ–บ
    โ—„recursivetrueโ–บ
    โ—„include_directoriesfalseโ–บ
    โ—„return_full_pathfalseโ–บ
    โ—„relative_filenamesfalseโ–บ
    โ—„save_output_toโ–บ
    Category๐Ÿบ VykosX-ControlFlowUtils

    Inputs (8)

    NameTypeDefaultDescription
    folder_pathSTRING/Folder to search for files within
    search_maskSTRING*.*Pattern to match the found files against
    output_typeBOOLEANfalseHow the output should be returned, ALL files or one file at a time
    recursiveBOOLEANtrueSpecifies whether subfolders should be scanned as well
    include_directoriesBOOLEANfalseSpecifies whether directories should be included in the results
    return_full_pathBOOLEANfalseSpecifies whether the full file path should be returned or only the file name and extension
    relative_filenamesBOOLEANfalseSpecifies whether the filenames should be return along with their parent folder, relative to the search directory, or only the filenames themselves.
    save_output_tooptSTRINGOptional output file to save a list of found files to

    Outputs (1)

    NameTypeDescription
    output*All files found or the current file, based on the Output_Type