diffusers
diffusers copied to clipboard
Make saving the full model optional for textual inversion
Is your feature request related to a problem? Please describe.
The resulting .bin file from the textual inversion script can be loaded with a few lines of code into the standard model. Saving a full model only to have an additional token is a waste of space (and possibly VRAM and CPU/GPU time).
Describe the solution you'd like Add a flag to only optionally run these lines:
https://github.com/huggingface/diffusers/blob/d3f1a4c0f03fb84ec45b9491ca77cf99c36936f8/examples/textual_inversion/textual_inversion.py#L556-L567
Describe alternatives you've considered One can comment them oneself or use an own training script.
Hi, thanks for the issue! Would you like to open a PR to add an argument to specify not to save the whole model ?
Yes.
I've got some code to load learned embeddings to continue training as well. I wonder if I should put it into the same pull requests. It's basically the load function from the textual inversion notebook, I think.
Let's do one PR at a time, let's add the option to not save the whole model.
Later then. I also still have the use_auth_token code in my copy of the script and so on and should merge and test it with diffusers git before.
Does repo.push_to_hub push the full model or the embeddings only?
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Closing here and leaving the pull request open.