pytorch-stable-diffusion and StableDiffusion-PyTorch
These are competitors—both are educational implementations of Stable Diffusion in PyTorch from scratch, serving the same purpose of teaching the model architecture, with the first offering greater community validation through higher stars.
About pytorch-stable-diffusion
hkproj/pytorch-stable-diffusion
Stable Diffusion implemented from scratch in PyTorch
Implements the complete diffusion pipeline including text tokenization (via BPE vocabulary), VAE-based latent encoding/decoding, and cross-attention conditioning between text embeddings and image generation. Supports loading pretrained checkpoints from Hugging Face, including fine-tuned models like InkPunk and Illustration Diffusion variants up to v1.5. Designed as an educational reference implementation that faithfully reproduces the original architecture while remaining compatible with the standard model weights ecosystem.
About StableDiffusion-PyTorch
explainingai-code/StableDiffusion-PyTorch
This repo implements a Stable Diffusion model in PyTorch with all the essential components.
Supports multiple conditioning mechanisms—class labels, text (via CLIP embeddings), and semantic masks—either independently or in combination, operating on latent space via VQVAE compression. Uses DDPM with linear scheduling for the diffusion process and provides modular training pipelines for autoencoders and diffusion models across MNIST and CelebHQ datasets, with configuration-driven setup for custom data.
Related comparisons
Scores updated daily from GitHub, PyPI, and npm data. How scores work