diff options
author | MalumaDev <piano.lu92@gmail.com> | 2022-10-18 15:27:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 15:27:30 +0000 |
commit | c2765c9bcd264f5a8922348cd03521cb2ff306b3 (patch) | |
tree | 475fb1048477fac8f0b9afc741b6a8eefeb339d7 /modules/extras.py | |
parent | 1997ccff13fc75af223f571e8c927c3d77273dd9 (diff) | |
parent | c1093b8051606f0ac90506b7114c4b55d0447c70 (diff) | |
download | stable-diffusion-webui-gfx803-c2765c9bcd264f5a8922348cd03521cb2ff306b3.tar.gz stable-diffusion-webui-gfx803-c2765c9bcd264f5a8922348cd03521cb2ff306b3.tar.bz2 stable-diffusion-webui-gfx803-c2765c9bcd264f5a8922348cd03521cb2ff306b3.zip |
Merge branch 'master' into test_resolve_conflicts
Diffstat (limited to 'modules/extras.py')
-rw-r--r-- | modules/extras.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/extras.py b/modules/extras.py index c908b43e..b853fa5b 100644 --- a/modules/extras.py +++ b/modules/extras.py @@ -216,8 +216,11 @@ def run_modelmerger(primary_model_name, secondary_model_name, teritary_model_nam if theta_func1:
for key in tqdm.tqdm(theta_1.keys()):
if 'model' in key:
- t2 = theta_2.get(key, torch.zeros_like(theta_1[key]))
- theta_1[key] = theta_func1(theta_1[key], t2)
+ if key in theta_2:
+ t2 = theta_2.get(key, torch.zeros_like(theta_1[key]))
+ theta_1[key] = theta_func1(theta_1[key], t2)
+ else:
+ theta_1[key] = torch.zeros_like(theta_1[key])
del theta_2, teritary_model
for key in tqdm.tqdm(theta_0.keys()):
|