It's certainly possible to train an autoencoder with enough data to make it a reliable compression engine, provided you have a way to deal with all resolutions. Once the training and validation were done, I expect you'd get somewhat better than JPEG compression at some cost in compute more than JPEG. A standard implementation and weights would be all that were required to be agreed on at that point.
I wouldn't use stable diffusion for that task.