ComfyUI > Nodes > CRT-Nodes > Load Last Latent (CRT)

ComfyUI Node: Load Last Latent (CRT)

Class Name

LoadLastLatent

Category
CRT/Load
Author
CRT (Account age: 1707days)
Extension
CRT-Nodes
Latest Updated
2026-03-16
Github Stars
0.1K

How to Install CRT-Nodes

Install this extension via the ComfyUI Manager by searching for CRT-Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter CRT-Nodes in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Load Last Latent (CRT) Description

Automates retrieval of the latest latent data by sorting and loading files from a directory.

Load Last Latent (CRT):

The LoadLastLatent node is designed to streamline the process of retrieving and loading the most recent latent data from a specified directory. This node is particularly beneficial for AI artists who frequently work with latent files, as it automates the task of identifying and loading the latest file based on user-defined sorting preferences. By leveraging this node, you can efficiently manage your workflow, ensuring that you are always working with the most up-to-date latent data. The node supports sorting by modification date or alphabetically, providing flexibility in how files are prioritized. Additionally, it handles potential errors gracefully, ensuring a smooth user experience even when issues arise, such as missing files or incorrect file formats.

Load Last Latent (CRT) Input Parameters:

folder_path

The folder_path parameter specifies the directory where the latent files are stored. It is crucial for the node to know where to look for the files you want to load. If the directory does not exist or is incorrectly specified, the node will not be able to retrieve any files, resulting in an error. Ensure that the path is accurate and accessible.

sort_by

The sort_by parameter determines the criteria used to sort the latent files within the specified directory. You can choose to sort by "date" to prioritize the most recently modified files or opt for alphabetical sorting. This parameter impacts which file is considered the "last" and subsequently loaded by the node.

invert_order

The invert_order parameter is a boolean that, when set to True, reverses the sorting order. For example, if sorting by date, setting this to True will load the oldest file instead of the newest. This parameter provides additional control over file selection, allowing you to tailor the node's behavior to your specific needs.

pass_output

The pass_output parameter is a boolean toggle that determines whether the node should proceed with loading the latent file. If set to False, the node will return None, effectively bypassing the loading process. This can be useful in scenarios where conditional logic is applied to decide whether or not to load a file.

Load Last Latent (CRT) Output Parameters:

samples

The samples output parameter contains the loaded latent data in a format ready for further processing within ComfyUI. This output is crucial as it represents the actual data extracted from the latest latent file, allowing you to seamlessly integrate it into your creative workflow. The data is detached and cloned to ensure it is isolated from the original source, providing a stable and reliable output for subsequent operations.

Load Last Latent (CRT) Usage Tips:

  • Ensure that the folder_path is correctly set to the directory containing your latent files to avoid errors related to missing files.
  • Use the sort_by parameter to control which file is considered the "last" based on your workflow needs, whether you prioritize the most recent or alphabetically last file.
  • Utilize the invert_order parameter to reverse the sorting order if you need to load the oldest file instead of the newest.
  • Set pass_output to True only when you are certain you want to load a file, as setting it to False will skip the loading process.

Load Last Latent (CRT) Common Errors and Solutions:

Folder not found at '<folder_path>', returning None.

  • Explanation: This error occurs when the specified folder_path does not exist or is inaccessible.
  • Solution: Verify that the folder_path is correct and that the directory is accessible. Ensure there are no typos in the path.

No '.safetensors' files found in '<folder_path>', returning None.

  • Explanation: The node could not find any files with the .safetensors extension in the specified directory.
  • Solution: Check that the directory contains latent files with the correct extension. If necessary, convert or rename files to match the expected format.

ERROR - No 'latent' key found in safetensors file '<latent_filename>'.

  • Explanation: The loaded file does not contain the expected 'latent' key, indicating a potential issue with the file format.
  • Solution: Ensure that the file is correctly formatted and contains the necessary data. Consider regenerating the file if it is corrupted or incomplete.

ERROR - Failed to load file '<latent_filename>': <error_message>

  • Explanation: An unspecified error occurred while attempting to load the file.
  • Solution: Review the error message for specific details and check the file for issues such as corruption or incorrect formatting. Ensure that the file is accessible and not in use by another process.

Load Last Latent (CRT) Related Nodes

Go back to the extension to check out more related nodes.
CRT-Nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Load Last Latent (CRT)