Stable Diffusion From Scratch
A complete implementation of Stable Diffusion including VAE, Conditional/Unconditional Diffusion, ControlNet, and Latent Diffusion architectures.

What I Built
This is a complete from-scratch implementation of Stable Diffusion, one of the most popular text-to-image generation models. The project covers the entire pipeline from data processing to model training and inference.
Text Prompt → CLIP Encoder → Latent Space → UNet (Diffusion) → VAE Decoder → Generated Image
Core Components Built From Scratch
VAE (Variational Autoencoder)
Compresses images to latent space and reconstructs them with high fidelity
Conditional Diffusion
Generates images conditioned on text prompts or class labels
Unconditional Diffusion
Pure image generation without any conditioning
ControlNet
Adds spatial conditioning using edges, poses, or segmentation maps
Latent Diffusion
Diffusion process in compressed latent space for efficiency