mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-24 01:48:13 +00:00
staticmethod
This commit is contained in:
@@ -252,7 +252,8 @@ class FluxLoRAConverter:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def align_to_opensource_format(self, state_dict, alpha=1.0):
|
@staticmethod
|
||||||
|
def align_to_opensource_format(state_dict, alpha=1.0):
|
||||||
prefix_rename_dict = {
|
prefix_rename_dict = {
|
||||||
"single_blocks": "lora_unet_single_blocks",
|
"single_blocks": "lora_unet_single_blocks",
|
||||||
"blocks": "lora_unet_double_blocks",
|
"blocks": "lora_unet_double_blocks",
|
||||||
|
|||||||
@@ -81,6 +81,6 @@ if __name__ == '__main__':
|
|||||||
lora_rank=args.lora_rank,
|
lora_rank=args.lora_rank,
|
||||||
lora_alpha=args.lora_alpha,
|
lora_alpha=args.lora_alpha,
|
||||||
lora_target_modules=args.lora_target_modules,
|
lora_target_modules=args.lora_target_modules,
|
||||||
state_dict_converter=FluxLoRAConverter().align_to_opensource_format if args.align_to_opensource_format else None,
|
state_dict_converter=FluxLoRAConverter.align_to_opensource_format if args.align_to_opensource_format else None,
|
||||||
)
|
)
|
||||||
launch_training_task(model, args)
|
launch_training_task(model, args)
|
||||||
|
|||||||
Reference in New Issue
Block a user