Repository: stable-diffusion-webui
Issue: [Bug]: CheckPoint merger faulty - always errors out
Labels: bug-report

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Trying to merge two models together thru the checkpoint merger tab in WebUI, given error each time. 

---
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---

### Steps to reproduce the problem

1. Go to .... Checkpoint Merger tab in WebUI
2. Press .... & select two models that you want to merge together
3. ... get error

---
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---

### What should have happened?

Models should have merged seamlessy without errors

### Version or Commit where the problem happens

a3ddf464a2ed24c999f67ddfef7969f8291567be

### What Python version are you running on ?

Python 3.10.x

### What platforms do you use to access the UI ?

Windows

### What device are you running WebUI on?

Nvidia GPUs (GTX 16 below)

### Cross attention optimization

Automatic

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

```Shell
--xformers --autolaunch --opt-split-attention --upcast-sampling
```


### List of extensions

<html><body>
<!--StartFragment-->

Extension | URL | Branch | Version | Date | Update
-- | -- | -- | -- | -- | --
 

<!--EndFragment-->
</body>
</html>Extension 	URL 	Branch 	Version 	Date 	Update
a1111-stable-diffusion-webui-vram-estimator 	https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator.git 	master 	[8ecde47f](https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator/commit/8ecde47f7aac1304058ab5af09702b703191c5f6) 	Tue Jun 13 01:35:05 2023 	unknown
openpose-editor 	https://github.com/fkunn1326/openpose-editor.git 	master 	[722bca6f](https://github.com/fkunn1326/openpose-editor/commit/722bca6fb9b062815d13b950e7040589abaec797) 	Sat Jun 3 04:54:52 2023 	unknown
sd-extension-system-info 	https://github.com/vladmandic/sd-extension-system-info.git 	main 	[9d3c0ca0](https://github.com/vladmandic/sd-extension-system-info/commit/9d3c0ca0f2dc8f8973b3d08f5ec1fa8bbd726155) 	Fri Jul 14 19:46:48 2023 	unknown
sd-webui-ar 	https://github.com/alemelis/sd-webui-ar.git 	main 	[04ee2c6c](https://github.com/alemelis/sd-webui-ar/commit/04ee2c6c60ca4534ab7f2d22518a3c5d2001fe83) 	Thu Jul 6 10:14:29 2023 	unknown
sd-webui-controlnet 	https://github.com/Mikubill/sd-webui-controlnet 	main 	[e9679f8f](https://github.com/Mikubill/sd-webui-controlnet/commit/e9679f8fc50880a92d6f1b6fc1aabad41079efd5) 	Sun Jul 23 18:15:05 2023 	unknown
stable-diffusion-webui-daam 	https://github.com/toriato/stable-diffusion-webui-daam 	master 	[0906c850](https://github.com/toriato/stable-diffusion-webui-daam/commit/0906c850fb70d7e4b296f9449763d48fa8d1e687) 	Thu Jan 26 04:20:48 2023 	unknown
stable-diffusion-webui-sonar 	https://github.com/Kahsolt/stable-diffusion-webui-sonar.git 	main 	[e9e16c99](https://github.com/Kahsolt/stable-diffusion-webui-sonar/commit/e9e16c996c23cb40e7525743b91cb0bbf55a4907) 	Tue May 9 05:50:47 2023 	unknown
LDSR 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
Lora 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
ScuNET 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
SwinIR 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
canvas-zoom-and-pan 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
extra-options-section 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
mobile 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023 	
prompt-bracket-checker 	[built-in](http://127.0.0.1:7860/) 	None 		Thu Jul 27 12:50:54 2023

### Console logs

```Shell
venv "F:\SUPERSD\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.5.0
Commit hash: a3ddf464a2ed24c999f67ddfef7969f8291567be



Launching Web UI with arguments: --xformers --autolaunch --opt-split-attention --upcast-sampling
2023-07-27 15:50:33,102 - ControlNet - INFO - ControlNet v1.1.233
ControlNet preprocessor location: F:\SUPERSD\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-07-27 15:50:33,506 - ControlNet - INFO - ControlNet v1.1.233
Loading weights [2add404c3a] from F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\MeghindoMerged.ckpt
[VRAMEstimator] Loaded benchmark data.
F:\SUPERSD\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py:4236: UserWarning: You have unused kwarg parameters in JSON, please remove them: {'lines': 0}
  IOComponent.__init__(
F:\SUPERSD\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py:480: UserWarning: You have unused kwarg parameters in Textbox, please remove them: {'default': ''}
  IOComponent.__init__(
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 39.4s (launcher: 10.2s, import torch: 15.6s, import gradio: 2.1s, setup paths: 2.2s, other imports: 2.6s, setup codeformer: 0.2s, list SD models: 0.1s, load scripts: 4.8s, create ui: 1.0s, gradio launch: 0.4s).
Creating model from config: F:\SUPERSD\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: F:\SUPERSD\stable-diffusion-webui\models\VAE\vaeFtMse840000Ema_v10.safetensors
Applying attention optimization: xformers... done.
Model loaded in 13.2s (load weights from disk: 6.5s, create model: 0.9s, apply weights to model: 1.3s, apply half(): 2.2s, load VAE: 0.9s, move model to device: 1.1s, calculate empty prompt: 0.2s).
Calculating sha256 for F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\CodyCSD.ckpt: 99c1133f02c6c1595e4eb4d8a4abd84a27d26477b2255b838d2469d84dcc1fa1
Loading weights [99c1133f02] from F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\CodyCSD.ckpt
Loading VAE weights specified in settings: cached vaeFtMse840000Ema_v10.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 8.7s (calculate hash: 6.1s, load weights from disk: 1.2s, apply weights to model: 0.4s, load VAE: 0.1s, move model to device: 0.9s).

*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
---
Calculating sha256 for F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt: 5ed326924296de84d07a4f313269deb7fe1908b3d5fcd00cba5773753ed88c71
Loading weights [5ed3269242] from F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt
Loading VAE weights specified in settings: cached vaeFtMse840000Ema_v10.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 24.6s (calculate hash: 17.9s, load weights from disk: 3.2s, apply weights to model: 1.4s, apply half(): 0.2s, load VAE: 0.4s, move model to device: 1.5s).
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
---
Calculating sha256 for F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt: 5ed326924296de84d07a4f313269deb7fe1908b3d5fcd00cba5773753ed88c71
Loading weights [5ed3269242] from F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt
Loading VAE weights specified in settings: cached vaeFtMse840000Ema_v10.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 24.6s (calculate hash: 17.9s, load weights from disk: 3.2s, apply weights to model: 1.4s, apply half(): 0.2s, load VAE: 0.4s, move model to device: 1.5s).
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
---
Calculating sha256 for F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt: 5ed326924296de84d07a4f313269deb7fe1908b3d5fcd00cba5773753ed88c71
Loading weights [5ed3269242] from F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt
Loading VAE weights specified in settings: cached vaeFtMse840000Ema_v10.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 24.6s (calculate hash: 17.9s, load weights from disk: 3.2s, apply weights to model: 1.4s, apply half(): 0.2s, load VAE: 0.4s, move model to device: 1.5s).
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
---
Calculating sha256 for F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt: 5ed326924296de84d07a4f313269deb7fe1908b3d5fcd00cba5773753ed88c71
Loading weights [5ed3269242] from F:\SUPERSD\stable-diffusion-webui\models\Stable-diffusion\plazmMen.ckpt
Loading VAE weights specified in settings: cached vaeFtMse840000Ema_v10.safetensors
Applying attention optimization: xformers... done.
Weights loaded in 24.6s (calculate hash: 17.9s, load weights from disk: 3.2s, apply weights to model: 1.4s, apply half(): 0.2s, load VAE: 0.4s, move model to device: 1.5s).
*** Error loading/saving model file
    Traceback (most recent call last):
      File "F:\SUPERSD\stable-diffusion-webui\modules\ui.py", line 1521, in modelmerger
        results = modules.extras.run_modelmerger(*args)
      File "F:\SUPERSD\stable-diffusion-webui\modules\extras.py", line 122, in run_modelmerger
        primary_model_info = sd_models.checkpoints_list[primary_model_name]
    KeyError: 'CodyCSD.ckpt'

---
```


### Additional information

I've made sure to load both models that I wanted to merge, firsthand before trying to merge them.