Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates saving text content to specified file path with customizable parameters and safety checks for AI artists.
The "💾 Save Text File With Path" node is designed to facilitate the saving of text content to a specified file path on your system. This node is particularly useful for AI artists who need to store generated text outputs, logs, or any other textual data in a structured and organized manner. By allowing you to define the file path, prefix, suffix, and other parameters, this node ensures that your files are saved with meaningful names and in the correct locations. It also includes safety checks to prevent directory traversal and ensures that the specified directories exist, creating them if necessary. This node simplifies the process of managing text files, making it easier for you to focus on your creative tasks without worrying about file handling intricacies.
This parameter represents the text content that you want to save to the file. It is a required input and must be provided as a string. The content of this parameter will be written directly to the specified file. If the text is empty, the node will raise an error to prevent saving an empty file.
This parameter specifies the directory path where the text file will be saved. It supports token replacement for dynamic path generation, with a default value of [time(%Y-%m-%d)]/
. The path must be a valid directory path and should not contain any invalid characters that navigate outside the output directory. If the specified path does not exist, the node will attempt to create it.
This parameter allows you to define a prefix for the filename. The prefix can include tokens for dynamic content, such as timestamps. The default value is `[time(%Y-%m-%d
This parameter defines the separator used between the filename and the counter. The default value is _
. This separator helps in distinguishing the base filename from the counter, which is useful when multiple files are saved with the same base name.
This parameter specifies the length of the counter appended to the filename. It is an integer value with a default of 3, a minimum of 0, and a maximum of 24. The counter ensures that files with the same base name do not overwrite each other by appending a unique number to each filename.
This parameter allows you to add a suffix to the filename. The default value is an empty string. The suffix can be used to add additional context or information to the filename, making it more descriptive.
This parameter specifies the file extension for the saved text file. The default value is txt
. The extension must be a valid file extension and cannot be empty. This ensures that the saved file is recognized as a text file by the system.
This output parameter provides the full path of the saved text file, including the directory, filename, and extension. It is useful for verifying the location and name of the saved file, ensuring that the file has been saved correctly.
This output parameter provides the name of the saved text file without the extension. It is useful for referencing the file in subsequent operations or for logging purposes.
file_text
parameter is not empty to avoid errors.path
, prefix
, and suffix
parameters to generate meaningful and organized filenames.path
does not contain invalid characters to prevent directory traversal errors.counter_length
parameter based on the expected number of files to avoid filename conflicts.output_extension
parameter is empty, which is not allowed.output_extension
parameter is set to a valid file extension, such as txt
.path
parameter contains characters like ..
that attempt to navigate outside the allowed directory.path
parameter to ensure it points to a valid directory within the allowed output directory.path
parameter points to a directory outside the allowed output directory.path
parameter to ensure it is within the allowed output directory.file_text
parameter is empty, and the node cannot save an empty file.file_text
parameter before executing the node.<full_path>
could not be created! Is there write access?© Copyright 2024 RunComfy. All Rights Reserved.