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.
raiseRuntimeError("When merging inpainting model with a normal one, A must be the inpainting model.")
ifa.shape[1]==4andb.shape[1]==8:
raiseRuntimeError("When merging pix2pix model with a normal one, A must be the pix2pix model.")
ifa.shape[1]==8andb.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.