saving models with SDXL+LoRA #7452
-
I have a question regarding saving models with SDXL+LoRA. I can successfully train and use the provided script to load LoRA weights with load_lora_weights(), but how can I save the new pipeline? I would like to treat this as a whole so that I can train the ControlNet module subsequently. I found that using pipe.save_pretrained() doesn't work, as it causes an error saying the UNet is missing many modules when loading the saved model. Could you advise on how to properly save the entire pipeline including the LoRA modifications? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hi @taoxinhao13, |
Beta Was this translation helpful? Give feedback.
-
Hey, you could use the .fuse_lora() method to combine the unet/text-encoder parameters and their corresponding loras into one. When you save your model after that, they are saved with the lora weights as you expect. Relevant documentation: |
Beta Was this translation helpful? Give feedback.
-
That's it!!!! Thanks a lot :) |
Beta Was this translation helpful? Give feedback.
-
@sayakpaul It seems that the answer was not selected correctly. What can be done here? |
Beta Was this translation helpful? Give feedback.
Hi @taoxinhao13,
Could fusing lora be what you are looking for?