ComfyUI > Nodes > ComfyUI Level Pixel > File Counter [LP]

ComfyUI Node: File Counter [LP]

Class Name

FileCounter|LP

Category
LevelPixel/IO
Author
LevelPixel (Account age: 647days)
Extension
ComfyUI Level Pixel
Latest Updated
2026-02-24
Github Stars
0.03K

How to Install ComfyUI Level Pixel

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

File Counter [LP] Description

Counts files in a directory matching specified patterns, aiding in file management tasks.

File Counter [LP]| File Counter [LP]:

The FileCounter| File Counter [LP] node is designed to help you efficiently count the number of files within a specified directory that match certain patterns. This node is particularly useful for managing and organizing large collections of image files, such as those used in AI art projects. By specifying a directory and file patterns, you can quickly determine the total number of files that meet your criteria, which can be invaluable for tasks like batch processing or resource management. The node's primary function is to scan the given directory and count files that match the specified patterns, providing both an integer and a string representation of the total count. This functionality is essential for artists and developers who need to keep track of file quantities without manually counting them, thus saving time and reducing the potential for errors.

File Counter [LP]| File Counter [LP] Input Parameters:

directory_path

The directory_path parameter specifies the path to the directory where the node will search for files. It is a string input, and you should provide the full path to the directory you want to scan. This parameter is crucial because it defines the scope of the file search. If the directory path is incorrect or does not exist, the node will not be able to perform its function. The default value is an empty string, indicating that you need to specify a valid directory path for the node to operate correctly.

patterns

The patterns parameter allows you to define the types of files you want to count by specifying file patterns. It is a string input where you can list multiple patterns separated by a pipe (|) character, such as *.jpg|*.png|*.jpeg. This parameter is essential for filtering the files in the directory to only those that match the specified patterns. The default value is set to common image file extensions, making it particularly useful for counting image files in AI art projects. Adjusting this parameter allows you to tailor the file search to your specific needs.

rescan_each_queue

The rescan_each_queue parameter is a boolean input that determines whether the node should rescan the directory each time it is queued for execution. If set to True, the node will perform a fresh scan every time, ensuring that the file count is always up-to-date with the current state of the directory. This is useful in dynamic environments where files are frequently added or removed. The default value is True, which is ideal for most use cases where real-time accuracy is important. Setting it to False can improve performance if the directory contents are static.

File Counter [LP]| File Counter [LP] Output Parameters:

Total INT

The Total INT output provides the total number of files that match the specified patterns in the directory as an integer. This output is crucial for tasks that require a numerical representation of the file count, such as setting limits for batch processing or resource allocation. It allows you to easily integrate the file count into other processes or calculations within your workflow.

Total STRING

The Total STRING output offers the same total file count as a string. This output is useful for displaying the file count in user interfaces or logging systems where a string representation is preferred. It provides flexibility in how you present or utilize the file count information, ensuring compatibility with various systems and formats.

File Counter [LP]| File Counter [LP] Usage Tips:

  • Ensure that the directory_path is correctly specified and points to an existing directory to avoid errors and ensure accurate file counting.
  • Use the patterns parameter to filter files effectively, especially if you are only interested in specific file types, such as images or documents.
  • Set rescan_each_queue to True if your directory contents change frequently, ensuring that the file count remains accurate and up-to-date.

File Counter [LP]| File Counter [LP] Common Errors and Solutions:

Directory does not exist

  • Explanation: This error occurs when the specified directory_path does not point to a valid directory.
  • Solution: Double-check the directory path to ensure it is correct and that the directory exists on your system.

No files match the specified patterns

  • Explanation: This error happens when no files in the directory match the patterns specified in the patterns parameter.
  • Solution: Verify that the patterns are correctly specified and that there are files in the directory that match these patterns. Adjust the patterns if necessary to include the desired file types.

File Counter [LP] Related Nodes

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

File Counter [LP]