Visit ComfyUI Online for ready-to-use ComfyUI environment
Load file once from disk to avoid redundant loading, improving efficiency and saving resources.
The LF_LoadFileOnce node is designed to load a file from disk a single time, ensuring that the file is not repeatedly loaded during subsequent executions. This node is particularly useful for scenarios where you need to read a file's content once and avoid redundant file access, which can save time and system resources. By leveraging this node, you can streamline workflows that involve file reading operations, making them more efficient and less prone to errors related to multiple file accesses. The node reads the file from the specified directory, processes it, and returns the file data along with its name, ensuring that the file is only loaded if it hasn't been previously processed.
This parameter specifies the directory path where the file is located. It is crucial for the node to know the exact location to search for the file. The directory path should be a valid path on your system. There are no specific minimum or maximum values, but it must be a valid directory path.
This boolean parameter determines whether the node should search within subdirectories of the specified directory. If set to True
, the node will include subdirectories in its search; if False
, it will only search the specified directory. The default value is False
.
This boolean parameter indicates whether the file extension should be stripped from the file name. If set to True
, the file name will be returned without its extension; if False
, the file name will include the extension. The default value is False
.
This boolean parameter enables or disables the history feature. When enabled, the node keeps track of previously loaded files to avoid reloading them. This is useful for ensuring that each file is processed only once. The default value is False
.
This parameter accepts a JSON string that contains the history of previously loaded files. It is used in conjunction with the enable_history
parameter to track and manage file loading history. The JSON string should be properly formatted to be parsed correctly.
This parameter is used internally to identify the node instance. It is typically managed by the system and does not require manual input.
This output parameter contains the binary data of the loaded file. It represents the actual content of the file that was read from the disk. This data can be used in subsequent nodes or processes that require the file's content.
This output parameter provides the name of the loaded file. Depending on the strip_ext
parameter, this name may or may not include the file extension. It is useful for identifying the file in subsequent operations or for logging purposes.
dir
parameter is set to the correct directory path where your file is located to avoid file not found errors.subdir
parameter to control whether the node should search within subdirectories, which can be useful for organizing files in nested folders.strip_ext
parameter if you need the file name without its extension for further processing or naming conventions.enable_history
parameter to prevent reloading the same file multiple times, which can optimize performance in workflows that process large numbers of files.history
parameter to accurately track previously loaded files and avoid redundant processing.dir
parameter is set to the correct directory path and that the file exists in that location.history
parameter contains an improperly formatted JSON string.history
parameter is correctly formatted and valid.© Copyright 2024 RunComfy. All Rights Reserved.