ComfyUI Node: list dir

Class Name

Basic data handling: PathListDir

Category
Basic/Path
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling 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

list dir Description

PathListDir lists and filters files or directories in a specified path for efficient data management.

list dir:

The PathListDir node is designed to facilitate the exploration of directory contents within a specified path. Its primary function is to list all files and directories contained in a given directory, providing a straightforward way to access and manage file system resources. This node is particularly useful for users who need to organize or process files and directories efficiently. By offering options to filter the results to include only files or only directories, it provides flexibility in handling different data management tasks. This capability is essential for AI artists who often work with large datasets and need to quickly navigate through their file structures to locate specific resources or organize their work environment.

list dir Input Parameters:

path

The path parameter specifies the directory path whose contents you wish to list. It is a required parameter and should be provided as a string. If left empty, the node defaults to using the current working directory. This parameter is crucial as it determines the scope of the directory listing operation.

files_only

The files_only parameter is an optional boolean that, when set to True, filters the directory contents to return only files. The default value is False. This parameter is useful when you are only interested in processing or viewing files within a directory, excluding any subdirectories.

dirs_only

The dirs_only parameter is another optional boolean that, when set to True, filters the directory contents to return only directories. The default value is False. This parameter is beneficial when you need to focus on directory structures, such as when organizing or navigating through nested folders.

list dir Output Parameters:

entries

The entries output parameter provides a list of strings representing the names of files and/or directories found in the specified path. The content of this list depends on the files_only and dirs_only parameters, allowing you to tailor the output to your specific needs. This output is essential for further processing or analysis of directory contents, enabling efficient data handling and organization.

list dir Usage Tips:

  • Use the files_only parameter when you need to process or analyze files without the distraction of directories, such as when batch processing images or documents.
  • Utilize the dirs_only parameter to focus on directory structures, which can be helpful for organizing projects or managing nested folders.
  • If you are unsure of the current working directory, leave the path parameter empty to list contents from the current directory automatically.

list dir Common Errors and Solutions:

Directory does not exist: <path>

  • Explanation: This error occurs when the specified path does not exist in the file system.
  • Solution: Verify that the path is correct and that the directory exists. Correct any typos or errors in the path string.

Basic data handling: Path is not a directory: <path>

  • Explanation: This error is raised when the specified path is not a directory but a file.
  • Solution: Ensure that the path points to a directory and not a file. Adjust the path accordingly to target the correct directory.

list dir Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
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 Models, enabling artists to harness the latest AI tools to create incredible art.

list dir