aboutsummaryrefslogtreecommitdiffstats
path: root/modules/extras.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-02 17:30:02 +0000
committerAUTOMATIC <16777216c@gmail.com>2023-01-02 17:30:02 +0000
commit84dd7e8e2495c4fc2997e97f8267aa831eb90d11 (patch)
tree5ae26036e512cb665d8fc56b20de3d3b17d39e8d /modules/extras.py
parent4dbde228ff48dbb105241b1ed25c21ce3f87d182 (diff)
downloadstable-diffusion-webui-gfx803-84dd7e8e2495c4fc2997e97f8267aa831eb90d11.tar.gz
stable-diffusion-webui-gfx803-84dd7e8e2495c4fc2997e97f8267aa831eb90d11.tar.bz2
stable-diffusion-webui-gfx803-84dd7e8e2495c4fc2997e97f8267aa831eb90d11.zip
error out with a readable message in chwewckpoint merger for incompatible tensor shapes (ie when trying to merge SD1.5 with SD2.0)
Diffstat (limited to 'modules/extras.py')
-rw-r--r--modules/extras.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/extras.py b/modules/extras.py
index 68939dea..5e270250 100644
--- a/modules/extras.py
+++ b/modules/extras.py
@@ -303,6 +303,8 @@ def run_modelmerger(primary_model_name, secondary_model_name, tertiary_model_nam
theta_0[key][:, 0:4, :, :] = theta_func2(a[:, 0:4, :, :], b, multiplier)
result_is_inpainting_model = True
else:
+ assert a.shape == b.shape, f'Incompatible shapes for layer {key}: A is {a.shape}, and B is {b.shape}'
+
theta_0[key] = theta_func2(a, b, multiplier)
if save_as_half: