Sign In

Tool to easily merge models

Tool to easily merge models

I had to merge models together but I couldn't find an easy tool to use so I created one:

https://github.com/frutiemax92/ModelMergeTool

First you need to download the whole repository either with git or by downloading the zip file.

You need to run this command in the main folder to install the required python packages:

pip install -r requirements.txt

After that, copy all the models you want to merge in the safetensor format in the models folder. Then open a command prompt in the folder containing main.py and launch this command:

python main.py

You will have a GUI that will show up in your command prompt:

The tool is very primitive but easy to use : you assign a ratio for each model you want to merge i.e. in this example both model will have a weight of 0.5 which means the output will be the average of the two models. Don't worry if the sum of ratios is not equal one, the program will normalize the ratios. This will work for example:

You can select the model file you want to merge and also add more models so you can merge them in one shot. When the configuration seems good to you, just click on Merge models, it might take a while to merge depending on the number of models and their size. It should output a out.safetensors in the same folder as main.py.

Anyway, this tool should work for any model, including SD 1.5, SDXL, Pixart Sigma, etc., as long as the file is a .safetensors! I hope this short article will help you to merge more easily models and experiment more quickly!

9

Comments