lycoris-lora 3.2.0.dev2__tar.gz → 3.2.0.post2__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.
Files changed (48) hide show
  1. {lycoris_lora-3.2.0.dev2/lycoris_lora.egg-info → lycoris_lora-3.2.0.post2}/PKG-INFO +5 -3
  2. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/README.md +6 -6
  3. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/config.py +15 -0
  4. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/lokr.py +2 -2
  5. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/kohya.py +9 -6
  6. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/locon.py +1 -1
  7. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/loha.py +1 -1
  8. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/lokr.py +1 -1
  9. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/wrapper.py +2 -2
  10. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2/lycoris_lora.egg-info}/PKG-INFO +5 -3
  11. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/setup.py +2 -2
  12. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/LICENSE.md +0 -0
  13. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/__init__.py +0 -0
  14. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/__init__.py +0 -0
  15. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/boft.py +0 -0
  16. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/diag_oft.py +0 -0
  17. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/general.py +0 -0
  18. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/locon.py +0 -0
  19. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/functional/loha.py +0 -0
  20. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/logging.py +0 -0
  21. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/__init__.py +0 -0
  22. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/base.py +0 -0
  23. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/boft.py +0 -0
  24. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/diag_oft.py +0 -0
  25. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/dylora.py +0 -0
  26. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/full.py +0 -0
  27. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/glora.py +0 -0
  28. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/ia3.py +0 -0
  29. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/modules/norms.py +0 -0
  30. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/utils/__init__.py +0 -0
  31. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/utils/general.py +0 -0
  32. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/utils/logger.py +0 -0
  33. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/utils/preset.py +0 -0
  34. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/utils/quant.py +0 -0
  35. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris/utils/xformers_utils.py +0 -0
  36. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris_lora.egg-info/SOURCES.txt +0 -0
  37. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris_lora.egg-info/dependency_links.txt +0 -0
  38. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris_lora.egg-info/not-zip-safe +0 -0
  39. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris_lora.egg-info/requires.txt +0 -0
  40. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/lycoris_lora.egg-info/top_level.txt +0 -0
  41. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/setup.cfg +0 -0
  42. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/__init__.py +0 -0
  43. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/compile.py +0 -0
  44. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/functional.py +0 -0
  45. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/kohya.py +0 -0
  46. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/module.py +0 -0
  47. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/restore.py +0 -0
  48. {lycoris_lora-3.2.0.dev2 → lycoris_lora-3.2.0.post2}/test/wrapper.py +0 -0
@@ -1,17 +1,17 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: lycoris_lora
3
- Version: 3.2.0.dev2
3
+ Version: 3.2.0.post2
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
7
7
  Author-email: kohaku@kblueleaf.net
8
+ License: Apache-2.0
8
9
  Classifier: Development Status :: 5 - Production/Stable
9
10
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 11.8
10
11
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 12
11
12
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 12 :: 12.1
12
13
  Classifier: Intended Audience :: Developers
13
14
  Classifier: Intended Audience :: End Users/Desktop
14
- Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
@@ -27,6 +27,8 @@ Dynamic: author
27
27
  Dynamic: author-email
28
28
  Dynamic: classifier
29
29
  Dynamic: home-page
30
+ Dynamic: license
31
+ Dynamic: license-file
30
32
  Dynamic: requires-dist
31
33
  Dynamic: requires-python
32
34
  Dynamic: summary
@@ -259,21 +259,21 @@ See [docs/Conversion-scripts.md](docs/Conversion-scripts.md) for more informatio
259
259
 
260
260
  For full log, please see [Change.md](Change.md)
261
261
 
262
-
263
- ### 2024/12/09 update to 3.1.1
262
+ ### 2025/04/23 update to 3.2.0
264
263
 
265
264
  #### New Features
266
265
 
