ComfyUI > Nodes > Basic data handling > load STRING from file

ComfyUI Node: load STRING from file

Class Name

Basic data handling: PathLoadStringFile

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

load STRING from file Description

PathLoadStringFile node loads UTF-8 text files, returning content as a string for easy use.

load STRING from file:

The PathLoadStringFile node is designed to facilitate the loading of text files encoded in UTF-8, providing a straightforward way to access and utilize the content of these files within your workflow. This node is particularly beneficial for AI artists and other users who need to incorporate textual data into their projects without delving into complex file handling operations. By simply specifying the path to the desired text file, the node efficiently reads and returns the file's content as a string, ensuring that the process is seamless and user-friendly. This functionality is crucial for tasks that require the integration of textual information, such as generating text-based art or processing narrative elements in creative projects.

load STRING from file Input Parameters:

path

The path parameter is a required input that specifies the location of the text file you wish to load. It is a string that should contain the full path to the file, including the file name and extension. The function of this parameter is to direct the node to the correct file location, enabling it to access and read the file's content. The default value for this parameter is an empty string, which means you need to provide a valid file path for the node to function correctly. There are no explicit minimum or maximum values for this parameter, but it must be a valid path that the system can recognize.

load STRING from file Output Parameters:

text

The text output parameter provides the content of the specified text file as a string. This output is crucial as it allows you to utilize the file's content in subsequent nodes or processes within your workflow. The value of this parameter will be an empty string if the file does not exist or cannot be read.

exists

The exists output parameter is a boolean that indicates whether the specified file was successfully found and read. This parameter is important for error handling and validation within your workflow, as it allows you to determine if the file loading operation was successful. A value of True means the file was found and read successfully, while False indicates that the file does not exist or could not be accessed.

load STRING from file Usage Tips:

  • Ensure that the file path provided is correct and accessible by the system to avoid errors related to file not found.
  • Use the exists output parameter to verify the success of the file loading operation before proceeding with further processing of the text content.

load STRING from file Common Errors and Solutions:

FileNotFoundError

  • Explanation: This error occurs when the specified file path does not point to an existing file.
  • Solution: Double-check the file path for accuracy, ensuring that the file exists at the specified location and that the path is correctly formatted.

PermissionError

  • Explanation: This error arises when the node does not have the necessary permissions to read the file.
  • Solution: Verify that the file permissions allow reading by the current user or process, and adjust the permissions if necessary.

UnicodeDecodeError

  • Explanation: This error can occur if the file is not encoded in UTF-8, which is the expected encoding for this node.
  • Solution: Ensure that the file is saved with UTF-8 encoding, or convert it to UTF-8 before attempting to load it with this node.

load STRING from file 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.

load STRING from file