What is an EMA Checkpoint in Stable Diffusion and Do You Need It?

Have you wondered what an “EMA” weighted version of Stable Diffusion was for? Perhaps you’re trying to install the program, or you’re just curious because the strange term showed up in your readings. Well, in this article, I’ll give the easy-to-digest explanation for EMAs, what they do, and if you need them for your Stable Diffusion uses.

What is an EMA?

EMA stands for “exponential moving average”. An exponential moving average is a type of mathematical average taken from data where the most recent data points have more weight than older data points.

This is opposed to a simple moving average, where each data point is considered equally.

A good example of this is when moving averages are used in stock price analysis. A price on a given day is a data point. If you make an exponential moving average of the price for the last 90 days, then the prices that occurred most recently would have a greater impact on the calculation than the oldest prices. If it was a simple moving average, each price on each day would affect the calculation equally.

What do EMAs have to Do with AI Art Checkpoint Models?

So how does this relate to AI art? Stable Diffusion models are trained on large datasets and the EMA is used to smooth out the AI’s parameters during training. After each step of training that the model does, an EMA equation is applied before it moves to the next step. This simply increases the performance of the process.

In short, what is an EMA for AI art makers who aren’t mathematicians or data scientists? It’s just a smoothing refinement that improves overall performance of the AI model during training.

What is an EMA Model Used For?

Stable Diffusion offers an EMA checkpoint file and a non-ema checkpoint file. The EMA version is used for training (if you want to make a custom model). The Non-EMA version is used for inference…that is, generating images with Stable Diffusion.

Do I need an EMA Checkpoint Model?

No, you do not need an EMA model if you’re just generating AI art pictures. You only need it if you plan on fine-tuning a custom model for Stable Diffusion.

So if you’re installing Stable Diffusion on your computer only for making images from the pre-trained model, you can save yourself about 3 gigabytes of disk space by just downloading the smaller, non-EMA version of Stable Diffusion.

Conclusion

I hope this cleared up any confusion you may have felt on the subject. If you found this article helpful, here are a few more topics that may interest you: