Submitted by YaYaLeB t3_y3usrj in MachineLearning
Hello the community,
Since the release of diffusion models we saw many posts on that.
The one made by Lambdalabs was very interesting and fun.
However I found it personally difficult to finetune on my own data. This is why I created a repository that simplifies a bit the process https://github.com/YaYaB/finetune-diffusion.
It breaks down into several steps:
- Dataset creation and how to actually create a dataset using HuggingFace's datasets library
- Captioning if you do not have any using BLIP similarly to lambdalabs
- Finetuning based on a script released by HuggingFace on their diffusers repository
I've added a few functionalities in the whole process:
- Simplify the captioning and dataset creation in a few scripts
- Finetuning can be done on a local dataset (if you do not want or can not share your dataset on HuggingFace Hub)
- Validation prompts can be set at every epoch (to verify when the model begins to overfit)
- Model can be uploaded to HuggingFace hub every X epochs
- A script to test your model locally has been added
- A dataset card template is available
- A space app can be copied an modified
In the Results section of the README you'll find some examples of prompts based on a model finetuned on One Piece characters and another one on Magic cards.
Demos are available (sorry in advance for the latency I don't have a pro HuggingFace account yet):
- https://huggingface.co/spaces/YaYaB/text-to-magic
- https://huggingface.co/spaces/YaYaB/text-to-onepiece
Attached some results based on finetuning on Magic cards.
Next steps:
- Dockerize everything to simplify the process
- Dump the weights locally every X epochs (it takes a lot of disk space)
- Add some visualization tool to play with it
Hope it can be helpful to anyone :)
hackerllama t1_isbrz8y wrote
Hey there! Omar from Hugging Face here. Very cool project! We just granted some free GPUs so people can enjoy much faster inference. Enjoy!