aboutsummaryrefslogtreecommitdiff
path: root/modules/extras.py
diff options
context:
space:
mode:
authorULTRANOX\Chris <boston@udel.edu>2023-01-26 04:38:04 -0500
committerULTRANOX\Chris <boston@udel.edu>2023-01-26 04:38:04 -0500
commitf90798c6b6cc48e514acb08ce02bdb5874bf74d8 (patch)
tree13e1b3137f4fb4590626fb820ceefa983961d1f8 /modules/extras.py
parentf4ec411f2c9d6bc6817a2eca8a2c00f255ffb386 (diff)
Added error check for the rare case a user merges a pix2pix model with a normal model using weighted sum. Also removed bad print message that interfered with merging progress bar.
Diffstat (limited to 'modules/extras.py')
-rw-r--r--modules/extras.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/extras.py b/modules/extras.py
index 67ffdee3..badd13c7 100644
--- a/modules/extras.py
+++ b/modules/extras.py
@@ -186,9 +186,10 @@ def run_modelmerger(id_task, primary_model_name, secondary_model_name, tertiary_
if a.shape != b.shape and a.shape[0:1] + a.shape[2:] == b.shape[0:1] + b.shape[2:]:
if a.shape[1] == 4 and b.shape[1] == 9:
raise RuntimeError("When merging inpainting model with a normal one, A must be the inpainting model.")
+ if a.shape[1] == 4 and b.shape[1] == 8:
+ raise RuntimeError("When merging pix2pix model with a normal one, A must be the pix2pix model.")
if a.shape[1] == 8 and b.shape[1] == 4:#If we have an InstructPix2Pix model...
- print("Detected possible merge of instruct model with non-instruct model.")
theta_0[key][:, 0:4, :, :] = theta_func2(a[:, 0:4, :, :], b, multiplier)#Merge only the vectors the models have in common. Otherwise we get an error due to dimension mismatch.
result_is_pix2pix_model = True
else: