diff options
author | Robert Barron <rubberbaron@robustspread.com> | 2023-08-14 07:35:17 +0000 |
---|---|---|
committer | Robert Barron <rubberbaron@robustspread.com> | 2023-08-14 07:35:17 +0000 |
commit | d61e31bae620632c026c927cf6538180447c6918 (patch) | |
tree | 0397dcc8e741ed391164fb6b7e8e374a46f0f4ce /extensions-builtin/Lora/network.py | |
parent | 54f926b11d29910df9f813e2e0ea6d35c6f4a50d (diff) | |
parent | f3b96d4998d8ca376d33efa7a4454e8c28e24255 (diff) | |
download | stable-diffusion-webui-gfx803-d61e31bae620632c026c927cf6538180447c6918.tar.gz stable-diffusion-webui-gfx803-d61e31bae620632c026c927cf6538180447c6918.tar.bz2 stable-diffusion-webui-gfx803-d61e31bae620632c026c927cf6538180447c6918.zip |
Merge remote-tracking branch 'auto1111/dev' into shared-hires-prompt-test
Diffstat (limited to 'extensions-builtin/Lora/network.py')
-rw-r--r-- | extensions-builtin/Lora/network.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/extensions-builtin/Lora/network.py b/extensions-builtin/Lora/network.py index 0a18d69e..d8e8dfb7 100644 --- a/extensions-builtin/Lora/network.py +++ b/extensions-builtin/Lora/network.py @@ -133,7 +133,7 @@ class NetworkModule: return 1.0
- def finalize_updown(self, updown, orig_weight, output_shape):
+ def finalize_updown(self, updown, orig_weight, output_shape, ex_bias=None):
if self.bias is not None:
updown = updown.reshape(self.bias.shape)
updown += self.bias.to(orig_weight.device, dtype=orig_weight.dtype)
@@ -145,7 +145,10 @@ class NetworkModule: if orig_weight.size().numel() == updown.size().numel():
updown = updown.reshape(orig_weight.shape)
- return updown * self.calc_scale() * self.multiplier()
+ if ex_bias is not None:
+ ex_bias = ex_bias * self.multiplier()
+
+ return updown * self.calc_scale() * self.multiplier(), ex_bias
def calc_updown(self, target):
raise NotImplementedError()
|