Coding Stable Diffusion from scratch in PyTorch

Umar Jamil · Beginner ·🧬 Deep Learning ·2y ago

About this lesson

Full coding of Stable Diffusion from scratch, with full explanation, including explanation of the mathematics. Visual explanation of text-to-image, image-to-image, inpainting Repository with PDF slides: https://github.com/hkproj/pytorch-stable-diffusion Prerequisites: 1) Transformer explained: https://www.youtube.com/watch?v=bCz4OMemCcA Chapters 00:00:00 - Introduction 00:04:30 - What is Stable Diffusion? 00:05:40 - Generative Models 00:12:07 - Forward and Reverse Process 00:17:44 - ELBO and Loss 00:20:30 - Generating New Data 00:22:20 - Classifier-Free Guidance 00:31:00 - CLIP 00:33:20 - Variational Auto Encoder 00:37:26 - Text to Image 00:39:54 - Image to Image 00:41:40 - Inpainting 00:44:30 - Coding the VAE 01:54:50 - Coding CLIP 02:09:10 - Coding the Unet 03:04:40 - Coding the Pipeline 03:53:00 - Coding the Scheduler (DDPM) 04:38:00 - Coding the Inference code

Original Description

Full coding of Stable Diffusion from scratch, with full explanation, including explanation of the mathematics. Visual explanation of text-to-image, image-to-image, inpainting Repository with PDF slides: https://github.com/hkproj/pytorch-stable-diffusion Prerequisites: 1) Transformer explained: https://www.youtube.com/watch?v=bCz4OMemCcA Chapters 00:00:00 - Introduction 00:04:30 - What is Stable Diffusion? 00:05:40 - Generative Models 00:12:07 - Forward and Reverse Process 00:17:44 - ELBO and Loss 00:20:30 - Generating New Data 00:22:20 - Classifier-Free Guidance 00:31:00 - CLIP 00:33:20 - Variational Auto Encoder 00:37:26 - Text to Image 00:39:54 - Image to Image 00:41:40 - Inpainting 00:44:30 - Coding the VAE 01:54:50 - Coding CLIP 02:09:10 - Coding the Unet 03:04:40 - Coding the Pipeline 03:53:00 - Coding the Scheduler (DDPM) 04:38:00 - Coding the Inference code
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

Want to get started with deep learning
Get started with deep learning by leveraging resources like Andrew Karpathy's playlist and frameworks such as TensorFlow or PyTorch
Reddit r/deeplearning
Building a Deepfake Detector From Scratch — What Nobody Tells You
Learn to build a deepfake detector from scratch and understand the challenges involved in detecting AI-generated fake media
Medium · Deep Learning
Unfolding the Meandering Path: High-Dimensional Invariance and the Flat 2D Plane of Neural…
Learn about high-dimensional invariance and its relation to the flat 2D plane of neural networks, and how to apply these concepts to improve model performance
Medium · Deep Learning
Implementing Neural Style Transfer from Scratch: The Project That Started It All
Learn to implement Neural Style Transfer from scratch and understand its significance in deep learning
Medium · Deep Learning

Chapters (18)

Introduction
4:30 What is Stable Diffusion?
5:40 Generative Models
12:07 Forward and Reverse Process
17:44 ELBO and Loss
20:30 Generating New Data
22:20 Classifier-Free Guidance
31:00 CLIP
33:20 Variational Auto Encoder
37:26 Text to Image
39:54 Image to Image
41:40 Inpainting
44:30 Coding the VAE
1:54:50 Coding CLIP
2:09:10 Coding the Unet
3:04:40 Coding the Pipeline
3:53:00 Coding the Scheduler (DDPM)
4:38:00 Coding the Inference code
Up next
Image Classification with ml5.js
The Coding Train
Watch →