ComfyUI > Nodes > ComfyUI-CoCoTools > Walk Folder

ComfyUI Node: Walk Folder

Class Name

WalkFolderNode

Category
COCO Tools/File Logistics
Author
Conor-Collins (Account age: 431days)
Extension
ComfyUI-CoCoTools
Latest Updated
2025-03-05
Github Stars
0.03K

How to Install ComfyUI-CoCoTools

Install this extension via the ComfyUI Manager by searching for ComfyUI-CoCoTools
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-CoCoTools in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Walk Folder Description

Facilitates file navigation and selection within specified directory, filtering by extension and selecting using seed value.

Walk Folder:

The WalkFolderNode is designed to facilitate the navigation and selection of files within a specified directory. Its primary function is to traverse a given folder, filter files based on a specified extension, and select a file using a seed value. This node is particularly useful for AI artists who need to manage and organize large collections of files, such as images or datasets, by providing a systematic way to access and retrieve specific files. By leveraging this node, you can efficiently handle file logistics, ensuring that the right files are selected for your creative or analytical tasks.

Walk Folder Input Parameters:

folder_path

The folder_path parameter specifies the directory path where the node will search for files. It is crucial for defining the location of your files, and the node will only operate within this specified directory. The path must be valid and point to an existing directory; otherwise, an error will be raised. There is no default value, so you must provide a valid path for the node to function.

seed

The seed parameter is an integer that determines which file to select from the sorted list of files in the directory. It acts as an index, allowing you to choose a specific file based on its position in the sorted list. The seed must be within the range of available files; otherwise, an error will occur. The default value is 0, which selects the first file in the list.

file_extension

The file_extension parameter allows you to filter files by their extension, such as png or jpg. This is useful for narrowing down the search to specific file types. You can use an asterisk (*) to include all file types. The default value is *, meaning all files will be considered unless a specific extension is provided.

Walk Folder Output Parameters:

file_path

The file_path output provides the full path to the file selected based on the seed value. This output is essential for accessing the specific file you need for further processing or analysis. It ensures that you have a direct reference to the file within the specified directory.

file_info

The file_info output is a string that contains detailed information about the files in the directory. It includes the total number of files, the names of the first and last files, and the name of the currently selected file. This information is valuable for understanding the context of the file selection and for verifying that the correct file has been chosen.

Walk Folder Usage Tips:

  • Ensure that the folder_path is correctly specified and points to an existing directory to avoid errors.
  • Use the file_extension parameter to filter files effectively, especially when dealing with directories containing mixed file types.
  • Adjust the seed value to select different files from the directory, which can be useful for iterating through a dataset or collection.

Walk Folder Common Errors and Solutions:

The provided folder path '<folder_path>' is not valid.

  • Explanation: This error occurs when the specified folder_path does not exist or is not a directory.
  • Solution: Verify that the folder_path is correct and points to an existing directory.

No files found in '<folder_path>' matching extension '.<file_extension>'

  • Explanation: This error indicates that no files in the directory match the specified file_extension.
  • Solution: Check the file_extension parameter to ensure it matches the file types in the directory, or use * to include all files.

Seed value <seed> is out of range. There are only <number> files.

  • Explanation: The seed value exceeds the number of available files in the directory.
  • Solution: Adjust the seed value to be within the range of available files, starting from 0 up to the total number of files minus one.

Walk Folder Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-CoCoTools
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.