Visit ComfyUI Online for ready-to-use ComfyUI environment
Extract specific lines of text from files for structured data handling, aiding AI artists in text processing workflows.
The Text Load Line From File node is designed to read and extract specific lines of text from a file, providing a convenient way to handle text data in a structured manner. This node is particularly useful for AI artists who need to process text files, such as scripts, logs, or any other text-based data, by loading lines either sequentially or by a specified index. The node supports different modes of operation, including automatic line retrieval and indexed access, ensuring flexibility in how text data is accessed and utilized. By leveraging this node, you can efficiently manage and manipulate text data, enhancing your workflow and enabling more dynamic text-based operations.
This parameter specifies the path to the text file you want to load. It is a string input that should contain the full path to the file. If the file path is not provided or is incorrect, the node will not be able to locate and read the file. The default value is an empty string, and it is essential to ensure the correct path is specified for the node to function properly.
This parameter allows you to name the dictionary that will store the lines of text from the file. By default, it is set to [filename]
, which means the dictionary will be named after the file. You can customize this name to better organize and reference the text data within your workflow. This is a string input and should be a valid dictionary name.
This parameter is used to label the text batch, which helps in managing and retrieving text data across different operations. It is particularly useful when working with multiple text files or batches, allowing you to keep track of the text data more efficiently. The default value is TextBatch
.
This parameter determines the mode of operation for loading lines from the file. It can be set to automatic
or index
. In automatic
mode, lines are retrieved sequentially, while in index
mode, a specific line is accessed based on the provided index. This flexibility allows you to choose the most suitable method for your text processing needs.
This parameter is used in conjunction with the index
mode to specify which line to retrieve from the file. It is an integer input that indicates the position of the line in the file. If the index is out of range, the node will handle it appropriately by wrapping around or returning an error. The default value is 0.
This optional parameter allows you to provide multiline text directly instead of loading from a file. If provided, the node will process this text as if it were read from a file, splitting it into lines and handling it according to the specified mode and index. This is useful for quick testing or when the text data is not stored in a file.
This output parameter returns the line of text that was loaded from the file. It is a string containing the specific line based on the mode and index parameters. This output can be used directly in your workflow for further text processing or analysis.
This output parameter returns a dictionary containing all the lines of text from the file, organized under the specified dictionary name. This allows you to access and manipulate the entire text data set, providing a comprehensive view of the file's contents.
index
mode when you need to access specific lines repeatedly, and the automatic
mode for sequential processing.multiline_text
parameter for quick tests or when the text data is not available in a file format.<file_path>
specified cannot be found.<index>
.© Copyright 2024 RunComfy. All Rights Reserved.