santa hat
deerdeer nosedeer glow
Sign In

How to use Chattiori's Model Merger / BismuthMix V4.0 Recipe

How to use Chattiori's Model Merger / BismuthMix V4.0 Recipe

Link to the model merger is HERE!

For the demo script(Colab), click HERE!

!! Update Jul 10 23: Add Finetune

Hi, I'm Chattiori (Merge creator of BismuthMix, AnyOrangeMix, CloverMix and LunaReality).

In this article, I'm going to share how to use my original model merger: Chattiori's Model Merger, and the recipe of BismuthMix V4.0.

Without using it, you can't recreate the model.

What is Chattiori's Model Merger

Chattiori's Model Merger is Python Based Command Line Model Merger.

This merger is mainly focused on for using it on Colab but it can also used on computers as well.

Among other model mergers, it has lots of potential.

  1. Because it uses CUI, VRAM is relatively smaller than most of mergers.

  2. Same as SD-webui's checkpoint merger, it can load both .ckpt files and .safetensors files.

  3. Can bake vae to the checkpoint.

  4. Some merge methods from sd-webui super merger like Block-weighted Merging, Elemental Merging, Triple Sum and Sum Twice can be used.

  5. Random block weight merge is available. (Different from super merger's one)

  6. Can do Add Difference while using all three models.

  7. Can prune the checkpoint without loosing details.

(For especially Colab users,) It can also Automatically delete the source checkpoints after making the merged one so it allows users making the merge smoother.

How to use it

As I mentioned before, you can use this on your own computer and Colab.

Requires

  • pytorch-lighting for ckpt

  • torch safetensors for safetensors

Steps(For PC)

  1. Install the merger from the link and open it.

  2. Make models file and vae file on the same root as the merge.py.

  3. Install checkpoints into models file and vae to vae file.

  4. Open cmd, cd to the file that merger is placed and execute the program.

Steps(For Colab)

  1. Install the merger using
    !git clone https://github.com/Faildes/merge-models

  2. Do the exact same thing as 2, 3 in For PC.

  3. Execute the program.

On usage, I wrote down the form to execute the program.

Usage

The information down below is some useful commands of it.

Mode:

  • "WS" for Weighted Sum

  • "SIG" for Sigmoid Merge

  • "GEO" for Geometric Merge

  • "MAX" for Max Merge

  • "AD" for Add Difference (requires model2)

  • "sAD" for Smooth Add Difference (requires model2)

  • "TD" for Training Difference (requires model2)

  • "TRS" for Triple Sum (requires model2 and beta)

  • "ST" for Sum Twice (requires model2 and beta)

  • "TS" for Tensor Sum (requires beta)

  • "NoIn" for No Interporation

  • "RM" for Read Metadata, exports metadata as json

Form: python merge.py mode model_path model_0 model_1 --alpha 0.5 --output merged

Example: python merge.py "WS" "C:...\Model parent file path" "FILE A.ckpt" "FILE B.safetensors" --alpha 0.45 --vae "C:...\VAE.safetensors" --prune --save_half --output "MERGED"

Additional commands

  • --model_2 sets the tertiary model, if omitted.

  • --alpha controls how much weight is put on the second model and --beta controls that on third model. Both defaults to 0, if omitted

    Can be written in float value, Merge Block Weight type writing and Elemental Merge type writing.

  • --rand_alpha randomizes weight put on the second model, and --rand_beta randomizes weight put on the third model, if omitted

    Need to be written in str like "MIN, MAX, SEED".

    If SEED is not setted, it will be completely random (generates seed).

    Or "MIN, MAX, SEED, [Elemental merge args]" if you want to specify.

    Check out Elemental Random for Elemental merge args.

  • --vae sets the vae file by set the path, if omitted

  • --cosine0 determines to favor model0's structure with details from 1 and --cosine1 works opposite, if omitted

    Check out Calcmode by hako-mikan for the information.

  • --fine determines adjusting the outcomes' color, contrast and detail, if omitted

    Check out Elemental for the imformation.

  • --save_half determines whether save the file as fp16, if omitted

  • --prune determines whether prune the model, if omitted

  • --save_safetensors determines whether save the file as safetensors, if omitted

  • --output is the filename of the merged file, without file extension. Defaults to "merged", if omitted

  • --delete_source determines whether to delete the source checkpoint files, not vae file, if omitted

Of course there are some other settings you can do so check those out HERE!

BismuthMix v4.0 Merge Recipe

Tools

Source Models

Merge Recipe

Mode, merge models, alpha (beta)(, option) >> result

VAE: vae-ft-mse-840000-ema-pruned.safetensors

Global Settings: save as fp16, prune, save as safetensors, delete source files, bake vae

Recipe:

  • Sum Twice, real-max-v3.4 + GeminiX Mix v1.0 + Kawaii Realistic Asian Mix v0.3, rand_alpha(0.3, 0.6, 69420) rand_beta(0.2, 0.4, 42069) >> 00a

  • Sum Twice, Shampoo Mix-v4.0 + majicMix realistic-v6 + CyberRealistic-v3.1, rand_alpha(0.3, 0.6, 664728) rand_beta(0.2, 0.7, 883528) >> 00b

  • Sum Twice, Ikigai SR v1.0 + VivChar Mix V5 NewEra + CalicoMixReal v2.0, rand_alpha(0.2, 0.4, 634289) rand_beta(0.25, 0.5, 16299) >> 00c

  • Sum Twice, 00a + 00b + yayoi_mix v1.31, rand_alpha(0.3, 0.5, 77251) rand_beta(0.2, 0.4, 142783) >> 0a

  • Sum Twice, 00c + Kawaii Realistic European Mix v0.1 + Wyvern Mix v9, rand_alpha(0.2, 0.55, 3235211) rand_beta(0.15, 0.35, 91826) >> 0b

  • Sum Twice, epiCRealism pureEvolution V2 + ThisIsReal-V1.0 + Curious Merge 2.5D v5.0, rand_alpha(0.3, 0.45, 1975244) rand_beta(0.2, 0.4, 719529) >> 0c

  • Sum Twice, kisaragi_mix v2.2 + mutsuki_mix v2.0 + Juggernaut v2.1, rand_alpha(0.25, 0.65, 814396) rand_beta(0.1, 0.35, 237901) >> 0d

  • Sum Twice, XXMix_9realistic v3.0 + CLEAR-mix v1.0 + Blessing Mix V1, rand_alpha(0.2, 0.6, 7108239) rand_beta(0.3, 0.65, 925981) >> 0e

  • Sum Twice, 0b + 0a + LEAU v1.0, rand_alpha(0.35, 0.75, 81628) rand_beta(0.1, 0.25, 72916) >> 1a

  • Sum Twice, 0c + 0d + 0e, rand_alpha(0.1, 0.5, 7748638) rand_beta(0.15, 0.4, 643927) >> 1b

  • Sum Twice, Dream Shaper v6.31_baked + fantasticmix v6.5 + LRM Liangyiu's Realistic Mix v1.1, rand_alpha(0.1,0.45,7748322) rand_beta(0.25, 0.6, 845522) >> 1c

  • Triple Sum, ChillyMix V2 + AIbijoModel no47p22 + realidefmix v3.5_baked, rand_alpha(0.2, 0.4, 443182) rand_beta(0.2, 0.4, 642738) >> 1d

  • Sum Twice, Noble Mix Fix v3.0 + MagMix v6 + Hydra Mix v1.0, rand_alpha(0.35, 0.5, 10663418) rand_beta(0.35, 0.6, 88264916) >> 1e

  • Sum Twice, DDosMix v2 + Matrix-Asian-Paradise v65.3 + X-FlareMix Real, rand_alpha(0.3, 0.65, 6491882) rand_beta(0.15, 0.4, 624918) >> 2a

  • Sum Twice, 1a + 1d + SweetMuse v01_VAE, rand_alpha(0.4, 0.7, 911528) rand_beta(0.2, 0.5, 773537) >> 2b

  • Sum Twice, 2b + 1b + 1e, rand_alpha(0.2, 0.45, 13572) rand_beta(0.3, 0.45, 721483) >> 3a

  • Sum Twice, 2a + 1c + majicMix fantasy v2.0, rand_alpha(0.2, 0.4, 614398) rand_beta(0.2, 0.4,885378) >> 3b

  • Sum Twice, PerfectDeliberate v4.0 + Mauve v1.0 + C3 v1.08, rand_alpha(0.35, 0.65, 9271588) rand_beta(0.2, 0.45, 928158) >> 3c

  • Sum Twice, Mix Anime Realistic v1.9F + Hyper v2 + AbsoluteReality v1, rand_alpha(0.25, 0.45, 6319923) rand_beta(0.15, 0.35, 183599) >> 3d

  • Sum Twice, 3a + 3b + Am I Perfection v2.0, rand_alpha(0.4, 0.6, 463811) rand_beta(0.15, 0.35,519176) >> 4a

  • Sum Twice, El_Zipang v1.0 + 3c + 3d, rand_alpha(0.2, 0.5, 553799) rand_beta(0.2, 0.5, 725142) >> 4b

  • Sum Twice, 4a + 4b + RetMix v2.0, rand_alpha(0.15, 0.45, 725188) rand_beta(0.1, 0.3, 77352) >> BismuthMixV4

24

Comments