mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-24 22:09:00 +08:00
prevent undefined variable
This commit is contained in:
parent
5a8dd0c549
commit
4eb949625c
@ -22,6 +22,8 @@ class NetworkModuleOFT(network.NetworkModule):
|
|||||||
self.org_module: list[torch.Module] = [self.sd_module]
|
self.org_module: list[torch.Module] = [self.sd_module]
|
||||||
|
|
||||||
self.scale = 1.0
|
self.scale = 1.0
|
||||||
|
self.is_kohya = False
|
||||||
|
self.is_boft = False
|
||||||
|
|
||||||
# kohya-ss
|
# kohya-ss
|
||||||
if "oft_blocks" in weights.w.keys():
|
if "oft_blocks" in weights.w.keys():
|
||||||
@ -31,13 +33,11 @@ class NetworkModuleOFT(network.NetworkModule):
|
|||||||
self.dim = self.oft_blocks.shape[0] # lora dim
|
self.dim = self.oft_blocks.shape[0] # lora dim
|
||||||
# LyCORIS OFT
|
# LyCORIS OFT
|
||||||
elif "oft_diag" in weights.w.keys():
|
elif "oft_diag" in weights.w.keys():
|
||||||
self.is_kohya = False
|
|
||||||
self.oft_blocks = weights.w["oft_diag"]
|
self.oft_blocks = weights.w["oft_diag"]
|
||||||
# self.alpha is unused
|
# self.alpha is unused
|
||||||
self.dim = self.oft_blocks.shape[1] # (num_blocks, block_size, block_size)
|
self.dim = self.oft_blocks.shape[1] # (num_blocks, block_size, block_size)
|
||||||
|
|
||||||
# LyCORIS BOFT
|
# LyCORIS BOFT
|
||||||
self.is_boft = False
|
|
||||||
if weights.w["oft_diag"].dim() == 4:
|
if weights.w["oft_diag"].dim() == 4:
|
||||||
self.is_boft = True
|
self.is_boft = True
|
||||||
self.rescale = weights.w.get('rescale', None)
|
self.rescale = weights.w.get('rescale', None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user