Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > ComfyUI-CustomNodeKit > 路径验证器

ComfyUI Node: 路径验证器

Class Name

PathValidatorNode

Category
Custom Nodes
Author
user2318 (Account age: 2574days)
Extension
ComfyUI-CustomNodeKit
Latest Updated
2026-07-16
Github Stars
0.05K

How to Install ComfyUI-CustomNodeKit

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

路径验证器 Description

Automatically validate and manage file or directory paths, determine type, check existence, add prefix, create missing directories, streamline file management tasks.

路径验证器:

The PathValidatorNode is a versatile tool designed to automatically validate and manage file or directory paths. Its primary function is to determine whether a given path is a file or a directory and to check its existence. This node is particularly beneficial for users who need to handle paths dynamically, as it can automatically add a prefix to relative paths and even create missing directories if required. By providing insights into the existence of paths and the number of files within a directory based on specified extensions, the PathValidatorNode streamlines file management tasks, making it an essential component for efficient workflow automation.

路径验证器 Input Parameters:

path

This parameter specifies the file or folder path that you want to validate. It supports both relative and absolute paths, allowing flexibility in how paths are provided. The path is a string input, and it is crucial for determining the type and existence of the path. There are no specific minimum or maximum values, but the default is an empty string. This parameter is essential for the node to perform its validation tasks.

create_if_missing

This boolean parameter determines whether a directory should be automatically created if it does not exist. It is applicable only when the path is identified as a directory. The default value is False, meaning directories will not be created unless explicitly specified. This parameter is useful for ensuring that necessary directories are available without manual intervention.

path_prefix

The path_prefix is a string parameter that allows you to specify a prefix for relative paths. This is particularly useful when working with paths that are not absolute, as it helps in constructing the full path. The default is an empty string, indicating no prefix is added. This parameter aids in maintaining consistency and accuracy in path handling.

extension_filter

This parameter is a string that specifies the file extensions to consider when counting files within a directory. Multiple extensions can be separated by commas, such as 'png,jpg'. If left empty, all files are counted. This parameter is crucial for filtering and counting specific types of files, providing more targeted results.

路径验证器 Output Parameters:

exists

This boolean output indicates whether the specified path exists. It is a straightforward indicator of the path's presence, helping you quickly determine if further actions are needed based on the path's existence.

path_out

The path_out is a string output that returns the original path provided. This output is useful for confirming the path being processed and for further operations that may require the original path string.

file_count

This integer output represents the number of files within a directory that match the specified extension filter. It provides a count of relevant files, aiding in tasks that require knowledge of file quantities, such as batch processing or resource management.

路径验证器 Usage Tips:

  • Use the create_if_missing parameter to automatically set up necessary directories, saving time and reducing manual setup efforts.
  • Leverage the extension_filter to focus on specific file types, which can optimize processes that depend on particular file formats.

路径验证器 Common Errors and Solutions:

"tkinter 不可用。请运行 install.py 安装 tkinter 组件,或重启 ComfyUI 后重试。"

  • Explanation: This error indicates that the tkinter library, which is required for file dialog operations, is not available.
  • Solution: Run the install.py script to install the tkinter components, or restart ComfyUI to resolve the issue.

"destination escapes base directory"

  • Explanation: This error occurs when the specified path is not within the allowed base directory, potentially indicating a security concern.
  • Solution: Ensure that the path is correctly set within the base directory to comply with security constraints.

路径验证器 Related Nodes

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

路径验证器