mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
Add links to test models for loha, lokr, ia3.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user