Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates writing text data to file in UTF-8 plaintext format, with options for appending, overwriting, or creating new file.
The SaveTextFile node is designed to facilitate the process of writing text data to a file in UTF-8 plaintext format. This node is particularly useful for AI artists who need to save generated text or other textual data to a file for later use or further processing. The node offers flexibility in how the text is written to the file, allowing you to choose between appending to an existing file, overwriting the file, or creating a new file only if it does not already exist. Additionally, when appending text, you have the option to include a new line terminator to ensure that subsequent writes start on a new line. This node simplifies file operations, making it easy to manage text data without requiring extensive technical knowledge.
This parameter specifies the absolute or relative path of the file to which the text will be written. It is a string input, and you should provide the full path to ensure the file is correctly located. The default value is "out.txt".
This parameter determines the mode in which the file will be written. The available options are "append", "overwrite", and "new only". "Append" adds the new text to the end of the existing file content, "overwrite" replaces the entire file content with the new text, and "new only" ensures that the file is created only if it does not already exist. This parameter helps control how the text is managed in the file.
This boolean parameter specifies whether to include a new line after appending text to the file. It is only applicable when the mode is set to "append". If set to True, a new line will be added after the appended text; if False, the text will be written contiguously. The default value is True, and this setting ensures that each append operation starts on a new line.
This parameter is the actual text content to be written to the file. It is a string input and supports multiline text. You can right-click and convert this input to dynamically specify the text content. This flexibility allows you to write various types of text data to the file as needed.
This boolean output parameter indicates whether the file was successfully written to. It returns True if the operation was successful and False otherwise. This output helps you verify the success of the file write operation and handle any issues that may arise.
file_path
is correctly specified to avoid file not found errors.mode
parameter wisely to control how the text is written to the file, especially when dealing with existing files.terminator
to True to maintain readability and structure in the file.text
input to a dynamic input if you need to write variable text content to the file.file_path
parameter is not provided or is an empty string.file_path
parameter is correctly specified with a valid file path.mode
parameter.mode
parameter is set to one of the valid options: "append", "overwrite", or "new only".© Copyright 2024 RunComfy. All Rights Reserved.