ComfyUI > Nodes > ComfyUI-LogicUtils > Save Text Custom Node

ComfyUI Node: Save Text Custom Node

Class Name

SaveTextCustomNode

Category
text
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

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

Facilitates saving text data to a `.txt` file with customizable filenames, ensuring secure storage.

Save Text Custom Node:

The SaveTextCustomNode is designed to facilitate the saving of text data into a file format, specifically a .txt file. This node is particularly useful for AI artists and developers who need to persistently store generated text outputs from their workflows. By providing a straightforward method to save text, this node ensures that your data is organized and easily accessible for future reference or further processing. The node's primary function is to take a string of text and save it to a specified directory with a customizable filename. This capability is essential for maintaining a record of text outputs, which can be crucial for iterative design processes or when working with large datasets. The node also includes safeguards to prevent unauthorized access to parent or root directories, ensuring that your data is stored securely.

Save Text Custom Node Input Parameters:

text

The text parameter is the core input for this node, representing the string of text that you wish to save. It is crucial that this parameter contains the text data you want to preserve, as it directly impacts the content of the saved file. The text must be non-empty, as the node asserts that the text length must be greater than zero to proceed with the saving process.

filename_prefix

The filename_prefix parameter allows you to specify a prefix for the filename of the saved text file. This prefix is appended to the filename to help organize and categorize your saved files. By default, it is set to "ComfyUI", but you can customize it to suit your organizational needs. This parameter helps in distinguishing files, especially when saving multiple outputs.

subfolder_dir

The subfolder_dir parameter specifies the subdirectory within the output directory where the text file will be saved. This allows for better organization of files by categorizing them into different folders. It is important to ensure that this parameter does not attempt to access parent or root directories, as the node includes checks to prevent such access for security reasons.

filename

The filename parameter determines the actual name of the text file to be saved, excluding the file extension. It is essential that this parameter is non-empty, as the node requires a valid filename to create the file. The filename, combined with the prefix and the .txt extension, forms the complete name of the saved file.

Save Text Custom Node Output Parameters:

ui

The ui output parameter provides a structured response containing metadata about the saved text file. It includes details such as the filename, subfolder, and type, which can be useful for UI elements or further processing in your workflow. This output helps you verify that the file has been saved correctly and provides a reference for accessing it later.

outputs

The outputs parameter returns the name of the saved file without the .txt extension. This output is particularly useful if you need to reference the file in subsequent nodes or processes, as it provides a concise identifier for the saved text data.

Save Text Custom Node Usage Tips:

  • Ensure that the text parameter is non-empty to avoid assertion errors and ensure successful file saving.
  • Customize the filename_prefix and subfolder_dir parameters to organize your saved files effectively, making it easier to locate and manage them later.
  • Use descriptive filenames in the filename parameter to clearly identify the content or purpose of each saved file.

Save Text Custom Node Common Errors and Solutions:

"Text and filename must be non-empty"

  • Explanation: This error occurs when either the text or filename parameter is empty, which prevents the node from saving the file.
  • Solution: Ensure that both the text and filename parameters contain valid, non-empty strings before executing the node.

"Attempt to access parent or root directory"

  • Explanation: This error is triggered when the filename_prefix or subfolder_dir parameters attempt to access directories outside the allowed scope, such as parent or root directories.
  • Solution: Verify that the filename_prefix and subfolder_dir parameters do not contain paths that navigate to parent or root directories, and adjust them to specify valid subdirectories within the allowed output directory.

Save Text Custom Node Related Nodes

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