Nodes/CRT-Nodes/Save Latents Conditioning (CRT)
ComfyUI Node

Save Latents Conditioning (CRT)

Freeze a latent and its conditioning into one file, so you can re-run the exact same scene later

By PGCRT·Created 2 years ago·Updated 13 days ago· 132
Save Latents Conditioning (CRT)
  • latent
  • conditioning
    folder_path
    subfolder_name
    filename
    suffix
    overwritetrue

    Here's the workflow pain this node exists to solve: you've built a video generation graph that starts from a latent and a conditioning, and you want to re-run the sampler later - with the exact same starting latent and the same text conditioning - without rebuilding the whole front half of the graph every time. Normally you'd save the latent with one node and re-encode the prompt with another, which means keeping the CLIP loaded and re-tokenizing on every run. SaveLatentsConditioning collapses both into a single .safetensors file, and its sibling LoadLatentsConditioning reads them back together.

    How it works

    It's dead simple under the hood: a safetensors.torch.save_file call that writes the latent samples and the conditioning tensors into one file, with a metadata header describing what's inside. It's an output node - it doesn't return anything, it just saves. The inputs:

    • latent and conditioning - the pair to bundle.
    • folder_path + subfolder_name - where it lands; the folder is created if missing.
    • filename - leave empty to number files incrementally from 0; give it a name to get that exact name.
    • suffix - appended to the name, handy for tagging runs (_hd, _v2).
    • overwrite - on by default; turn it off and existing files get _001, _002... suffixes instead of being clobbered.

    So a run looks like: latent and conditioning in, MyScene_v2.safetensors out. The name-and-numbering logic is the part that actually matters for workflow hygiene - with overwrite off and empty filename you get a clean numbered sequence you can treat like a frame-indexed archive.

    Why bother

    The win is reproducibility plus a lighter graph. The saved pair is a stable checkpoint of "the scene before the sampler"; you can swap samplers, steps, or seeds downstream and keep the exact same start. And because the conditioning is already encoded, the load half doesn't need the CLIP at all. That's the pattern this pack also uses for its audio-pairing trick - the Load node will even grab a same-named audio file next to the .safetensors if one exists, which makes this pair the backbone of a "save the whole scene, rerun with new music" style workflow.

    Install

    Part of CRT-Nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/PGCRT/CRT-Nodes
    pip install -r requirements.txt
    

    Or ComfyUI Manager → search CRT-Nodes, then restart. No model downloads, no special dependencies beyond safetensors, which ComfyUI already bundles. It's one of the pack's quiet workhorse nodes: nothing flashy, but once you've used the pair once, you'll reach for it whenever a scene is worth keeping around.

    CategoryCRT/Save

    Inputs (7)

    NameTypeDefaultDescription
    latentLATENT
    conditioningCONDITIONING
    folder_pathSTRINGBase folder path to save the file
    subfolder_nameSTRINGSubfolder name within the base folder
    filenameSTRINGFile name (without extension). Leave empty to number files incrementally starting at 0.
    suffixSTRINGOptional suffix appended to filename.
    overwriteBOOLEANtrueIf enabled, existing files will be overwritten. If disabled, a numbered suffix like _001 is added.

    Outputs (0)

    No outputs