Nodes/CRT-Nodes/Load Last Latent (CRT)
ComfyUI Node

Load Last Latent (CRT)

Load Last Latent (CRT)

By PGCRT·Created 2 years ago·Updated a day ago· 132
Load Last Latent (CRT)
    • LATENT
    folder_path
    sort_bydate
    invert_orderfalse

    Load Last Latent (CRT) is the latent-space twin of Load Last Image (CRT). It watches a folder and hands you the most recent .safetensors latent file it finds - directly as a LATENT, no VAE decode in between. If you're doing iterative work on latents - progressive refinement, latent-space loops, feeding a saved latent back into a sampler - this is the node that makes the round trip painless.

    Why skip the decode? Every time you decode a latent to pixels and re-encode it for another sampling pass, you're losing a little information and adding a little VAE error. The detect-crop-refine and iterative-upscale workflows in the knowledge base lean on the fact that staying in latent space keeps the signal clean. Pair this with the pack's Save Latent With Path (CRT) - render, save the latent, then on the next run load the latest one straight back into a KSampler's latent port and continue. That's a genuine "resume the render" pattern that pixel-space loading can't give you cleanly.

    It works the same way as the image version. folder_path is an absolute path (real filesystem, not the ComfyUI input folder), sort_by flips between date and alphabetical, and invert_order reverses the selection. Defaults grab the newest file by mtime. It reads any .safetensors file in the folder and looks for a latent key inside - which is exactly the format the CRT save node writes, so the pair is designed to interoperate.

    The one behavior that makes it loop-friendly is its failure mode: if the folder doesn't exist, is empty, or contains no readable latent, it prints a warning and returns None instead of killing the queue. That's deliberate - the pack's own comments call it out - and it matters for first-iteration loops where there's no prior latent yet. Downstream, handle the None the way you would any missing value: guard it, or let a pass-through node catch it. The single output is LATENT, wired straight into a sampler or a Latent operation.

    Install with the pack: ComfyUI Manager → search "CRT-Nodes", or git clone https://github.com/plugcrypt/CRT-Nodes.git into custom_nodes and restart. It uses only safetensors loading - no models, no heavy dependencies. If you've ever found yourself re-decoding and re-encoding a latent just to feed it back in, this is the workflow-shortcut node that quietly removes that step.

    CategoryCRT/Load

    Inputs (3)

    NameTypeDefaultDescription
    folder_pathSTRING
    sort_byCOMBOdate2 options: date, alphabetical
    invert_orderBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    LATENTLATENT