mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 10:25:16 +00:00
Don't patch weights when multiplier is zero.
This commit is contained in:
parent
af15add967
commit
6ad0a6d7e2
@ -359,10 +359,11 @@ class ModelPatcher:
|
|||||||
|
|
||||||
if len(v) == 1:
|
if len(v) == 1:
|
||||||
w1 = v[0]
|
w1 = v[0]
|
||||||
if w1.shape != weight.shape:
|
if alpha != 0.0:
|
||||||
print("WARNING SHAPE MISMATCH {} WEIGHT NOT MERGED {} != {}".format(key, w1.shape, weight.shape))
|
if w1.shape != weight.shape:
|
||||||
else:
|
print("WARNING SHAPE MISMATCH {} WEIGHT NOT MERGED {} != {}".format(key, w1.shape, weight.shape))
|
||||||
weight += alpha * w1.type(weight.dtype).to(weight.device)
|
else:
|
||||||
|
weight += alpha * w1.type(weight.dtype).to(weight.device)
|
||||||
elif len(v) == 4: #lora/locon
|
elif len(v) == 4: #lora/locon
|
||||||
mat1 = v[0]
|
mat1 = v[0]
|
||||||
mat2 = v[1]
|
mat2 = v[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user