stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Error loading/saving model file:

Open Quadragonsaurus opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

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

What happened?

Always error when I merge checkpoint with Add Difference, always error output

Traceback (most recent call last): File "/content/stable-diffusion-webui/modules/ui.py", line 1723, in modelmerger results = modules.extras.run_modelmerger(*args) File "/content/stable-diffusion-webui/modules/extras.py", line 226, in run_modelmerger if key in theta_2: TypeError: argument of type 'NoneType' is not iterable

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/gradio/routes.py", line 276, in run_predict fn_index, raw_input, username, session_state, iterators File "/usr/local/lib/python3.7/dist-packages/gradio/blocks.py", line 791, in process_api predictions = self.postprocess_data(fn_index, result["prediction"], state) File "/usr/local/lib/python3.7/dist-packages/gradio/blocks.py", line 742, in postprocess_data if predictions[i] is components._Keywords.FINISHED_ITERATING: IndexError: list index out of range

Google Colab Stable Diffusion

Steps to reproduce the problem

  1. Checkpoints Merger Tab
  2. Add Difference
  3. Save as Float16
  4. then get Error in Google Colab and I have to restart WebUI

What should have happened?

Checkpoint merged like Weighted Sum

Commit where the problem happens

Error loading/saving model file

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No response

Additional information, context and logs

No response

Quadragonsaurus avatar Oct 28 '22 10:10 Quadragonsaurus

I'm having the same issue. "Add Difference" does not work. Weighted Sum works, though.

ADD DIFFERENCE Loading H:\stable-diffusion-webui\models\Stable-diffusion\nai.ckpt... Loading H:\stable-diffusion-webui\models\Stable-diffusion\sd-v1-4-full-ema.ckpt... Merging... 1%|▌ | 12/1831 [00:00<?, ?it/s] Error loading/saving model file: Traceback (most recent call last): File "H:\stable-diffusion-webui\modules\ui.py", line 1680, in modelmerger results = modules.extras.run_modelmerger(*args) File "H:\stable-diffusion-webui\modules\extras.py", line 293, in run_modelmerger if key in theta_2: TypeError: argument of type 'NoneType' is not iterable

Traceback (most recent call last): File "H:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict output = await app.blocks.process_api( File "H:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 983, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "H:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 913, in postprocess_data if predictions[i] is components._Keywords.FINISHED_ITERATING: IndexError: list index out of range

WEIGHTED SUM

Loading H:\stable-diffusion-webui\models\Stable-diffusion\nai.ckpt... Loading H:\stable-diffusion-webui\models\Stable-diffusion\sd-v1-4-full-ema.ckpt... Merging... 100%|█████████████████████████████████████████████████████████████████████████████| 1146/1146 [00:01<00:00, 749.81it/s] Saving to H:\stable-diffusion-webui\models\Stable-diffusion\DELETE ME.ckpt... Checkpoint saved.

Satsugai avatar Nov 12 '22 04:11 Satsugai

Same error on macOS, weighted sum works, add difference does not

Stisplit avatar Nov 21 '22 22:11 Stisplit

Doesn't "add difference" require 3 models? The equation is A + (B-C) * M so if you are only loading two models that would explain it, at least with the equation. Looks like it is looking for a 3rd model and one isn't selected hence the index error.

praguepride avatar Nov 22 '22 12:11 praguepride

"The more you know.gif" Well, thanks! I wish the UI was more self-explanatory.

Stisplit avatar Nov 23 '22 08:11 Stisplit

From what I can tell, you use the difference if you're not sure where the other model is coming from. For example lets say you mix Model A and Model B. Now you have model AB. You hand that off to someone who wants to also mix it with Model A but if you do that you get Model AAB which might not be what they want. So you have it mix model A + (B-A) so that it is only the Model B that is getting mixed.

Simple example but people are passing around so many models and mixing and re-mixing that its important to understand.

praguepride avatar Nov 24 '22 01:11 praguepride