mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-11-21 03:11:40 +08:00
Merge pull request #12584 from AUTOMATIC1111/full-module-with-bias
Add ex_bias into full module
This commit is contained in:
commit
8b181c812f
@ -14,9 +14,14 @@ class NetworkModuleFull(network.NetworkModule):
|
|||||||
super().__init__(net, weights)
|
super().__init__(net, weights)
|
||||||
|
|
||||||
self.weight = weights.w.get("diff")
|
self.weight = weights.w.get("diff")
|
||||||
|
self.ex_bias = weights.w.get("diff_b")
|
||||||
|
|
||||||
def calc_updown(self, orig_weight):
|
def calc_updown(self, orig_weight):
|
||||||
output_shape = self.weight.shape
|
output_shape = self.weight.shape
|
||||||
updown = self.weight.to(orig_weight.device, dtype=orig_weight.dtype)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user