Nodes/RES4LYF/UNetSave
ComfyUI Node Runs on cloud

UNetSave

Bake a patched model to disk so you stop re-running the merge

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
UNetSave
  • model
    filename_prefixmodels/ComfyUI

    RES4LYF is mostly known as a sampler pack - the thing that shipped beta57 and 69 solvers and quietly became the default way people tune samplers on flow-matching models. UNetSave is the boring, useful node buried in the same repo: it saves whatever's currently on your model wire straight to a .safetensors file, no CLIP, no VAE, just the diffusion model.

    You reach for this after you've done work upstream that you don't want to redo every time you hit queue. Say you've merged a couple of checkpoints, applied a block-weight patch, run something through one of RES4LYF's own ClownStyle_* style-transfer nodes, or patched a model with a fix like the pack author's ReFluxPatcher. All of that lives only in memory as a chain of graph nodes until you save it. UNetSave is the "commit this" button - point it at the end of your patch chain and it writes out a static model file you can load later with a plain model loader, instead of rebuilding the whole patch graph from scratch every session.

    How it works

    ComfyUI keeps patched models as live Python objects passed node to node; nothing touches disk unless a save node runs. UNetSave uses the same checkpoint-writing machinery ComfyUI's own save nodes use, just scoped to the model tensor only - it doesn't touch or bundle a CLIP or VAE the way a full checkpoint save would.

    The inputs and outputs that matter

    There are only two inputs, both required:

    • model (MODEL) - wire in whatever's at the end of your merge/patch chain. Whatever state that model object is in when it hits this node is what gets written.
    • filename_prefix (STRING, default models/ComfyUI) - both the path and the base filename. ComfyUI treats this as a prefix under your output directory, so checkpoints/my-merge both organizes the file into a subfolder and names it.

    There's no output - UNetSave is a sink (is_output_node: true). It runs, writes the file, and that's it; there's nothing to wire onward from it.

    How to install it

    Through ComfyUI Manager: search "RES4LYF", install, restart. Manually:

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

    (swap pip for your embedded Python's pip if you're on the portable build), then restart ComfyUI.

    Common issues & troubleshooting

    Loading the saved file back needs its own CLIP and VAE. You only saved the diffusion model, so a plain checkpoint-load workflow will complain about missing CLIP/VAE. That's expected - load it with a UNet-only loader and wire your usual CLIP/VAE back in separately, same as you did before saving.

    It fires on every queue if it's in the executed path. Because it's a real output node, ComfyUI will happily rewrite the same file every single run if you leave it wired in. Once you've saved the merge you wanted, mute or bypass the node so you're not burning disk I/O (or overwriting a file you meant to keep) on unrelated generations downstream.

    A typo in filename_prefix won't error, it'll just make a folder. ComfyUI creates whatever subfolders the prefix implies under output/. If your saved file isn't where you expected, check for a stray folder from a typo before assuming the save failed.

    File size is smaller than you might expect if you're used to full checkpoints - that's the point. No duplicated CLIP/VAE weights along for the ride, just the model.

    CategoryRES4LYF/model_merging

    Inputs (2)

    NameTypeDefaultDescription
    modelMODEL
    filename_prefixSTRINGmodels/ComfyUI

    Outputs (0)

    No outputs