ComfyUI Node: relative

Class Name

Basic data handling: PathRelative

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

relative Description

Computes relative paths between two locations, defaulting to the current directory if unspecified.

relative:

The PathRelative node is designed to compute the relative path from a specified starting point to a target path. This functionality is particularly useful when you need to determine the path difference between two locations in a file system, which can be essential for organizing files or creating dynamic file paths in your projects. If a starting path is not provided, the node defaults to using the current working directory as the starting point. This node simplifies the process of path manipulation by automatically handling the conversion, making it easier for you to manage file paths without delving into complex path calculations.

relative Input Parameters:

path

This parameter specifies the target path for which you want to compute the relative path. It is a required input and should be provided as a string. The path parameter represents the destination or endpoint in the file system from which the relative path will be calculated. There is no explicit minimum or maximum value, but it should be a valid path string. The default value is an empty string, which means you need to provide a valid path for the node to function correctly.

start

The start parameter is an optional input that defines the starting point from which the relative path to the path parameter will be calculated. If not provided, the node uses the current working directory as the default starting point. This parameter allows you to specify a custom starting location, which can be useful if you are working with paths that are not relative to the current directory. Like the path parameter, it should be a valid path string, and the default value is an empty string.

relative Output Parameters:

relative path

The output parameter relative path provides the computed relative path as a string. This output represents the path difference from the start parameter to the path parameter, effectively showing how to navigate from the starting point to the target path. This output is crucial for tasks that require dynamic path generation or when you need to reference files relative to a specific directory.

relative Usage Tips:

  • Ensure that both path and start parameters are valid paths to avoid errors in path computation.
  • Use this node to dynamically generate paths in projects where file locations may change, ensuring your code remains flexible and adaptable.
  • If you frequently work with paths relative to the current directory, you can omit the start parameter to simplify your workflow.

relative Common Errors and Solutions:

Invalid path

  • Explanation: This error occurs when the path or start parameter is not a valid path string.
  • Solution: Verify that both parameters are correctly specified and point to valid locations in the file system.

Path not found

  • Explanation: This error may arise if the specified path or start does not exist in the file system.
  • Solution: Check that the paths provided are correct and that the directories or files exist at those locations.

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

relative