├── README.md ├── cover.png ├── hf_screen1.png ├── hf_screen2.png ├── results.png └── stable-diffusion_tutorial.ipynb /README.md: -------------------------------------------------------------------------------- 1 | # Latent Diffusion Models Tutorial 2 | 3 | 4 | ## An Easy Guide to Latent Diffusion Models. 5 | 6 | 7 | ![title cover image](cover.png) 8 | 9 | 10 | ## Requirements 11 | 12 | If you would like to run it on your own PC instead then make sure you have sufficient hardware resources. Setup a Conda environment with python 3.7 and pytorch. 13 | 14 | ## Running The Notebook 15 | 16 | * Open the Notebook in Google Colab or local jupyter server 17 | * Make sure GPU is selected in the runtime (Runtime->Change Type->GPU) 18 | * Install the requirements 19 | * Run the code in the example sections 20 | * In case of GPU out of memory error, make sure that the model from one example is cleared before running another example. Alternatively, you can restart the runtime and run that particular example directly instead of running the whole notebook. 21 | 22 | 23 | ## The tutorial 📃 24 | 25 | On Medium: 26 | 27 | https://azad-wolf.medium.com/what-are-stable-diffusion-models-and-why-are-they-a-step-forward-for-image-generation-aa1182801d46 28 | 29 | On Substack: 30 | 31 | https://azadwolf.substack.com/p/what-is-a-stable-diffusion-model 32 | 33 | 34 | 35 | ## Text to Image Synthesis 36 | 37 | ![results image](results.png) 38 | 39 | 40 | ## References 41 | 42 | 43 | 44 | [1] Jonathan Ho, Ajay Jain, Pieter Abbeel, "Denoising Diffusion Probabilistic Models", 2020 45 | 46 | [2] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever,"Learning Transferable Visual Models From Natural Language Supervision", 2021 47 | 48 | [3] Robin Rombach and Andreas Blattmann and Dominik Lorenz and Patrick Esser and Björn Ommer, "High-Resolution Image Synthesis with Latent Diffusion Models", arXiv:2112.10752, 2021 49 | 50 | [4] Blattmann, Andreas and Rombach, Robin and Oktay, Kaan and Ommer, Björn, "Retrieval-Augmented Diffusion Models", CVPR, 2022 51 | 52 | [5] Blattmann et. al., Latent Diffusion Models, https://github.com/CompVis/latent-diffusion, 2022 53 | 54 | [6] Blattmann et. al., Stable Diffusion, https://github.com/CompVis/stable-diffusion, 2022 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azad-academy/stable-diffusion-model-tutorial/48e5aee534e9ac3090e2ba126ed829038eb09ec3/cover.png -------------------------------------------------------------------------------- /hf_screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azad-academy/stable-diffusion-model-tutorial/48e5aee534e9ac3090e2ba126ed829038eb09ec3/hf_screen1.png -------------------------------------------------------------------------------- /hf_screen2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azad-academy/stable-diffusion-model-tutorial/48e5aee534e9ac3090e2ba126ed829038eb09ec3/hf_screen2.png -------------------------------------------------------------------------------- /results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azad-academy/stable-diffusion-model-tutorial/48e5aee534e9ac3090e2ba126ed829038eb09ec3/results.png --------------------------------------------------------------------------------