mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-19 06:23:43 +00:00
Merge pull request #210 from modelscope/opensource-alignment
staticmethod
This commit is contained in:
@@ -252,7 +252,8 @@ class FluxLoRAConverter:
|
||||
def __init__(self):
|
||||
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 = {
|
||||
"single_blocks": "lora_unet_single_blocks",
|
||||
"blocks": "lora_unet_double_blocks",
|
||||
|
||||
@@ -81,6 +81,6 @@ if __name__ == '__main__':
|
||||
lora_rank=args.lora_rank,
|
||||
lora_alpha=args.lora_alpha,
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user