diffusers
diffusers copied to clipboard
Fix saving text encoder weights and kohya weights in advanced dreambooth lora script
What does this PR do?
There seems to be an issue with
- Saving Kohya style weights in the dreambooth advanced lora script. The save path can output a weird directory when using a relative path. e.g. setting
output_dir=../checkpoints/my-dog-modelwill result in the following line creating a path like'../checkpoints/my-dog-model/../checkpoints/my-dog-model.safetensors'https://github.com/huggingface/diffusers/blob/610a71d7d467e4cc892c824db882071ff0d282e1/examples/advanced_diffusion_training/train_dreambooth_lora_sd15_advanced.py#L1984
I've changed this to save the kohya weight as args.output_dir/kohya_lora_weights.safetensors but I'm open to any better naming.
- When passing in the
train_text_encoderargument, I believe there is a missingelsestatement resulting in an ValueError always being raised.
Fixes # (issue)
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the contributor guideline?
- [ ] Did you read our philosophy doc (important for complex PRs)?
- [ ] Was this discussed/approved via a GitHub issue or the forum? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [ ] Did you write any new necessary tests?
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.