diffsynth-engine 0.4.2.dev6__py3-none-any.whl → 0.4.2.dev7__py3-none-any.whl

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.
@@ -41,19 +41,32 @@ class QwenImageLoRAConverter(LoRAStateDictConverter):
41
41
  dit_dict = {}
42
42
  for key, param in lora_state_dict.items():
43
43
  origin_key = key
44
- if "lora_A.default.weight" not in key:
44
+ lora_a_suffix = None
45
+ if "lora_A.default.weight" in key:
46
+ lora_a_suffix = "lora_A.default.weight"
47
+ elif "lora_A.weight" in key:
48
+ lora_a_suffix = "lora_A.weight"
49
+
50
+ if lora_a_suffix is None:
45
51
  continue
52
+
46
53
  lora_args = {}
47
54
  lora_args["down"] = param
48
- lora_args["up"] = lora_state_dict[origin_key.replace("lora_A.default.weight", "lora_B.default.weight")]
55
+
56
+ lora_b_suffix = lora_a_suffix.replace("lora_A", "lora_B")
57
+ lora_args["up"] = lora_state_dict[origin_key.replace(lora_a_suffix, lora_b_suffix)]
58
+
49
59
  lora_args["rank"] = lora_args["up"].shape[1]
50
- alpha_key = origin_key.replace("lora_A.default.weight", "alpha").replace("lora_up.default.weight", "alpha")
60
+ alpha_key = origin_key.replace("lora_up", "lora_A").replace(lora_a_suffix, "alpha")
61
+
51
62
  if alpha_key in lora_state_dict:
52
63
  alpha = lora_state_dict[alpha_key]
53
64
  else:
54
65
  alpha = lora_args["rank"]
55
66
  lora_args["alpha"] = alpha
56
- key = key.replace(".lora_A.default.weight", "")
67
+
68
+ key = key.replace(f".{lora_a_suffix}", "")
69
+
57
70
  if key.startswith("transformer") and "attn.to_out.0" in key:
58
71
  key = key.replace("attn.to_out.0", "attn.to_out")
59
72
  dit_dict[key] = lora_args
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffsynth_engine
3
- Version: 0.4.2.dev6
3
+ Version: 0.4.2.dev7
4
4
  Author: MuseAI x ModelScope
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Operating System :: OS Independent
@@ -131,7 +131,7 @@ diffsynth_engine/models/wan/wan_vae.py,sha256=AmBuqyPwZCFY0e8lUThlJoNHmpmTm2_dE1
131
131
  diffsynth_engine/pipelines/__init__.py,sha256=9QZVhZeRm_5m7yxie08yBtgM26NB4mfVBOjj1Prlv-k,447
132
132
  diffsynth_engine/pipelines/base.py,sha256=730FzAn1cxZ2SM2qr9SXk7qNLpAau9PKEqwfMSW_8Aw,12336
133
133
  diffsynth_engine/pipelines/flux_image.py,sha256=gWuZaMeupB_Wz3AY97eE1eEVSAmAm14aXIxkAqNXY7E,49224
134
- diffsynth_engine/pipelines/qwen_image.py,sha256=S15FAxmiWcF3qItBigXR9jVJa4h9Qqs4_8cT3KXi8Ec,17506
134
+ diffsynth_engine/pipelines/qwen_image.py,sha256=85fQoBKzsoHL-s5NCy5ZJCnCjC8YgrGjA8cNLOy4t7s,17746
135
135
  diffsynth_engine/pipelines/sd_image.py,sha256=5cIIknh2M-fOqj7urKi9nZ40yc1LnvepbH_Af7SF4UA,17789
136
136
  diffsynth_engine/pipelines/sdxl_image.py,sha256=otv1T_0fhX3UcIoKbKCqb47Yge6xg0fPM0ry-uPEanI,21548
137
137
  diffsynth_engine/pipelines/utils.py,sha256=lk7sFGEk-fGjgadLpwwppHKG-yZ0RC-4ZmHW7pRRe8A,473
@@ -168,8 +168,8 @@ diffsynth_engine/utils/parallel.py,sha256=TtB6FzP2qo4VQqSenVnV-ZaKmp9xHaIWJ8D1Zj
168
168
  diffsynth_engine/utils/platform.py,sha256=2lXdw6YkqcRONCeT98n4cyg1Ii8Ybbyj2Ns72Se9tlk,496
169
169
  diffsynth_engine/utils/prompt.py,sha256=YItMchoVzsG6y-LB4vzzDUWrkhKRVlt1HfVhxZjSxMQ,280
170
170
  diffsynth_engine/utils/video.py,sha256=Ne0rd2lb59UT1q5EotpjlY7OT8F9oTCFDyo1ST77uoQ,1004
171
- diffsynth_engine-0.4.2.dev6.dist-info/licenses/LICENSE,sha256=x7aBqQuVI0IYnftgoTPI_A0I_rjdjPPQkjnU6N2nikM,11346
172
- diffsynth_engine-0.4.2.dev6.dist-info/METADATA,sha256=xy1w-I4tAN0UahyFnr4ZP9EoMzm8C1uFGSrC4Y1P0m4,1110
173
- diffsynth_engine-0.4.2.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
174
- diffsynth_engine-0.4.2.dev6.dist-info/top_level.txt,sha256=6zgbiIzEHLbhgDKRyX0uBJOV3F6VnGGBRIQvSiYYn6w,17
175
- diffsynth_engine-0.4.2.dev6.dist-info/RECORD,,
171
+ diffsynth_engine-0.4.2.dev7.dist-info/licenses/LICENSE,sha256=x7aBqQuVI0IYnftgoTPI_A0I_rjdjPPQkjnU6N2nikM,11346
172
+ diffsynth_engine-0.4.2.dev7.dist-info/METADATA,sha256=YSyezFrU6BpYPsmbUxPV17Klnsko-2BKaj5-eeDHKoE,1110
173
+ diffsynth_engine-0.4.2.dev7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
174
+ diffsynth_engine-0.4.2.dev7.dist-info/top_level.txt,sha256=6zgbiIzEHLbhgDKRyX0uBJOV3F6VnGGBRIQvSiYYn6w,17
175
+ diffsynth_engine-0.4.2.dev7.dist-info/RECORD,,