Nodes/ComfyUI-YogurtNodes/Save LoRA (Yogurt Nodes)
ComfyUI Node

Save LoRA (Yogurt Nodes)

Save a LoRA state back to disk, not just load one

By yogurt7771·Created 2 years ago·Updated 9 days ago· 1
Save LoRA (Yogurt Nodes)
  • lora
    filenameyogurt_lora.safetensors
    output_dir/tmp/ComfyUI/output
    remove_zero_layersfalse

    Most LoRA nodes in ComfyUI are one-directional: load a LoRA, apply it to a model, forget it. Save LoRA is the closing bracket of that story - it takes a LoRA state and writes it back out as a .safetensors file. Which raises the obvious question: why would you ever need to save a LoRA you already have?

    Because this pack is built around editing LoRAs, not just applying them. Look at its Model nodes: Load LoRA Only (load without applying), LoRA Merge Full Rank, LoRA Simple Add, LoRA Rank Compress, LoRA Scale Weights, LoRA Scale Alpha, Convert LoRA Keys. All of those produce a modified LoRA state in memory. Save LoRA is the node that turns the result into a file you can actually use - reload in any loader, share with someone, or drop into a trainer. It's the same idea as "merge checkpoints and save the merge," just for LoRA tensors.

    The inputs

    • lora - the LoRA state to save. This is a LORA typed input, which matters: it expects the raw LoRA state object, not a model. Standard ComfyUI LoraLoader applies a LoRA to a model and outputs MODEL/CLIP - that's not what this node wants. Feed it from the pack's Load LoRA Only node, or from its LoRA operation nodes, which pass the state around directly.
    • filename - target filename, extension optional. Defaults to yogurt_lora.safetensors; the .safetensors gets appended if you leave it off.
    • output_dir - where to write. Leave defaulted and it goes to the ComfyUI output directory.
    • remove_zero_layers - drop tensor keys that are all zeros before saving. Useful when a merge or a strength scale zeroed out entire layers; the file gets smaller and noiseless tensors don't survive to confuse anyone.

    It's a terminal node - no outputs, marked as an output node so the write result shows up like a save.

    The workflow it enables

    A realistic chain: Load LoRA OnlyLoRA Scale Weights (tune effect so strength=1 works) → Save LoRA → reload the result in any normal loader. Or two LoRAs → LoRA Merge Full Rank → save the merge. This is power-user territory - if you're just applying LoRAs, you don't need any of it. But if you've ever wished a strength setting was baked into the file, or wanted a merged LoRA you could share, this node is the endpoint.

    Install

    Same single pack as everything else:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
    cd ComfyUI-YogurtNodes
    pip install -r requirements.txt
    

    or ComfyUI Manager → ComfyUI-YogurtNodes → install → restart. Find it under Yogurt Nodes → Models. Dependencies are plain numpy/pillow/requests - no training stack to drag in.

    Gotchas

    The LORA input type is the classic tripwire. Drag a wire from a regular LoraLoader and nothing will connect - that's by design, it takes the pack's raw LoRA state, not an applied model. Also, "extension optional" cuts both ways: give it a path with a directory and it'll honor it, but keep it simple. And if your saved file loads as a no-op later, that's usually the remove_zero_layers toggle interacting with an aggressive scale - re-save without it and compare file sizes.

    CategoryYogurtNodes/Models

    Inputs (4)

    NameTypeDefaultDescription
    loraLORALoRA state to save.
    filenameSTRINGyogurt_lora.safetensorsTarget filename (extension optional).
    output_diroptSTRING/tmp/ComfyUI/outputDirectory path. Defaults to ComfyUI output directory.
    remove_zero_layersoptBOOLEANfalseDrop tensor keys that are all zeros before saving.

    Outputs (0)

    No outputs