267
- * use `wd_on_output=True` can enable "correct" weight-decomposition implementation which use the output dimension of weight to calc the norm. The original implementation in LyCORIS calculate things on input dimension due to ambiguos annotation in paper.
266
+ * Support lora-plus learning rate scaling
267
+ * Support HunYuanVideo model and Wan2.1 model
268
+ * LyCORIS now have `onfly_merge` and `onfly_restore` method. Which can be used in inference time to merge the weights of LyCORIS into the original model. This will save the memory and speed up the inference time.
268
269
 
269
270
  #### Improvements
270
271
 
271
- * BOFT now have more efficient implementation which avoid einops.rearrange.
272
- * `.merge_to()` will automatically match the device and dtype now.
272
+ * [BREAKING CHANGES] Now LyCORIS will use `wd_on_output=True` by default. This will make the weight norm more consistent with the original paper.
273
273
 
274
274
  #### Bug fixes
275
275
 
276
- * `scale_weight_norm` working correctly now.
276
+ * `bypass_mode=False` will turn off the bypass mode correctly now.
277
277
 
278
278
  ## Todo list
279
279
 
@@ -12,6 +12,9 @@ PRESET = {
12
12
  "SingleDiTBlock", # SD3.5
13
13
  "MMDoubleStreamBlock", # HunYuanVideo
14
14
  "MMSingleStreamBlock", # HunYuanVideo
15
+ "WanAttentionBlock", # Wan
16
+ "HunyuanVideoTransformerBlock", # FramePack
17
+ "HunyuanVideoSingleTransformerBlock", # FramePack
15
18
  ],
