diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-15 16:24:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-15 16:24:15 +0000 |
commit | 8b181c812fd287983b786e687612cdf83bd2420b (patch) | |
tree | 07727b953f347cec519811ebf75a0ed2380e53f2 /extensions-builtin/Lora | |
parent | f01682ee01e81e8ef84fd6fffe8f7aa17233285d (diff) | |
parent | aa57a89a21d7c0e59a2006a642c3838264c35051 (diff) | |
download | stable-diffusion-webui-gfx803-8b181c812fd287983b786e687612cdf83bd2420b.tar.gz stable-diffusion-webui-gfx803-8b181c812fd287983b786e687612cdf83bd2420b.tar.bz2 stable-diffusion-webui-gfx803-8b181c812fd287983b786e687612cdf83bd2420b.zip |
Merge pull request #12584 from AUTOMATIC1111/full-module-with-bias
Add ex_bias into full module
Diffstat (limited to 'extensions-builtin/Lora')
-rw-r--r-- | extensions-builtin/Lora/network_full.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/extensions-builtin/Lora/network_full.py b/extensions-builtin/Lora/network_full.py index 109b4c2c..bf6930e9 100644 --- a/extensions-builtin/Lora/network_full.py +++ b/extensions-builtin/Lora/network_full.py @@ -14,9 +14,14 @@ class NetworkModuleFull(network.NetworkModule): super().__init__(net, weights)
self.weight = weights.w.get("diff")
+ self.ex_bias = weights.w.get("diff_b")
def calc_updown(self, orig_weight):
output_shape = self.weight.shape
updown = self.weight.to(orig_weight.device, dtype=orig_weight.dtype)
+ if self.ex_bias is not None:
+ ex_bias = self.ex_bias.to(orig_weight.device, dtype=orig_weight.dtype)
+ else:
+ ex_bias = None
- return self.finalize_updown(updown, orig_weight, output_shape)
+ return self.finalize_updown(updown, orig_weight, output_shape, ex_bias)
|