simple script for easy flux finetuning from a folder of images. uses replicate for the cloud gpu goodness.
- populate .env file: add your openai and replicate keys. openai used for captioning.
pip install -r requirements.txt
- put all the images inside
data/source_images
- adjust constants at the top of
finetune.py
(your replicate details) - run
python finetune.py
- wait for the script to finish and it will return the the training url
- optionally create embeddings for all the image descriptions and store them in a .csv - so that later you can do semantic searches over your image library
- ask the user for details e.g. what to call the model
- create a new folder data/training_pack and copy + convert all images and rename to uuid.jpg format
- if need be - downscale images to 1024x1024 (max)
- run each image through gpt4-o-mini to generate a description
- save all descriptions as uuid.txt and put it into the same folder, optionally creates embeddings and adds to the csv
- .zip the folder
- create a new model on replicate
- create a new training job on replicate - and give the user the url to check on the training