diffsynth-engine 0.6.1.dev2__py3-none-any.whl → 0.6.1.dev3__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.
- diffsynth_engine/pipelines/base.py +14 -0
- diffsynth_engine/pipelines/flux_image.py +7 -0
- diffsynth_engine/pipelines/qwen_image.py +5 -0
- {diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/METADATA +1 -1
- {diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/RECORD +8 -8
- {diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/WHEEL +0 -0
- {diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/licenses/LICENSE +0 -0
- {diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/top_level.txt +0 -0
|
@@ -51,6 +51,20 @@ class BasePipeline:
|
|
|
51
51
|
def from_state_dict(cls, state_dicts: BaseStateDicts, pipeline_config: BaseConfig) -> "BasePipeline":
|
|
52
52
|
raise NotImplementedError()
|
|
53
53
|
|
|
54
|
+
def update_weights(self, state_dicts: BaseStateDicts) -> None:
|
|
55
|
+
raise NotImplementedError()
|
|
56
|
+
|
|
57
|
+
@staticmethod
|
|
58
|
+
def update_component(
|
|
59
|
+
component: torch.nn.Module,
|
|
60
|
+
state_dict: Dict[str, torch.Tensor],
|
|
61
|
+
device: str,
|
|
62
|
+
dtype: torch.dtype,
|
|
63
|
+
) -> None:
|
|
64
|
+
if component and state_dict:
|
|
65
|
+
component.load_state_dict(state_dict, assign=True)
|
|
66
|
+
component.to(device=device, dtype=dtype, non_blocking=True)
|
|
67
|
+
|
|
54
68
|
def load_loras(self, lora_list: List[Tuple[str, float]], fused: bool = True, save_original_weight: bool = False):
|
|
55
69
|
for lora_path, lora_scale in lora_list:
|
|
56
70
|
logger.info(f"loading lora from {lora_path} with scale {lora_scale}")
|
|
@@ -573,6 +573,13 @@ class FluxImagePipeline(BasePipeline):
|
|
|
573
573
|
pipe.compile()
|
|
574
574
|
return pipe
|
|
575
575
|
|
|
576
|
+
def update_weights(self, state_dicts: FluxStateDicts) -> None:
|
|
577
|
+
self.update_component(self.dit, state_dicts.model, self.config.device, self.config.model_dtype)
|
|
578
|
+
self.update_component(self.text_encoder_1, state_dicts.clip, self.config.device, self.config.clip_dtype)
|
|
579
|
+
self.update_component(self.text_encoder_2, state_dicts.t5, self.config.device, self.config.t5_dtype)
|
|
580
|
+
self.update_component(self.vae_decoder, state_dicts.vae, self.config.device, self.config.vae_dtype)
|
|
581
|
+
self.update_component(self.vae_encoder, state_dicts.vae, self.config.device, self.config.vae_dtype)
|
|
582
|
+
|
|
576
583
|
def compile(self):
|
|
577
584
|
self.dit.compile_repeated_blocks(dynamic=True)
|
|
578
585
|
|
|
@@ -254,6 +254,11 @@ class QwenImagePipeline(BasePipeline):
|
|
|
254
254
|
pipe.compile()
|
|
255
255
|
return pipe
|
|
256
256
|
|
|
257
|
+
def update_weights(self, state_dicts: QwenImageStateDicts) -> None:
|
|
258
|
+
self.update_component(self.dit, state_dicts.model, self.config.device, self.config.model_dtype)
|
|
259
|
+
self.update_component(self.encoder, state_dicts.encoder, self.config.device, self.config.encoder_dtype)
|
|
260
|
+
self.update_component(self.vae, state_dicts.vae, self.config.device, self.config.vae_dtype)
|
|
261
|
+
|
|
257
262
|
def compile(self):
|
|
258
263
|
self.dit.compile_repeated_blocks(dynamic=True)
|
|
259
264
|
|
|
@@ -139,10 +139,10 @@ diffsynth_engine/models/wan/wan_s2v_dit.py,sha256=sOJsSs1snI-ZGPJS8utstmgj0wcYwl
|
|
|
139
139
|
diffsynth_engine/models/wan/wan_text_encoder.py,sha256=OERlmwOqthAFPNnnT2sXJ4OjyyRmsRLx7VGp1zlBkLU,11021
|
|
140
140
|
diffsynth_engine/models/wan/wan_vae.py,sha256=ogXrVlwmzXR4iLxjSCkBPtYW8KWebnvvd2UtPZeoziY,38853
|
|
141
141
|
diffsynth_engine/pipelines/__init__.py,sha256=jh-4LSJ0vqlXiT8BgFgRIQxuAr2atEPyHrxXWj-Ud1U,604
|
|
142
|
-
diffsynth_engine/pipelines/base.py,sha256=
|
|
143
|
-
diffsynth_engine/pipelines/flux_image.py,sha256=
|
|
142
|
+
diffsynth_engine/pipelines/base.py,sha256=7x7gEdCk_DRnGDMdPGLvNPlk-Yn2p0yQ8pNvr59i-hU,14199
|
|
143
|
+
diffsynth_engine/pipelines/flux_image.py,sha256=LET1gPlkXJN2xE22GRVjUgWJH0ZZBFnAe3bIvJrjb1s,49726
|
|
144
144
|
diffsynth_engine/pipelines/hunyuan3d_shape.py,sha256=fwNKET54KjCiWDpW2S1Fk-p3nfJreZ-RH7p46VLawEQ,7911
|
|
145
|
-
diffsynth_engine/pipelines/qwen_image.py,sha256=
|
|
145
|
+
diffsynth_engine/pipelines/qwen_image.py,sha256=vWe1M3FU-aqckvrVeJlZgMIN55qnRz9hZ2AxGCxro1Y,24134
|
|
146
146
|
diffsynth_engine/pipelines/sd_image.py,sha256=nr-Nhsnomq8CsUqhTM3i2l2zG01YjwXdfRXgr_bC3F0,17891
|
|
147
147
|
diffsynth_engine/pipelines/sdxl_image.py,sha256=FaihRd9Rt_qtqup2xEbHViVIFwFZVyvekYW4lCodNKY,21692
|
|
148
148
|
diffsynth_engine/pipelines/utils.py,sha256=lk7sFGEk-fGjgadLpwwppHKG-yZ0RC-4ZmHW7pRRe8A,473
|
|
@@ -185,8 +185,8 @@ diffsynth_engine/utils/video.py,sha256=GoMyc2as4_VqfWX4pjQyAWh9QObsFMov42zADVZNa
|
|
|
185
185
|
diffsynth_engine/utils/memory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
186
|
diffsynth_engine/utils/memory/linear_regression.py,sha256=oW_EQEw13oPoyUrxiL8A7Ksa5AuJ2ynI2qhCbfAuZbg,3930
|
|
187
187
|
diffsynth_engine/utils/memory/memory_predcit_model.py,sha256=EXprSl_zlVjgfMWNXP-iw83Ot3hyMcgYaRPv-dvyL84,3943
|
|
188
|
-
diffsynth_engine-0.6.1.
|
|
189
|
-
diffsynth_engine-0.6.1.
|
|
190
|
-
diffsynth_engine-0.6.1.
|
|
191
|
-
diffsynth_engine-0.6.1.
|
|
192
|
-
diffsynth_engine-0.6.1.
|
|
188
|
+
diffsynth_engine-0.6.1.dev3.dist-info/licenses/LICENSE,sha256=x7aBqQuVI0IYnftgoTPI_A0I_rjdjPPQkjnU6N2nikM,11346
|
|
189
|
+
diffsynth_engine-0.6.1.dev3.dist-info/METADATA,sha256=CShZsvCWGPzvwFuc_85oCrlb-KBIAEdvV2iA7MJACRQ,1163
|
|
190
|
+
diffsynth_engine-0.6.1.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
191
|
+
diffsynth_engine-0.6.1.dev3.dist-info/top_level.txt,sha256=6zgbiIzEHLbhgDKRyX0uBJOV3F6VnGGBRIQvSiYYn6w,17
|
|
192
|
+
diffsynth_engine-0.6.1.dev3.dist-info/RECORD,,
|
|
File without changes
|
{diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{diffsynth_engine-0.6.1.dev2.dist-info → diffsynth_engine-0.6.1.dev3.dist-info}/top_level.txt
RENAMED
|
File without changes
|