Merge models with separate rate for each 25 U-Net block (input, middle, output).
 
 
 
Go to file
bbc_mc 480debf86f prepare for Release. document update
doc: add new README/README.ja for new feature
fix: bugfix
2022-12-25 23:56:52 +09:00
csv Fix preset.tsv, ALL_A and ALL_B must be reverted because ALL_A should mean "ModelA 100%". 2022-12-25 19:43:47 +09:00
javascript Big update with functions, keeping current function and UIs 2022-12-25 20:06:26 +09:00
misc prepare for Release. document update 2022-12-25 23:56:52 +09:00
scripts prepare for Release. document update 2022-12-25 23:56:52 +09:00
.gitignore Big update with functions, keeping current function and UIs 2022-12-25 20:06:26 +09:00
README.md prepare for Release. document update 2022-12-25 23:56:52 +09:00
README_each.ja.md prepare for Release. document update 2022-12-25 23:56:52 +09:00
README_each.md prepare for Release. document update 2022-12-25 23:56:52 +09:00
style.css Big update with functions, keeping current function and UIs 2022-12-25 20:06:26 +09:00

README.md

Merge Block Weighted - GUI

Recent Update

What is this

How to Install

  • Go to Extensions tab on your web UI
  • Install from URL with this repo URL
  • Install
  • Restart Web UI

How to use

Select model_A and model_B, and input Output model name

  • if checkpoint is updated, push Reload Checkpoint button to reload Dropdown choises.

Set merge ratio for each block of U-Net

  • Select Presets by Dropdown

    You can manage presets on tsv file (tab separated file) at extention/<this extension>/csv/preset.tsv

  • or Input at GUI Slider

  • "INxx" is input blocks. 12 blocks

  • "M00" is middle block. 1 block

  • "OUTxx" is output blocks. 12 blocks

  • You can write your weights in "Textbox" and "Apply block weight from text"

    • Weights must have 25 values and comma separated

Setting values

  • set "base_alpha"
base_alpha
0 merged model uses (Text Encoder、Auto Encoder) 100% from model_A
1 marged model uses (Text Encoder、Auto Encoder) 100% from model_B

Other settings

Settings
verbose console output Check true, if want to see some additional info on CLI
Allow overwrite output-model Check true, if allow overwrite model file which has same name.
  • Merged output is saved in normal "Model" folder.

Other function

Save Merge Log

  • save log about operated merge, as below,

  • log is saved at extension/<this extension>/csv/history.tsv

Sample/Example

  • kohya_ss さんのテストを再現してみる

  • 準備する/マージして作るモデルは、以下の通り / Prepare models as below,

    Model Name
    sd-v1.5-pruned Stable Diffusion v1.5
    wd-v1.3-float32 wd v1.3-float32
    SD15-WD13-ws50 通常マージしたもの
    SD15 + WD13, 0.5 # Weighted sum 0.5
    bw-merge1-2-2 Merge Block Weighted
    SD15 and WD13. base_alpha=1
    weightは後述1
    bw-merge2-2-2 Merge Block Weighted
    SD15 and WD13. base_alpha=0
    weightは後述2
  • テスト用のGeneration Info, Seedは 14 の4つ

    masterpiece, best quality, beautiful anime girl, school uniform, strong rim light, intense shadows, highly detailed, cinematic lighting, taken by Canon EOS 5D Simga Art Lens 50mm f1.8 ISO 100 Shutter Speed 1000
    Negative prompt: lowres, bad anatomy, bad hands, error, missing fingers, cropped, worst quality, low quality, normal quality, jpeg artifacts, blurry
    Steps: 40, Sampler: Euler a, CFG scale: 7, Seed: 1, Face restoration: CodeFormer, Size: 512x512, Batch size: 4
    

result (x/y)

  • 変化傾向は、

    • bw-merge1 で、顔立ちがややアニメ化 (sd15-wd13-ws50と比較して)
    • bw-merge2 で、ややリアル風(特に seed=3 の目が良い)
  • おおまかに見て、kohya_ss さんの結果と同様の方向性になった。実装は問題ないと判断する

後述1: weight1

1, 0.9166666667, 0.8333333333, 0.75, 0.6666666667,
0.5833333333, 0.5, 0.4166666667, 0.3333333333, 0.25, 0.1666666667,
0.0833333333,
0,
0.0833333333,0.1666666667,0.25,0.3333333333,0.4166666667,0.5,
0.5833333333,0.6666666667,0.75,0.8333333333,0.9166666667,1.0

後述2: weight2

0,0.0833333333,0.1666666667,0.25,0.3333333333,0.4166666667,0.5,
0.5833333333,0.6666666667,0.75,0.8333333333,0.9166666667,
1.0,
0.9166666667, 0.8333333333, 0.75, 0.6666666667,
0.5833333333, 0.5, 0.4166666667, 0.3333333333, 0.25, 0.1666666667,
0.0833333333, 0

Special Thanks