16
19
  "unet_target_name": [
17
20
  "conv_in",
@@ -39,6 +42,9 @@ PRESET = {
39
42
  "SingleDiTBlock",
40
43
  "MMDoubleStreamBlock", # HunYuanVideo
41
44
  "MMSingleStreamBlock", # HunYuanVideo
45
+ "WanAttentionBlock", # Wan
46
+ "HunyuanVideoTransformerBlock", # FramePack
47
+ "HunyuanVideoSingleTransformerBlock", # FramePack
42
48
  ],
43
49
  "unet_target_name": [
44
50
  "time_embedding.linear_1",
@@ -63,6 +69,9 @@ PRESET = {
63
69
  "SingleDiTBlock",
64
70
  "MMDoubleStreamBlock", # HunYuanVideo
65
71
  "MMSingleStreamBlock", # HunYuanVideo
72
+ "WanAttentionBlock", # Wan
73
+ "HunyuanVideoTransformerBlock", # FramePack
74
+ "HunyuanVideoSingleTransformerBlock", # FramePack
66
75
  ],
67
76
  "unet_target_name": [],
68
77
  "text_encoder_target_module": [
@@ -102,6 +111,9 @@ PRESET = {
102
111
  "SingleDiTBlock",
103
112
  "MMDoubleStreamBlock", # HunYuanVideo
104
113
  "MMSingleStreamBlock", # HunYuanVideo
114
+ "WanAttentionBlock", # Wan
115
+ "HunyuanVideoTransformerBlock", # FramePack
116
+ "HunyuanVideoSingleTransformerBlock", # FramePack
105
117
  ],
106
118
  "unet_target_name": [
107
119
  "conv_in",
@@ -122,6 +134,9 @@ PRESET = {
122
134
  "SingleDiTBlock",
123
135
  "MMDoubleStreamBlock", # HunYuanVideo
124
136
  "MMSingleStreamBlock", # HunYuanVideo
137
+ "WanAttentionBlock", # Wan
138
+ "HunyuanVideoTransformerBlock", # FramePack
139
+ "HunyuanVideoSingleTransformerBlock", # FramePack
125
140
  ],
126
141
  "unet_target_name": [],
127
142
  "text_encoder_target_module": [],
@@ -105,12 +105,12 @@ def weight_gen(
105
105
  w2 = torch.empty(shape[0][1], shape[1][1])
106
106
 
107
107
  if use_w2:
108
- torch.nn.init.constant_(w2, 1)
108
+ torch.nn.init.constant_(w2, 0)
109
109
  else:
110
110
  if tucker:
111
111
  torch.nn.init.kaiming_uniform_(t2, a=math.sqrt(5))
112
112
  torch.nn.init.kaiming_uniform_(w2a, a=math.sqrt(5))
113
- torch.nn.init.constant_(w2b, 1)
113
+ torch.nn.init.constant_(w2b, 0)
114
114
 
115
115
  if use_w1:
116
116
  torch.nn.init.kaiming_uniform_(w1, a=math.sqrt(5))
@@ -57,9 +57,9 @@ def create_network(
57
57
  constraint = float(kwargs.get("constraint", None) or 0)
58
58
  rescaled = str_bool(kwargs.get("rescaled", False))
59
59
  weight_decompose = str_bool(kwargs.get("dora_wd", False))
60
- wd_on_output = str_bool(kwargs.get("wd_on_output", False))
60
+ wd_on_output = str_bool(kwargs.get("wd_on_output", True))
61
61
  full_matrix = str_bool(kwargs.get("full_matrix", False))
62
- bypass_mode = str_bool(kwargs.get("bypass_mode", None))
62
+ bypass_mode = str_bool(kwargs.get("bypass_mode", False))
63
63
  rs_lora = str_bool(kwargs.get("rs_lora", False))
64
64
  unbalanced_factorization = str_bool(kwargs.get("unbalanced_factorization", False))
65
65
  train_t5xxl = str_bool(kwargs.get("train_t5xxl", False))
@@ -252,6 +252,9 @@ class LycorisNetworkKohya(LycorisNetwork):
252
252
  "SingleDiTBlock",
253
253
  "MMDoubleStreamBlock", # HunYuanVideo
254
254
  "MMSingleStreamBlock", # HunYuanVideo
255
+ "WanAttentionBlock", # Wan
256
+ "HunyuanVideoTransformerBlock", # FramePack
257
+ "HunyuanVideoSingleTransformerBlock", # FramePack
255
258
  ]
256
259
  UNET_TARGET_REPLACE_NAME = [
257
260
  "conv_in",
@@ -699,7 +702,7 @@ class LycorisNetworkKohya(LycorisNetwork):
699
702
  if self.text_encoder_loras:
700
703
  params, descriptions = assemble_params(
701
704
  self.text_encoder_loras,
702
- text_encoder_lr if text_encoder_lr is not None else default_lr,
705
+ text_encoder_lr if text_encoder_lr is not None else learning_rate,
703
706
  self.loraplus_text_encoder_lr_ratio or self.loraplus_lr_ratio,
704
707
  )
705
708
  all_params.extend(params)
@@ -710,7 +713,7 @@ class LycorisNetworkKohya(LycorisNetwork):
710
713
  if self.unet_loras:
711
714
  params, descriptions = assemble_params(
712
715
  self.unet_loras,
713
- unet_lr if unet_lr is not None else default_lr,
716
+ unet_lr if unet_lr is not None else learning_rate,
714
717
  self.loraplus_unet_lr_ratio or self.loraplus_lr_ratio,
715
718
  )
716
719
  all_params.extend(params)
@@ -727,10 +730,10 @@ class LycorisNetworkKohya(LycorisNetwork):
727
730
  def prepare_grad_etc(self, *args):
728
731
  self.requires_grad_(True)
729
732
 
730
- def on_epoch_start(self, unet):
733
+ def on_epoch_start(self, *args):
731
734
  self.train()
732
735
 
733
- def on_step_start(self):
736
+ def on_step_start(self, *args):
734
737
  pass
735
738
 
736
739
  def get_trainable_params(self):
@@ -49,7 +49,7 @@ class LoConModule(LycorisBaseModule):
49
49
  use_scalar=False,
50
50
  rank_dropout_scale=False,
51
51
  weight_decompose=False,
52
- wd_on_out=False,
52
+ wd_on_out=True,
53
53
  bypass_mode=None,
54
54
  rs_lora=False,
55
55
  **kwargs,
@@ -41,7 +41,7 @@ class LohaModule(LycorisBaseModule):
41
41
  use_scalar=False,
42
42
  rank_dropout_scale=False,
43
43
  weight_decompose=False,
44
- wd_on_out=False,
44
+ wd_on_out=True,
45
45
  bypass_mode=None,
46
46
  rs_lora=False,
47
47
  **kwargs,
@@ -58,7 +58,7 @@ class LokrModule(LycorisBaseModule):
58
58
  factor: int = -1, # factorization factor
59
59
  rank_dropout_scale=False,
60
60
  weight_decompose=False,
61
- wd_on_out=False,
61
+ wd_on_out=True,
62
62
  full_matrix=False,
63
63
  bypass_mode=None,
64
64
  rs_lora=False,
@@ -89,9 +89,9 @@ def create_lycoris(module, multiplier=1.0, linear_dim=4, linear_alpha=1, **kwarg
89
89
  constraint = float(kwargs.get("constraint", 0) or 0)
90
90
  rescaled = str_bool(kwargs.get("rescaled", False))
91
91
  weight_decompose = str_bool(kwargs.get("dora_wd", False))
92
- wd_on_output = str_bool(kwargs.get("wd_on_output", False))
92
+ wd_on_output = str_bool(kwargs.get("wd_on_output", True))
93
93
  full_matrix = str_bool(kwargs.get("full_matrix", False))
94
- bypass_mode = str_bool(kwargs.get("bypass_mode", None))
94
+ bypass_mode = str_bool(kwargs.get("bypass_mode", False))
95
95
  unbalanced_factorization = str_bool(kwargs.get("unbalanced_factorization", False))
96
96
 
97
97
  if unbalanced_factorization:
@@ -1,17 +1,17 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: lycoris_lora
3
- Version: 3.2.0.dev2
3
+ Version: 3.2.0.post2
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
7
7
  Author-email: kohaku@kblueleaf.net
8
+ License: Apache-2.0
8
9
  Classifier: Development Status :: 5 - Production/Stable
9
10
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 11.8
10
11
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 12
11
12
  Classifier: Environment :: GPU :: NVIDIA CUDA :: 12 :: 12.1
12
13
  Classifier: Intended Audience :: Developers
13
14
  Classifier: Intended Audience :: End Users/Desktop
14
- Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
@@ -27,6 +27,8 @@ Dynamic: author
27
27
  Dynamic: author-email
28
28
  Dynamic: classifier
29
29
  Dynamic: home-page
30
+ Dynamic: license
31
+ Dynamic: license-file
30
32
  Dynamic: requires-dist
31
33
  Dynamic: requires-python
32
34
  Dynamic: summary
@@ -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.2.0.dev2",
7
+ version="3.2.0.post2",
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",
@@ -12,6 +12,7 @@ setup(
12
12
  zip_safe=False,
13
13
  install_requires=["torch", "einops", "toml", "tqdm"],
14
14
  python_requires=">=3.10",
15
+ license="Apache-2.0",
15
16
  classifiers=[
16
17
  "Development Status :: 5 - Production/Stable",
17
18
  "Environment :: GPU :: NVIDIA CUDA :: 11.8",
@@ -19,7 +20,6 @@ setup(
19
20
  "Environment :: GPU :: NVIDIA CUDA :: 12 :: 12.1",
20
21
  "Intended Audience :: Developers",
21
22
  "Intended Audience :: End Users/Desktop",
22
- "License :: OSI Approved :: Apache Software License",
23
23
  "Programming Language :: Python",
24
24
  "Programming Language :: Python :: 3.10",
25
25
  "Programming Language :: Python :: 3.11",