Skip to content
yownas edited this page Jul 4, 2024 · 2 revisions

Checkpoint/LoRA merging

Ruined Fooocus support on-demand merging of checkpoints (and LoRAs). Instead of keeping multiple versions of huge (gigabyte) merged checkpoints you can have merge-files that are small (hundred of bytes) recipes. RF will load multiple checkpoints and LoRAs and mix them according to your specs and use it. You can optionally tell Ruined Fooocus to save a merged version if you want to load things faster, or share a merge with someone.

Main usage could be saving disk space if you want to have different blends of checkpoints or speed things up and make things easier by creating a merge file that contain your favorite checkpoint and LoRAs. If you want a nice preview, just replace the .jpeg in cache/checkpoints.

The merge files are json, to make sure they are properly formatted you can check it at jsonlint.com.

Format

  • "comment": A short comment that will show when the merge file is loaded.
  • "base": The base model to start with. You need to specify "name" and "weight".
  • "models": Models to mix the base model with.
  • "loras": LoRAs to add.
  • "normalize": The "weight" of the resulting checkpoint. You probably want this to always be 1.0. All other models will be weighted against each other.
  • "cache": true or false, depending if you want the merged model to be saved in cache/merges as a .safetensor.

Example of models/checkpoints/my_test.merge:

{
  "comment": "My test merge",
  "base": {
    "name": "crystalClearXL_ccxl.safetensors",
    "weight": 2
  },
  "models": [
    {
      "name": "colossusProjectXLSFW_v53Trained.safetensors",
      "weight": 1
    }
  ],
  "loras": [
    {
      "name": "frieren_xl_2-000012.safetensors",
      "weight": 0.8
    }
  ],
  "normalize": 1.0,
  "cache": true
}
Clone this wiki locally