Stable Diffusion from Scratch in PyTorch | Conditional Latent Diffusion Models

ExplainingAI · Beginner ·🎨 Image & Video AI ·2y ago

About this lesson

In this video, we'll cover all the different types of conditioning in latent diffusion and finish stable diffusion implementation in PyTorch and after this you would be able to build and train Stable Diffusion from scratch. This is Part II of the tutorial where I get into conditioning in latent diffusion models. We dive deep into class conditioning in latent diffusion models, implementing class conditional latent diffusion model and see results of training latent diffusion model to conditionally generate mnist digits. Then we get into semantic synthesis in latent diffusion models, and implement that. We also understand super resolution in latent diffusion and see how inpainting with latent diffusion model can be done without training it for that. We then see latent diffusion model is fine tuned for inpainting. Finally we get into cross attention and see how stable diffusion uses cross attention to do text conditioning. We will also implement cross attention for latent diffusion models and see results of text to image latent diffusion models We then see how to move from latent diffusion to stable diffusion model and also talk about clip a bit. By the end of this video, you will be able to code conditional stable diffusion in PyTorch by yourself. ⏱️ Timestamps 00:00 Introduction 00:54 Recap of Unconditional latent Diffusion Models 02:15 Class Conditioning in Latent Diffusion Models 07:05 Recap of Implementation of Latent Diffusion Models 11:10 Class Conditioning Implementation in Latent Diffusion Models 16:40 Results of Class Conditioning 17:37 Spatial Image Conditioning in Latent Diffusion Models 18:47 Semantic Synthesis in Latent Diffusion Models 20:25 Semantic Synthesis Implementation in LDM 24:55 Results of Semantic Synthesis 25:49 Super Resolution using Latent Diffusion Models 26:42 Inpainting with Latent Diffusion Models 31:25 Text Conditioning Introduction 31:33 Self Attention Explained 34:58 Cross Attention Explained 38:28 Image Conditioning using Cross A

Original Description

In this video, we'll cover all the different types of conditioning in latent diffusion and finish stable diffusion implementation in PyTorch and after this you would be able to build and train Stable Diffusion from scratch. This is Part II of the tutorial where I get into conditioning in latent diffusion models. We dive deep into class conditioning in latent diffusion models, implementing class conditional latent diffusion model and see results of training latent diffusion model to conditionally generate mnist digits. Then we get into semantic synthesis in latent diffusion models, and implement that. We also understand super resolution in latent diffusion and see how inpainting with latent diffusion model can be done without training it for that. We then see latent diffusion model is fine tuned for inpainting. Finally we get into cross attention and see how stable diffusion uses cross attention to do text conditioning. We will also implement cross attention for latent diffusion models and see results of text to image latent diffusion models We then see how to move from latent diffusion to stable diffusion model and also talk about clip a bit. By the end of this video, you will be able to code conditional stable diffusion in PyTorch by yourself. ⏱️ Timestamps 00:00 Introduction 00:54 Recap of Unconditional latent Diffusion Models 02:15 Class Conditioning in Latent Diffusion Models 07:05 Recap of Implementation of Latent Diffusion Models 11:10 Class Conditioning Implementation in Latent Diffusion Models 16:40 Results of Class Conditioning 17:37 Spatial Image Conditioning in Latent Diffusion Models 18:47 Semantic Synthesis in Latent Diffusion Models 20:25 Semantic Synthesis Implementation in LDM 24:55 Results of Semantic Synthesis 25:49 Super Resolution using Latent Diffusion Models 26:42 Inpainting with Latent Diffusion Models 31:25 Text Conditioning Introduction 31:33 Self Attention Explained 34:58 Cross Attention Explained 38:28 Image Conditioning using Cross A
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
50+ Sequential Images, One Prompt in Codex
Learn to generate sequential images with Codex using a single prompt and understand the limitations of this approach
Medium · ChatGPT
📰
How can I batch-generate 3D assets from prompts or images using an API, and which 3D generation APIs support batch generation?
Learn to batch-generate 3D assets from prompts or images using APIs for efficient pipeline creation
Reddit r/artificial
📰
How AI Head Swap Works: The Technology Behind Realistic AI Image Replacement
Learn how AI head swap technology works and its applications in image editing
Dev.to AI
📰
How I Built an AI Pet Portrait Generator That Turns Photos Into Art
Learn how to build an AI pet portrait generator that turns photos into art using deep learning techniques and Python libraries
Dev.to · William Li

Chapters (16)

Introduction
0:54 Recap of Unconditional latent Diffusion Models
2:15 Class Conditioning in Latent Diffusion Models
7:05 Recap of Implementation of Latent Diffusion Models
11:10 Class Conditioning Implementation in Latent Diffusion Models
16:40 Results of Class Conditioning
17:37 Spatial Image Conditioning in Latent Diffusion Models
18:47 Semantic Synthesis in Latent Diffusion Models
20:25 Semantic Synthesis Implementation in LDM
24:55 Results of Semantic Synthesis
25:49 Super Resolution using Latent Diffusion Models
26:42 Inpainting with Latent Diffusion Models
31:25 Text Conditioning Introduction
31:33 Self Attention Explained
34:58 Cross Attention Explained
38:28 Image Conditioning using Cross A
Up next
Google Nano Banana AI Image Generator 🤯 Create & Edit Images in Seconds | Latest Google AI Tool 2026
Learn with Fatimah Gondal
Watch →