参考:SD模型微调之解读LORA及其变种介绍_sd lora-CSDN博客
huggingface的官方训练代码:https://github.com/huggingface/diffusers/blob/02cbe972c3013a596c422b8cc0ca1e872f2eb647/docs/source/en/tutorials/basic_training.md
https://github.com/huggingface/diffusers/blob/aace1f412bc41f521b699a3228f4ec3339160c98/examples/research_projects/scheduled_huber_loss_training/text_to_image/train_text_to_image_lora.py#L414
测试脚本:
https://github.com/huggingface/diffusers/blob/8957324363d8b239d82db4909fbf8c0875683e3d/tests/lora/test_lora_layers_sd.py