lycoris-lora 3.0.1.dev11__tar.gz → 3.0.1.dev13__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-3.0.1.dev11/lycoris_lora.egg-info → lycoris_lora-3.0.1.dev13}/PKG-INFO +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/lokr.py +4 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/kohya.py +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/base.py +8 -2
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/boft.py +7 -5
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/diag_oft.py +6 -4
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/dylora.py +1 -2
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/full.py +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/glora.py +1 -2
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/ia3.py +1 -2
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/locon.py +2 -3
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/loha.py +6 -4
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/lokr.py +17 -8
- lycoris_lora-3.0.1.dev11/lycoris/utils/bnb.py → lycoris_lora-3.0.1.dev13/lycoris/utils/quant.py +9 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/wrapper.py +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13/lycoris_lora.egg-info}/PKG-INFO +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris_lora.egg-info/SOURCES.txt +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/setup.py +1 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/test/kohya.py +3 -1
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/test/wrapper.py +7 -2
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/LICENSE.md +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/README.md +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/__init__.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/config.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/__init__.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/boft.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/diag_oft.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/general.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/locon.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/functional/loha.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/logging.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/__init__.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/modules/norms.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/utils/__init__.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/utils/general.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/utils/logger.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/utils/preset.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris/utils/xformers_utils.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris_lora.egg-info/dependency_links.txt +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris_lora.egg-info/not-zip-safe +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris_lora.egg-info/requires.txt +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris_lora.egg-info/top_level.txt +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/setup.cfg +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/test/__init__.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/test/functional.py +0 -0
- {lycoris_lora-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/test/module.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lycoris_lora
|
|
3
|
-
Version: 3.0.1.
|
|
3
|
+
Version: 3.0.1.dev13
|
|
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
|
|
@@ -58,7 +58,7 @@ def create_network(
|
|
|
58
58
|
rescaled = str_bool(kwargs.get("rescaled", False))
|
|
59
59
|
weight_decompose = str_bool(kwargs.get("dora_wd", False))
|
|
60
60
|
full_matrix = str_bool(kwargs.get("full_matrix", False))
|
|
61
|
-
bypass_mode = str_bool(kwargs.get("bypass_mode",
|
|
61
|
+
bypass_mode = str_bool(kwargs.get("bypass_mode", None))
|
|
62
62
|
rs_lora = str_bool(kwargs.get("rs_lora", False))
|
|
63
63
|
unbalanced_factorization = str_bool(kwargs.get("unbalanced_factorization", False))
|
|
64
64
|
train_t5xxl = str_bool(kwargs.get("train_t5xxl", False))
|
|
@@ -5,7 +5,7 @@ import torch.nn as nn
|
|
|
5
5
|
import torch.nn.functional as F
|
|
6
6
|
import torch.nn.utils.parametrize as parametrize
|
|
7
7
|
|
|
8
|
-
from ..utils.
|
|
8
|
+
from ..utils.quant import QuantLinears, log_bypass, log_suspect
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class ModuleCustomSD(nn.Module):
|
|
@@ -77,7 +77,7 @@ class LycorisBaseModule(ModuleCustomSD):
|
|
|
77
77
|
rank_dropout=0.0,
|
|
78
78
|
module_dropout=0.0,
|
|
79
79
|
rank_dropout_scale=False,
|
|
80
|
-
bypass_mode=
|
|
80
|
+
bypass_mode=None,
|
|
81
81
|
**kwargs,
|
|
82
82
|
):
|
|
83
83
|
"""if alpha == 0 or None, alpha is rank (no scaling)."""
|
|
@@ -165,6 +165,12 @@ class LycorisBaseModule(ModuleCustomSD):
|
|
|
165
165
|
log_bypass()
|
|
166
166
|
self.is_quant = True
|
|
167
167
|
bypass_mode = True
|
|
168
|
+
if isinstance(org_module, nn.Linear) and org_module.__class__.__name__ != "Linear":
|
|
169
|
+
if bypass_mode is None:
|
|
170
|
+
log_suspect()
|
|
171
|
+
bypass_mode = True
|
|
172
|
+
if bypass_mode == True:
|
|
173
|
+
self.is_quant = True
|
|
168
174
|
self.bypass_mode = bypass_mode
|
|
169
175
|
self.dropout = dropout
|
|
170
176
|
self.rank_dropout = rank_dropout
|
|
@@ -10,7 +10,6 @@ from einops import rearrange
|
|
|
10
10
|
from .base import LycorisBaseModule
|
|
11
11
|
from ..functional import power2factorization
|
|
12
12
|
from ..logging import logger
|
|
13
|
-
from ..utils.bnb import LinearNF4
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
@cache
|
|
@@ -64,7 +63,7 @@ class ButterflyOFTModule(LycorisBaseModule):
|
|
|
64
63
|
rank_dropout_scale=False,
|
|
65
64
|
constraint=0,
|
|
66
65
|
rescaled=False,
|
|
67
|
-
bypass_mode=
|
|
66
|
+
bypass_mode=None,
|
|
68
67
|
**kwargs,
|
|
69
68
|
):
|
|
70
69
|
super().__init__(
|
|
@@ -116,10 +115,13 @@ class ButterflyOFTModule(LycorisBaseModule):
|
|
|
116
115
|
lora_name,
|
|
117
116
|
orig_module,
|
|
118
117
|
1,
|
|
119
|
-
lora_dim=
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
lora_dim=s,
|
|
119
|
+
constraint=float(alpha),
|
|
120
|
+
rescaled=rescale is not None,
|
|
122
121
|
)
|
|
122
|
+
module.oft_blocks.copy_(oft_blocks)
|
|
123
|
+
if rescale is not None:
|
|
124
|
+
module.rescale.copy_(rescale)
|
|
123
125
|
return module
|
|
124
126
|
|
|
125
127
|
@property
|
|
@@ -7,7 +7,6 @@ import torch.nn.functional as F
|
|
|
7
7
|
from .base import LycorisBaseModule
|
|
8
8
|
from ..functional import factorization
|
|
9
9
|
from ..logging import logger
|
|
10
|
-
from ..utils.bnb import LinearNF4
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
@cache
|
|
@@ -49,7 +48,7 @@ class DiagOFTModule(LycorisBaseModule):
|
|
|
49
48
|
rank_dropout_scale=False,
|
|
50
49
|
constraint=0,
|
|
51
50
|
rescaled=False,
|
|
52
|
-
bypass_mode=
|
|
51
|
+
bypass_mode=None,
|
|
53
52
|
**kwargs,
|
|
54
53
|
):
|
|
55
54
|
super().__init__(
|
|
@@ -104,9 +103,12 @@ class DiagOFTModule(LycorisBaseModule):
|
|
|
104
103
|
orig_module,
|
|
105
104
|
1,
|
|
106
105
|
lora_dim=s,
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
constraint=float(alpha),
|
|
107
|
+
rescaled=rescale is not None,
|
|
109
108
|
)
|
|
109
|
+
module.oft_blocks.copy_(oft_blocks)
|
|
110
|
+
if rescale is not None:
|
|
111
|
+
module.rescale.copy_(rescale)
|
|
110
112
|
return module
|
|
111
113
|
|
|
112
114
|
@property
|
|
@@ -6,7 +6,6 @@ import torch.nn as nn
|
|
|
6
6
|
|
|
7
7
|
from .base import LycorisBaseModule
|
|
8
8
|
from ..utils import product
|
|
9
|
-
from ..utils.bnb import LinearNF4
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class DyLoraModule(LycorisBaseModule):
|
|
@@ -32,7 +31,7 @@ class DyLoraModule(LycorisBaseModule):
|
|
|
32
31
|
use_scalar=False,
|
|
33
32
|
rank_dropout_scale=False,
|
|
34
33
|
weight_decompose=False,
|
|
35
|
-
bypass_mode=
|
|
34
|
+
bypass_mode=None,
|
|
36
35
|
rs_lora=False,
|
|
37
36
|
train_on_input=False,
|
|
38
37
|
**kwargs,
|
|
@@ -6,7 +6,6 @@ import torch.nn.functional as F
|
|
|
6
6
|
|
|
7
7
|
from .base import LycorisBaseModule
|
|
8
8
|
from ..functional import tucker_weight_from_conv
|
|
9
|
-
from ..utils.bnb import LinearNF4
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
class GLoRAModule(LycorisBaseModule):
|
|
@@ -41,7 +40,7 @@ class GLoRAModule(LycorisBaseModule):
|
|
|
41
40
|
use_scalar=False,
|
|
42
41
|
rank_dropout_scale=False,
|
|
43
42
|
weight_decompose=False,
|
|
44
|
-
bypass_mode=
|
|
43
|
+
bypass_mode=None,
|
|
45
44
|
rs_lora=False,
|
|
46
45
|
**kwargs,
|
|
47
46
|
):
|
|
@@ -2,7 +2,6 @@ import torch
|
|
|
2
2
|
import torch.nn as nn
|
|
3
3
|
|
|
4
4
|
from .base import LycorisBaseModule
|
|
5
|
-
from ..utils.bnb import LinearNF4
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class IA3Module(LycorisBaseModule):
|
|
@@ -30,7 +29,7 @@ class IA3Module(LycorisBaseModule):
|
|
|
30
29
|
use_scalar=False,
|
|
31
30
|
rank_dropout_scale=False,
|
|
32
31
|
weight_decompose=False,
|
|
33
|
-
bypass_mode=
|
|
32
|
+
bypass_mode=None,
|
|
34
33
|
rs_lora=False,
|
|
35
34
|
train_on_input=False,
|
|
36
35
|
**kwargs,
|
|
@@ -7,8 +7,7 @@ import torch.nn.functional as F
|
|
|
7
7
|
|
|
8
8
|
from .base import LycorisBaseModule
|
|
9
9
|
from ..functional.general import rebuild_tucker
|
|
10
|
-
from ..logging import logger
|
|
11
|
-
from ..utils.bnb import LinearNF4
|
|
10
|
+
from ..logging import logger
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
@cache
|
|
@@ -50,7 +49,7 @@ class LoConModule(LycorisBaseModule):
|
|
|
50
49
|
use_scalar=False,
|
|
51
50
|
rank_dropout_scale=False,
|
|
52
51
|
weight_decompose=False,
|
|
53
|
-
bypass_mode=
|
|
52
|
+
bypass_mode=None,
|
|
54
53
|
rs_lora=False,
|
|
55
54
|
**kwargs,
|
|
56
55
|
):
|
|
@@ -5,7 +5,6 @@ import torch.nn as nn
|
|
|
5
5
|
|
|
6
6
|
from .base import LycorisBaseModule
|
|
7
7
|
from ..functional.loha import diff_weight as loha_diff_weight
|
|
8
|
-
from ..utils.bnb import LinearNF4
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class LohaModule(LycorisBaseModule):
|
|
@@ -42,7 +41,7 @@ class LohaModule(LycorisBaseModule):
|
|
|
42
41
|
use_scalar=False,
|
|
43
42
|
rank_dropout_scale=False,
|
|
44
43
|
weight_decompose=False,
|
|
45
|
-
bypass_mode=
|
|
44
|
+
bypass_mode=None,
|
|
46
45
|
rs_lora=False,
|
|
47
46
|
**kwargs,
|
|
48
47
|
):
|
|
@@ -182,6 +181,9 @@ class LohaModule(LycorisBaseModule):
|
|
|
182
181
|
)
|
|
183
182
|
|
|
184
183
|
def get_weight(self, shape):
|
|
184
|
+
scale = torch.tensor(
|
|
185
|
+
self.scale, dtype=self.hada_w1_b.dtype, device=self.hada_w1_b.device
|
|
186
|
+
)
|
|
185
187
|
if self.tucker:
|
|
186
188
|
weight = loha_diff_weight(
|
|
187
189
|
self.hada_w1_b,
|
|
@@ -190,7 +192,7 @@ class LohaModule(LycorisBaseModule):
|
|
|
190
192
|
self.hada_w2_a,
|
|
191
193
|
self.hada_t1,
|
|
192
194
|
self.hada_t2,
|
|
193
|
-
gamma=
|
|
195
|
+
gamma=scale,
|
|
194
196
|
)
|
|
195
197
|
else:
|
|
196
198
|
weight = loha_diff_weight(
|
|
@@ -200,7 +202,7 @@ class LohaModule(LycorisBaseModule):
|
|
|
200
202
|
self.hada_w2_a,
|
|
201
203
|
None,
|
|
202
204
|
None,
|
|
203
|
-
gamma=
|
|
205
|
+
gamma=scale,
|
|
204
206
|
)
|
|
205
207
|
if shape is not None:
|
|
206
208
|
weight = weight.reshape(shape)
|
|
@@ -5,13 +5,10 @@ import torch
|
|
|
5
5
|
import torch.nn as nn
|
|
6
6
|
import torch.nn.functional as F
|
|
7
7
|
|
|
8
|
-
from einops import rearrange
|
|
9
|
-
|
|
10
8
|
from .base import LycorisBaseModule
|
|
11
9
|
from ..functional import factorization, rebuild_tucker
|
|
12
10
|
from ..functional.lokr import make_kron
|
|
13
11
|
from ..logging import logger
|
|
14
|
-
from ..utils.bnb import LinearNF4
|
|
15
12
|
|
|
16
13
|
|
|
17
14
|
@cache
|
|
@@ -62,7 +59,7 @@ class LokrModule(LycorisBaseModule):
|
|
|
62
59
|
rank_dropout_scale=False,
|
|
63
60
|
weight_decompose=False,
|
|
64
61
|
full_matrix=False,
|
|
65
|
-
bypass_mode=
|
|
62
|
+
bypass_mode=None,
|
|
66
63
|
rs_lora=False,
|
|
67
64
|
unbalanced_factorization=False,
|
|
68
65
|
**kwargs,
|
|
@@ -288,12 +285,22 @@ class LokrModule(LycorisBaseModule):
|
|
|
288
285
|
w_shape = (w1_shape[0] * w2_shape[0], w1_shape[1] * w2_shape[1])
|
|
289
286
|
factor1 = max(w1.shape) if w1 is not None else max(w1a.size(0), w1b.size(1))
|
|
290
287
|
factor2 = max(w2.shape) if w2 is not None else max(w2a.size(0), w2b.size(1))
|
|
291
|
-
if
|
|
288
|
+
if (
|
|
289
|
+
w_shape[0] % factor1 == 0
|
|
290
|
+
and w_shape[1] % factor1 == 0
|
|
291
|
+
and factor1 in shape_group_1
|
|
292
|
+
and factor1 in shape_group_2
|
|
293
|
+
):
|
|
292
294
|
factor = factor1
|
|
293
|
-
elif
|
|
295
|
+
elif (
|
|
296
|
+
w_shape[0] % factor2 == 0
|
|
297
|
+
and w_shape[1] % factor2 == 0
|
|
298
|
+
and factor2 in shape_group_1
|
|
299
|
+
and factor2 in shape_group_2
|
|
300
|
+
):
|
|
294
301
|
factor = factor2
|
|
295
302
|
else:
|
|
296
|
-
factor =
|
|
303
|
+
factor = min(factor1, factor2)
|
|
297
304
|
|
|
298
305
|
module = cls(
|
|
299
306
|
lora_name,
|
|
@@ -349,7 +356,7 @@ class LokrModule(LycorisBaseModule):
|
|
|
349
356
|
else self.lokr_w2_a @ self.lokr_w2_b
|
|
350
357
|
)
|
|
351
358
|
),
|
|
352
|
-
|
|
359
|
+
self.scale,
|
|
353
360
|
)
|
|
354
361
|
dtype = weight.dtype
|
|
355
362
|
if shape is not None:
|
|
@@ -528,6 +535,8 @@ class LokrModule(LycorisBaseModule):
|
|
|
528
535
|
weight = self.apply_weight_decompose(
|
|
529
536
|
weight + diff_weight, self.multiplier
|
|
530
537
|
)
|
|
538
|
+
elif self.multiplier == 1:
|
|
539
|
+
weight = weight + diff_weight
|
|
531
540
|
else:
|
|
532
541
|
weight = weight + diff_weight * self.multiplier
|
|
533
542
|
bias = (
|
lycoris_lora-3.0.1.dev11/lycoris/utils/bnb.py → lycoris_lora-3.0.1.dev13/lycoris/utils/quant.py
RENAMED
|
@@ -77,3 +77,12 @@ def log_bypass():
|
|
|
77
77
|
return logger.warning(
|
|
78
78
|
"Using bnb/quanto/optimum-quanto with LyCORIS will enable force-bypass mode."
|
|
79
79
|
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@cache
|
|
83
|
+
def log_suspect():
|
|
84
|
+
return logger.warning(
|
|
85
|
+
"Non-native Linear detected but bypass_mode is not set. "
|
|
86
|
+
"Automatically using force-bypass mode to avoid possible issues. "
|
|
87
|
+
"Please set bypass_mode=False explicitly if there are no quantized layers."
|
|
88
|
+
)
|
|
@@ -90,7 +90,7 @@ def create_lycoris(module, multiplier=1.0, linear_dim=4, linear_alpha=1, **kwarg
|
|
|
90
90
|
rescaled = str_bool(kwargs.get("rescaled", False))
|
|
91
91
|
weight_decompose = str_bool(kwargs.get("dora_wd", False))
|
|
92
92
|
full_matrix = str_bool(kwargs.get("full_matrix", False))
|
|
93
|
-
bypass_mode = str_bool(kwargs.get("bypass_mode",
|
|
93
|
+
bypass_mode = str_bool(kwargs.get("bypass_mode", None))
|
|
94
94
|
unbalanced_factorization = str_bool(kwargs.get("unbalanced_factorization", False))
|
|
95
95
|
|
|
96
96
|
if unbalanced_factorization:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lycoris_lora
|
|
3
|
-
Version: 3.0.1.
|
|
3
|
+
Version: 3.0.1.dev13
|
|
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
|
|
@@ -26,10 +26,10 @@ lycoris/modules/loha.py
|
|
|
26
26
|
lycoris/modules/lokr.py
|
|
27
27
|
lycoris/modules/norms.py
|
|
28
28
|
lycoris/utils/__init__.py
|
|
29
|
-
lycoris/utils/bnb.py
|
|
30
29
|
lycoris/utils/general.py
|
|
31
30
|
lycoris/utils/logger.py
|
|
32
31
|
lycoris/utils/preset.py
|
|
32
|
+
lycoris/utils/quant.py
|
|
33
33
|
lycoris/utils/xformers_utils.py
|
|
34
34
|
lycoris_lora.egg-info/PKG-INFO
|
|
35
35
|
lycoris_lora.egg-info/SOURCES.txt
|
|
@@ -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="3.0.1.
|
|
7
|
+
version="3.0.1.dev13",
|
|
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",
|
|
@@ -104,9 +104,11 @@ class LycorisKohyaWrapperTests(unittest.TestCase):
|
|
|
104
104
|
)
|
|
105
105
|
network.apply_to([sd_te1, sd_te2], sdxl_unet, True, True)
|
|
106
106
|
network.restore()
|
|
107
|
-
create_network_from_weights(
|
|
107
|
+
network = create_network_from_weights(
|
|
108
108
|
1, "", vae, [sd_te1, sd_te2], sdxl_unet, weights_sd=network.state_dict()
|
|
109
109
|
)
|
|
110
|
+
network.merge_to()
|
|
111
|
+
del network
|
|
110
112
|
torch.cuda.empty_cache()
|
|
111
113
|
|
|
112
114
|
@parameterized.expand(extract_param_list)
|
|
@@ -206,6 +206,7 @@ class LycorisWrapperTests(unittest.TestCase):
|
|
|
206
206
|
test_input = torch.randn(1, 16, 8, 8, 8).to(device, dtype)
|
|
207
207
|
test_output = test_net(test_input)
|
|
208
208
|
test_lycoris.restore()
|
|
209
|
+
test_lycoris.merge_to()
|
|
209
210
|
|
|
210
211
|
state_dict = test_lycoris.state_dict()
|
|
211
212
|
test_lycoris_from_weights: LycorisNetwork
|
|
@@ -219,9 +220,13 @@ class LycorisWrapperTests(unittest.TestCase):
|
|
|
219
220
|
test_lycoris_from_weights.load_state_dict(test_lycoris.state_dict())
|
|
220
221
|
|
|
221
222
|
self.assertTrue(
|
|
222
|
-
len(test_lycoris.loras) == len(test_lycoris_from_weights.loras)
|
|
223
|
+
len(test_lycoris.loras) == len(test_lycoris_from_weights.loras),
|
|
224
|
+
f"{len(test_lycoris.loras)} != {len(test_lycoris_from_weights.loras)}",
|
|
225
|
+
)
|
|
226
|
+
self.assertTrue(
|
|
227
|
+
torch.allclose(test_output, test_output_from_weights),
|
|
228
|
+
f"diff: {torch.nn.functional.mse_loss(test_output, test_output_from_weights).item()}",
|
|
223
229
|
)
|
|
224
|
-
self.assertTrue(torch.allclose(test_output, test_output_from_weights))
|
|
225
230
|
finally:
|
|
226
231
|
reset_globals()
|
|
227
232
|
|
|
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-3.0.1.dev11 → lycoris_lora-3.0.1.dev13}/lycoris_lora.egg-info/dependency_links.txt
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
|