ComfyUI > Nodes > Basic data handling > save STRING to file

ComfyUI Node: save STRING to file

Class Name

Basic data handling: PathSaveStringFile

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

save STRING to file Description

PathSaveStringFile node saves text data to files, supports directory creation, and specifies encoding.

save STRING to file:

The PathSaveStringFile node is designed to facilitate the process of saving text data to a file on your system. This node is particularly useful for AI artists and developers who need to persistently store string data generated during their workflows. By providing a straightforward method to write strings to files, it ensures that your data can be easily saved and retrieved later. The node supports creating directories if they do not exist, which simplifies the process of organizing your files. Additionally, it allows you to specify the encoding format, ensuring compatibility with various text data types, including those containing special characters. This functionality is essential for maintaining data integrity and accessibility across different systems and applications.

save STRING to file Input Parameters:

text

The text parameter is the string content that you wish to save to a file. This can be any text data, including plain text, JSON, or other string formats. The content of this parameter directly determines what will be written to the file. There is no explicit minimum or maximum length for this parameter, but it should be within the limits of your system's file handling capabilities. The default value is an empty string.

path

The path parameter specifies the location where the text file will be saved. This should be a valid file path on your system, including the desired file name and extension. The path determines where the file will be stored and must be specified for the node to function correctly. The default value is an empty string.

create_dirs

The create_dirs parameter is a boolean option that determines whether the node should automatically create any necessary directories in the specified path if they do not already exist. This is useful for ensuring that your file can be saved without manual directory creation. The default value is True, meaning directories will be created by default.

encoding

The encoding parameter allows you to specify the character encoding for the text file. This is important for ensuring that the text is correctly interpreted when read back, especially if it contains special characters or is intended for use in different locales. Common encoding options include utf-8, which is the default value, and others like ascii or latin-1.

save STRING to file Output Parameters:

success

The success parameter is a boolean output that indicates whether the text was successfully saved to the specified file path. A value of True means the operation was successful, while False indicates that an error occurred during the saving process. This output is crucial for error handling and ensuring that your data has been correctly saved.

save STRING to file Usage Tips:

  • Ensure that the path parameter includes both the directory and the file name with an appropriate extension to avoid confusion about where your file is saved.
  • Use the create_dirs parameter to automatically handle directory creation, which can save time and prevent errors related to missing directories.
  • Choose the encoding parameter carefully based on the content of your text to ensure that special characters are preserved correctly.

save STRING to file Common Errors and Solutions:

Basic data handling: Save failed - no path specified

  • Explanation: This error occurs when the path parameter is not provided or is an empty string, making it impossible to determine where to save the file.
  • Solution: Ensure that you specify a valid file path in the path parameter, including the directory and file name.

Basic data handling: Error saving text file: <error_message>

  • Explanation: This error indicates that an exception occurred while attempting to save the text file. The <error_message> will provide more details about the specific issue.
  • Solution: Check the error message for clues about the problem, such as permission issues or invalid paths. Ensure that the directory exists or use the create_dirs parameter to create it automatically. Verify that the file path is valid and that you have write permissions for the specified location.

save STRING to 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.

save STRING to file