Training Your Own Unconditional Diffusion Model (With Minimal Coding)

Saturday 16th July, 2022 - Bruce Sterling

*Meanwhile, in image-generator land:

About two years ago, I wrote my first how-to guide for non-coders on training custom AI models. Back then, GANs were the most cutting-edge form of AI art. Today that title belongs to Clip-guided diffusion models, but a lot of the underlying prep work for creating custom models remains similar and creating custom models remains accessible, even if you can’t code at all.

In this article, I’ll be focusing on guiding you through building an image dataset, and then turning that dataset into a custom clip-guided diffusion model. More specifically, your end result will be an unconditional clip-guided diffusion model. This is a fancy way of saying that all you need to provide to the training notebook is an image dataset, none of the metadata/associated text that would be used to train a conditional model. Due to technological wizardry, an unconditional model is still fully guidable by text inputs!

I won’t be getting into the differences between GANs and diffusion models or how diffusion models work in this tutorial. If you’re new to AI art and the concepts I’m discussing here, the recent Vox piece on clip-guided diffusion (which I’m actually featured in!) is a really good place to start; I recommend that you watch it first and maybe play around with tools like Disco Diffusion before launching into this. I’ve tried to make this guide pretty simple, but at the same time, it’s definitely written with the expectation that you have some experience with AI art/colab notebooks.

To complete this tutorial, you will need:

A Google Colab Pro account to train your model and navigate the final result

ImageAssistant, a Chrome extension for bulk-downloading images from websites

BIRME, a bulk image cropper/resizer accessible from your browser

Alex Spirin’s 256×256 OpenAI diffusion model fine-tuning colab notebook, for training a model based on your dataset

Custom Model-Enabled Disco Diffusion v 5.2 notebook for periodically checking in on your model’s training progress

Step 1: Gathering your dataset….