Fine-tuning Stable Diffusion with KerasCV 🔥

Hi folks,

I hope y’all are doing well. Happy new year!

Delighted to present a project that @deep-diver and I have been working on for a while now – Fine-tuning Stable Diffusion with KerasCV. The project shows how to fine-tune the encoder part of Stable Diffusion on a custom image-caption dataset. It supports model checkpointing, mixed-precision training and is fairly customizable. Following are the main links:

We hope y’all will like the project and have fun playing with it.

5 Likes

Thanks @Sayak_Paul !

There is also:

Amazing stuff :+1:

You missed this one :stuck_out_tongue:

1 Like

Can this model be used for Inpainting by simply adding init and mask images?

Yup. There is already a class for that.

@Ian_Stenbit

Thank you for this well-explained tutorial, @Sayak_Paul !

I have tried running this code on Google Colab, but unfortunately it gives me errors with the version of TensorFlow and keras-cv. Specifically, when I run the first codecell with the imports, I get this error:

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tf-keras 2.15.1 requires tensorflow<2.16,>=2.15, but you have tensorflow 2.16.1 which is incompatible.

Do you happen to have a requirements.txt or a quick-fix to get the correct versions of all the libraries for this code to run on Google Colab? Much appreciated if you can provide this!