ComfyUI > Nodes > ComfyUI 1hewNodes > Get File Count

ComfyUI Node: Get File Count

Class Name

1hew_GetFileCount

Category
1hewNodes/io
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

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

Get File Count Description

Efficiently counts specified file types in directories, including subdirectories, for dynamic updates.

Get File Count:

The 1hew_GetFileCount node is designed to efficiently count the number of files within a specified directory, offering a streamlined way to manage and organize your digital assets. This node is particularly useful for AI artists who need to keep track of their image, video, or text files without manually counting them. By specifying the type of files you are interested in, such as images, videos, or text documents, the node filters and counts only those files, providing a precise count. Additionally, it can traverse subdirectories if needed, making it a versatile tool for handling complex folder structures. The node's ability to hash file paths ensures that any changes in the directory, such as file additions or deletions, are efficiently detected, allowing for dynamic updates in workflows that depend on file counts.

Get File Count Input Parameters:

folder

This parameter specifies the directory path where the node will search for files. It is crucial as it defines the scope of the file count operation. The folder path should be a valid directory; otherwise, the node will not perform the count. There is no explicit minimum or maximum value for this parameter, but it should be a valid path string. The default value is an empty string, indicating that the user must provide a path.

type

This parameter determines the type of files to be counted within the specified folder. It accepts options such as "image", "video", and "txt", allowing you to filter the count to specific file types. This is particularly useful for artists who want to focus on a particular type of media. The default value is "image", and the available options are ["image", "video", "txt"].

include_subdir

This boolean parameter indicates whether the node should include files from subdirectories within the specified folder. If set to True, the node will recursively search through all subdirectories, providing a comprehensive file count. This is beneficial for users with nested folder structures. The default value is True, meaning subdirectories are included by default.

Get File Count Output Parameters:

count

This output provides the total number of files found in the specified directory that match the given type. It is an integer value representing the count of files, which is essential for understanding the volume of assets within a folder. This output helps in managing and organizing files effectively.

folder

This output returns the folder path that was used for the file count operation. It serves as a confirmation of the directory that was processed, ensuring that users can verify the source of the file count.

include_subdir

This output indicates whether subdirectories were included in the file count operation. It returns a boolean value, providing clarity on the scope of the count and helping users understand the context of the results.

Get File Count Usage Tips:

  • Ensure that the folder path provided is correct and accessible to avoid errors in file counting.
  • Use the type parameter to filter files according to your needs, which can help in focusing on specific media types and optimizing workflow efficiency.
  • Consider setting include_subdir to False if you only need to count files in the top-level directory, which can speed up the operation in directories with many subfolders.

Get File Count Common Errors and Solutions:

Invalid folder path

  • Explanation: 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. Ensure that you have the necessary permissions to access the directory.

Unsupported file type

  • Explanation: The type parameter is set to a value that is not supported by the node.
  • Solution: Use one of the supported file types: "image", "video", or "txt". Check the spelling and case of the type value.

Permission denied

  • Explanation: The node does not have permission to access the specified folder or its subdirectories.
  • Solution: Ensure that the application running the node has the necessary permissions to read the directory and its contents. Adjust permissions if necessary.

Get File Count Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI 1hewNodes
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.

Get File Count