Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
This repo implements a Stable Diffusion model in PyTorch with all the essential components.
| Date | Stars |
|---|---|
| 2026-07-24 | 254 |
| 2026-07-25 | 254 |
| 2026-07-28 | 254 |
| 2026-07-30 | 254 |
| 2026-07-31 | 254 |
| 2026-08-09 | 254 |
| 2026-09-02 | 255 |
| 2026-09-20 | 255 |
Today
— stars today
This week
— stars this week
This month
+1 stars this month
Momentum
0.0
growth rate 0.00%/day
Stable Diffusion Implementation in PyTorch
========
This repository implements Stable Diffusion.
As of today the repo provides code to do the following:
* Training and Inference on Unconditional Latent Diffusion Models
* Training a Class Conditional Latent Diffusion Model
* Training a Text Conditioned Latent Diffusion Model
* Training a Semantic Mask Conditioned Latent Diffusion Model
* Any Combination of the above three conditioning
For autoencoder I provide code for vae as well as vqvae.
But both the stages of training use VQVAE only. One can easily change that to vae if needed
For diffusion part, as of now it only implements DDPM with linear schedule.
## Stable Diffusion Tutorial Videos
<a href="https://www.youtube.com/watch?v=1BkzNb3ejK4">
<img alt="Stable Diffusion Tutorial" src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/7a24d114-38bd-43a8-9819-3afa112f39ab"
width="400">
</a>
<a href="https://www.youtube.com/watch?v=hEJjg7VUA8g">
<img alt="Stable Diffusion Conditioning Tutorial" src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/0b03cae4-4009-4bd7-8b02-328b0c5f33a3"
width="400">
</a>
___
## Sample Output for Autoencoder on CelebHQ
Image - Top, Reconstructions - Below
<img src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/2260d618-046e-411c-bea5-0c4cb7438560" width="300">
## Sample Output for Unconditional LDM on CelebHQ (not fully converged)
<img src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/212cd84a-9bd1-43f0-93b4-3b8ff9866571" width="300">
## Sample Output for Conditional LDM
### Sample Output for Class Conditioned on MNIST





### Sample Output for Text(using CLIP) and Mask Conditioned on CelebHQ (not converged)
<img src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/78aa92bb-655e-46f6-92e9-a0c59787d700" width="100">
</br>
<img src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/9fcf66fb-65d7-4c2c-9fc4-9bbe428de11f" width="100">
Text - She is a woman with blond hair
</br>
<img src="https://github.com/explainingai-code/StableDiffusion-PyTorch/assets/144267687/44ad67c8-c1e1-4ade-936f-18da92202e55" width="100">
Text - She is a woman with black hair
___
## Setup
* Create a new conda environment with python 3.8 then run below commands
* `conda activate <environment_name>`
* ```git clone https://github.com/explainingai-code/StableDiffusion-PyTorch.git```
* ```cd StableDiffusion-PyTorch```
* ```pip install -r requirements.txt```
* Download lpips weights by opening this link in browser(dont use cURL or wget) https://github.com/richzhang/PerceptualSimilarity/blob/master/lpips/weights/v0.1/vgg.pth and downloading the raw file. Place the downloaded weights file in ```models/weights/v0.1/vgg.pth```
___
## Data Preparation
### Mnist
For setting up the mnist dataset follow - https://github.com/explainingai-code/Pytorch-VAE#data-preparation
Ensure directory structure is following
```
StableDiffusion-PyTorch
-> data
-> mnist
-> train
-> images
-> *.png
-> test
-> images
-> *.png
```
### CelebHQ
#### Unconditional
For setting up on CelebHQ for unconditional, simply download the images from the officiExcerpt of 15,821 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:832b5ce131731773, topic:stable-diffusion, desc:diffusion model, readme:diffusion model