Save String KJ(SaveStringKJ)
In terms of technical implementation, this node allows users to customize the output file name prefix, save folder, and file extension.
Save String KJ
The Save String KJ node, in terms of technical implementation, allows users to customize the output file's name prefix, save folder, and file extension.
The Save String KJ node is a utility node designed to save text strings as local files. Its core function is to receive a text input and write its content to a .txt file in a specified directory, facilitating the persistent storage of text information generated within a workflow.
Node Functionality
Technically, this node allows users to customize the output file's name prefix, save folder, and file extension. The filename prefix supports dynamic formatting, such as embedding the current date or referencing attribute values from other nodes, providing high flexibility for file naming. The node ultimately writes the processed text content to ComfyUI's output directory or a specified subfolder within it.
Node Parameter Description - Save String KJ
Parameters
| Parameter Name | Data Type | Required | Default Value | Range/Options | Description |
|---|---|---|---|---|---|
string | STRING | Yes | - | - | string to save as .txt file |
filename_prefix | STRING | Yes | text | - | The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes. |
output_folder | STRING | Yes | output | - | The folder to save the images to. |
file_extension | STRING | No | .txt | - | The extension for the caption file. |
Output
| Parameter Name | Data Type | Description |
|---|---|---|
| filename | STRING | Defines the prefix part of the output filename, supporting the use of formatting strings like %date:yyyy-MM-dd% to embed dynamic information. |
Use Cases
In practical applications, this node is highly suitable for workflows that require recording or exporting text information. For example, in a workflow combining text generation and image generation, users can save prompts generated by a large language model node using this node. This facilitates subsequent analysis or use as input for other image generation tasks, enabling workflow archiving and reuse.
Notes
When using this node, note that its output path depends on ComfyUI's configuration. If the specified output_folder is not an absolute path, it will default to being saved under ComfyUI's output directory. Ensure you have write permissions for the output directory to avoid save failures.
Save String KJ Node Source Code Link
The Save String KJ node is from the ComfyUI-KJNodes node package.
Comments
Sign in with GitHub to join the discussion.