ComfyUI Node: dirname

Class Name

Basic data handling: PathDirname

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

dirname Description

Extracts directory path from a file path, isolating directory structure for easier file management.

dirname:

The PathDirname node is designed to simplify the process of extracting the directory component from a given file path. This node is particularly useful when you need to isolate the directory path from a full file path, effectively removing the filename and leaving you with just the directory structure. This can be beneficial in various scenarios, such as organizing files, managing directories, or preparing paths for further processing. By focusing on the directory name, this node helps streamline workflows that involve file path manipulations, making it easier to handle and organize file systems without delving into complex coding tasks.

dirname Input Parameters:

path

The path parameter is a string input that represents the full file path from which you want to extract the directory name. This parameter is crucial as it determines the path from which the directory component will be extracted. The function of this parameter is to provide the node with the necessary information to perform its task. There are no specific minimum or maximum values for this parameter, but it should be a valid file path string. The default value is an empty string, which means if no path is provided, the node will not perform any operation.

dirname Output Parameters:

dirname

The dirname output parameter is a string that represents the directory component extracted from the provided file path. This output is significant as it provides the user with the directory path, excluding the filename, which can be used for further directory-related operations or organization tasks. The output value is the directory path as a string, which can be easily interpreted and utilized in various file management scenarios.

dirname Usage Tips:

  • Ensure that the path parameter is a valid and complete file path to avoid unexpected results or errors.
  • Use this node when you need to separate the directory path from the filename for tasks such as organizing files or preparing paths for further processing.

dirname Common Errors and Solutions:

Invalid path provided

  • Explanation: This error occurs when the path parameter is not a valid file path or is incorrectly formatted.
  • Solution: Double-check the file path for typos or incorrect formatting. Ensure that the path is complete and valid.

Empty path input

  • Explanation: This error happens when the path parameter is left empty, resulting in no operation being performed.
  • Solution: Provide a valid file path in the path parameter to enable the node to extract the directory name.

dirname 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.

dirname