lycoris-lora 2.1.0.dev6__tar.gz → 2.1.0.dev8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/PKG-INFO +1 -1
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/kohya/__init__.py +7 -4
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/locon.py +5 -2
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/loha.py +3 -2
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/lokr.py +5 -2
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/utils/__init__.py +8 -6
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/PKG-INFO +1 -1
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/setup.py +1 -1
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/LICENSE.md +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/README.md +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/__init__.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/config.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/hcp/__init__.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/hcp/base.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/hcp/diag_oft.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/hcp/loha.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/hcp/lokr.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/kohya/model_utils.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/kohya/original_unet.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/kohya/sdxl_model_util.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/kohya/sdxl_original_unet.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/kohya/utils.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/__init__.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/attention.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/base.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/diag_oft.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/dylora.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/full.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/glokr.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/glora.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/hypernet/__init__.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/hypernet/generater.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/hypernet/text_encoder.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/ia3.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/norms.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/utils/logger.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/utils/preset.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/utils/xformers_utils.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/wrapper.py +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/SOURCES.txt +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/dependency_links.txt +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/not-zip-safe +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/requires.txt +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/top_level.txt +0 -0
- {lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lycoris_lora
|
|
3
|
-
Version: 2.1.0.
|
|
3
|
+
Version: 2.1.0.dev8
|
|
4
4
|
Summary: Lora beYond Conventional methods, Other Rank adaptation Implementations for Stable diffusion
|
|
5
5
|
Home-page: https://github.com/KohakuBlueleaf/LyCORIS
|
|
6
6
|
Author: Shih-Ying Yeh(KohakuBlueLeaf), Yu-Guan Hsieh, Zhidong Gao
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
# https://github.com/cloneofsimo/lora/blob/master/lora_diffusion/lora.py
|
|
5
5
|
# https://github.com/kohya-ss/sd-scripts/blob/main/networks/lora.py
|
|
6
6
|
|
|
7
|
-
import math
|
|
8
|
-
from warnings import warn
|
|
9
7
|
import os
|
|
8
|
+
import re
|
|
10
9
|
import sys
|
|
10
|
+
from warnings import warn
|
|
11
|
+
from typing import List
|
|
11
12
|
|
|
12
13
|
sys.setrecursionlimit(10000)
|
|
13
|
-
|
|
14
|
+
|
|
14
15
|
import torch
|
|
15
16
|
import torch.utils.checkpoint as checkpoint
|
|
16
17
|
|
|
@@ -482,7 +483,9 @@ class LycorisNetworkKohya(LycorisNetwork):
|
|
|
482
483
|
]
|
|
483
484
|
)
|
|
484
485
|
next_config = {}
|
|
485
|
-
elif name in target_replace_names
|
|
486
|
+
elif name in target_replace_names or any(
|
|
487
|
+
re.match(t, name) for t in target_replace_names
|
|
488
|
+
):
|
|
486
489
|
if name in self.NAME_ALGO_MAP:
|
|
487
490
|
next_config = self.NAME_ALGO_MAP[name]
|
|
488
491
|
algo = next_config.get("algo", network_module)
|
|
@@ -96,9 +96,12 @@ class LoConModule(ModuleCustomSD):
|
|
|
96
96
|
self.multiplier = multiplier
|
|
97
97
|
self.org_module = [org_module]
|
|
98
98
|
self.org_forward = self.org_module[0].forward
|
|
99
|
-
self.register_load_state_dict_post_hook(self.load_weight_hook)
|
|
100
99
|
|
|
101
|
-
def load_weight_hook(self,
|
|
100
|
+
def load_weight_hook(self, module: nn.Module, incompatible_keys):
|
|
101
|
+
missing_keys = incompatible_keys.missing_keys
|
|
102
|
+
for key in missing_keys:
|
|
103
|
+
if "scalar" in key:
|
|
104
|
+
del missing_keys[missing_keys.index(key)]
|
|
102
105
|
self.scalar = nn.Parameter(torch.ones_like(self.scalar))
|
|
103
106
|
|
|
104
107
|
def apply_to(self, is_hypernet=False, **kwargs):
|
|
@@ -194,8 +194,9 @@ class LohaModule(ModuleCustomSD):
|
|
|
194
194
|
|
|
195
195
|
def load_weight_hook(self, module: nn.Module, incompatible_keys):
|
|
196
196
|
missing_keys = incompatible_keys.missing_keys
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
for key in missing_keys:
|
|
198
|
+
if "scalar" in key:
|
|
199
|
+
del missing_keys[missing_keys.index(key)]
|
|
199
200
|
self.scalar = nn.Parameter(torch.ones_like(self.scalar))
|
|
200
201
|
|
|
201
202
|
def apply_to(self):
|
|
@@ -236,9 +236,12 @@ class LokrModule(ModuleCustomSD):
|
|
|
236
236
|
torch.tensor(self.multiplier * self.scale),
|
|
237
237
|
)
|
|
238
238
|
assert torch.sum(torch.isnan(weight)) == 0, "weight is nan"
|
|
239
|
-
self.register_load_state_dict_post_hook(self.load_weight_hook)
|
|
240
239
|
|
|
241
|
-
def load_weight_hook(self,
|
|
240
|
+
def load_weight_hook(self, module: nn.Module, incompatible_keys):
|
|
241
|
+
missing_keys = incompatible_keys.missing_keys
|
|
242
|
+
for key in missing_keys:
|
|
243
|
+
if "scalar" in key:
|
|
244
|
+
del missing_keys[missing_keys.index(key)]
|
|
242
245
|
self.scalar = nn.Parameter(torch.ones_like(self.scalar))
|
|
243
246
|
|
|
244
247
|
# Same as locon.py
|
|
@@ -230,12 +230,14 @@ def extract_diff(
|
|
|
230
230
|
extract_c.detach().cpu().contiguous().half()
|
|
231
231
|
)
|
|
232
232
|
diff = (
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
233
|
+
(
|
|
234
|
+
root_weight
|
|
235
|
+
- torch.einsum(
|
|
236
|
+
"i j k l, j r, p i -> p r k l",
|
|
237
|
+
extract_c,
|
|
238
|
+
extract_a.flatten(1, -1),
|
|
239
|
+
extract_b.flatten(1, -1),
|
|
240
|
+
)
|
|
239
241
|
)
|
|
240
242
|
.detach()
|
|
241
243
|
.cpu()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lycoris-lora
|
|
3
|
-
Version: 2.1.0.
|
|
3
|
+
Version: 2.1.0.dev8
|
|
4
4
|
Summary: Lora beYond Conventional methods, Other Rank adaptation Implementations for Stable diffusion
|
|
5
5
|
Home-page: https://github.com/KohakuBlueleaf/LyCORIS
|
|
6
6
|
Author: Shih-Ying Yeh(KohakuBlueLeaf), Yu-Guan Hsieh, Zhidong Gao
|
|
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
|
|
|
4
4
|
setup(
|
|
5
5
|
name="lycoris_lora",
|
|
6
6
|
packages=find_packages(),
|
|
7
|
-
version="2.1.0.
|
|
7
|
+
version="2.1.0.dev8",
|
|
8
8
|
url="https://github.com/KohakuBlueleaf/LyCORIS",
|
|
9
9
|
description="Lora beYond Conventional methods, Other Rank adaptation Implementations for Stable diffusion",
|
|
10
10
|
author="Shih-Ying Yeh(KohakuBlueLeaf), Yu-Guan Hsieh, Zhidong Gao",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris/modules/hypernet/text_encoder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lycoris_lora-2.1.0.dev6 → lycoris_lora-2.1.0.dev8}/lycoris_lora.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|