Skip to content

Latest commit

 

History

History

checkpoint-merging

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Checkpoint merging

Intro

This guide uses the diffusers library to merge checkpoints. It requires checkpoints to be in the diffusers accepted format. If you need to convert original sd checkpoints to diffusers, you can follow this guide.

Setup

  1. Install dependencies

    pip install omegaconf safetensors diffusers transformers torch
  2. Download the models you would like to merge. In this example, we'll use one checkpoint from civitai.

    wget https://civitai.com/api/download/models/9901 -O 9901.safetensors
    wget https://civitai.com/api/download/models/6987 -O 6987.safetensors
  3. Convert the checkpoint as described in the intro link. For example, if your script is named convert.py, do the following:

    python convert.py --checkpoint_path 9901.safetensors --dump_path refined_checkpoint/ --scheduler_type pndm --from_safetensors
    python convert.py --checkpoint_path 6987.safetensors --dump_path realistic_vision_v1.3_checkpoint/ --scheduler_type pndm --from_safetensors
    
  4. First let's generate some images with the different models and the same seed to use as a reference.

    python generate.py
    python generate2.py

    Refined Realistic

  5. Merge models.

    python merge.py

    Merge