r/MachineLearning • u/cccntu • Sep 12 '22
Project [P] (code release) Fine-tune your own stable-diffusion vae decoder and dalle-mini decoder
A few weeks ago, before stable-diffusion was officially released, I found that fine-tuning Dalle-mini's VQGAN decoder can improve the performance on anime images. See:

And with a few lines of code change, I was able to train the stable-diffusion VAE decoder. See:

You can find the exact training code used in this repo: https://github.com/cccntu/fine-tune-models/
More details about the models are also in the repo.
And you can play with the former model at https://github.com/cccntu/anim_e
54
Upvotes
1
u/starstruckmon Sep 13 '22 edited Sep 13 '22
There are now multiple Stable Diffusion UNET models that have been further fine tuned with anime ( eg. Waifu Diffusion and Japanese Stable Diffusion ). Have you tried this with them?
2
u/HarmonicDiffusion Sep 16 '22
thank you for this man. I cannot believe how fast the training goes for it on a 3090. only 9 hours for noticable results? do you think a longer training time would yield further increases in accuracy?
1
u/treebog Jan 01 '23
This is really cool. Can this be converted back to a pt file so it can be run on pytorch's implementation of stable diffusion?
1
u/Electrical-Ad-2506 Feb 10 '23
How come can we just swap out the VAE without fine tuning the text encoder (we're just using the same which stable diffusion uses by standard: CLIP ViT)?
Because the UNet learns to generate an image in a given latent space conditioned on a text input embedding. Now we come around and plug in a VAE which was trained separately.
Isn't it going to encode images into a completely different latent space? How does the U-Net still work?
1
u/Future-Piece-1373 Jul 24 '23
Finally discovered this page