Add links to test models for loha, lokr, ia3.

This commit is contained in:
Ryan Dick
2024-09-12 15:38:42 +00:00
parent 53da78f1ac
commit 3ce02be1ea
4 changed files with 15 additions and 6 deletions

View File

@@ -6,6 +6,11 @@ from invokeai.backend.lora.layers.lora_layer_base import LoRALayerBase
class IA3Layer(LoRALayerBase):
"""IA3 Layer
Example model for testing this layer type: https://civitai.com/models/123930/gwendolyn-tennyson-ben-10-ia3
"""
def __init__(self, weight: torch.Tensor, on_input: torch.Tensor, bias: Optional[torch.Tensor]):
super().__init__(alpha=None, bias=bias)
self.weight = torch.nn.Parameter(weight)

View File

@@ -6,6 +6,11 @@ from invokeai.backend.lora.layers.lora_layer_base import LoRALayerBase
class LoHALayer(LoRALayerBase):
"""LoHA LyCoris layer.
Example model for testing this layer type: https://civitai.com/models/27397/loha-renoir-the-dappled-light-style
"""
def __init__(
self,
w1_a: torch.Tensor,

View File

@@ -6,6 +6,11 @@ from invokeai.backend.lora.layers.lora_layer_base import LoRALayerBase
class LoKRLayer(LoRALayerBase):
"""LoKR LyCoris layer.
Example model for testing this layer type: https://civitai.com/models/346747/lokrnekopara-allgirl-for-jru2
"""
def __init__(
self,
w1: torch.Tensor | None,

View File

@@ -67,9 +67,3 @@ class LoRALayer(LoRALayerBase):
weight = self.up.reshape(self.up.shape[0], -1) @ self.down.reshape(self.down.shape[0], -1)
return weight
def calc_size(self) -> int:
# HACK(ryand): Fix this issue with circular imports.
from invokeai.backend.model_manager.load.model_util import calc_module_size
return calc_module_size(self)