{"id":25343551,"url":"https://github.com/saadsalmanakram/diffusion-ss","last_synced_at":"2025-09-02T11:04:51.274Z","repository":{"id":255384255,"uuid":"849290047","full_name":"saadsalmanakram/Diffusion-ss","owner":"saadsalmanakram","description":"Learn everything you need to know about diffusion...","archived":false,"fork":false,"pushed_at":"2025-01-28T05:33:35.000Z","size":64,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T06:25:55.223Z","etag":null,"topics":["diffusion","diffusion-model","diffusion-models","stable-diffusion"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saadsalmanakram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T10:29:23.000Z","updated_at":"2025-01-28T05:58:07.000Z","dependencies_parsed_at":"2025-01-28T06:33:15.178Z","dependency_job_id":null,"html_url":"https://github.com/saadsalmanakram/Diffusion-ss","commit_stats":null,"previous_names":["saadsalmanakram/diffusion-ss"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDiffusion-ss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDiffusion-ss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDiffusion-ss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saadsalmanakram%2FDiffusion-ss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saadsalmanakram","download_url":"https://codeload.github.com/saadsalmanakram/Diffusion-ss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238828545,"owners_count":19537704,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffusion","diffusion-model","diffusion-models","stable-diffusion"],"created_at":"2025-02-14T10:39:29.817Z","updated_at":"2025-02-14T10:39:30.468Z","avatar_url":"https://github.com/saadsalmanakram.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n---\n\n# 🌫️ Diffusion Masterclass – Understanding \u0026 Implementing Diffusion Models  \n\n![Diffusion Models](https://cdn.pixabay.com/photo/2024/03/04/14/17/ai-generated-8612487_1280.jpg)  \n\n## 📝 Introduction  \n\n**Diffusion models** are a class of generative models that have recently gained prominence in deep learning, particularly in **image synthesis, denoising, and probabilistic modeling**. These models iteratively **add noise to data** and then learn to reverse the process to generate realistic samples.  \n\nThis repository serves as a **comprehensive guide** to mastering **Diffusion Models**, covering theoretical foundations, practical implementations, and applications in AI.  \n\n📌 **Understand the mathematics behind diffusion models**  \n📌 **Implement diffusion models from scratch using PyTorch**  \n📌 **Explore applications in image generation, denoising, and more**  \n📌 **Use Stable Diffusion, DDPM, and advanced diffusion techniques**  \n\n---\n\n## 🚀 Features  \n\n- 📖 **Theory \u0026 Fundamentals** of Diffusion Models  \n- 🖼️ **Image Generation with Denoising Diffusion Probabilistic Models (DDPM)**  \n- ⚡ **Implementation in PyTorch**  \n- 🌍 **Stable Diffusion \u0026 Latent Diffusion Models (LDMs)**  \n- 🔍 **Exploration of Variational Diffusion Models \u0026 Score-Based Methods**  \n- 📝 **Jupyter notebooks with step-by-step explanations**  \n\n---\n\n## 📂 Repository Structure  \n\n```\nDiffusion-ss/\n│── theory/               # Theory \u0026 mathematical foundations\n│── notebooks/            # Jupyter notebooks with implementations\n│── models/               # PyTorch implementations of diffusion models\n│── applications/         # Real-world applications (image generation, denoising, etc.)\n│── experiments/          # Custom diffusion experiments \u0026 modifications\n│── README.md             # Documentation\n└── requirements.txt      # Python dependencies\n```\n\n---\n\n## 🏆 Getting Started  \n\n### 1️⃣ Clone the Repository  \n```bash\ngit clone https://github.com/saadsalmanakram/Diffusion-ss.git\ncd Diffusion-ss\n```\n\n### 2️⃣ Install Dependencies  \n```bash\npip install -r requirements.txt\n```\n\n### 3️⃣ Run a Simple Diffusion Model  \n```bash\npython models/ddpm.py\n```\n\n---\n\n## 🔍 Topics Covered  \n\n### 📖 **Theory \u0026 Fundamentals**  \n- What are **Diffusion Models**?  \n- Forward \u0026 Reverse Diffusion Process  \n- **Mathematical Formulation** (Stochastic Differential Equations)  \n- **DDPM vs. Score-Based Generative Models**  \n\n### 🖼️ **Image Generation with Diffusion Models**  \n- Implementing **Denoising Diffusion Probabilistic Models (DDPM)**  \n- Training diffusion models on **CIFAR-10, CelebA, and ImageNet**  \n- **Latent Diffusion Models (LDMs) \u0026 Stable Diffusion**  \n\n### ⚡ **Diffusion Models in PyTorch**  \n- Building a simple **DDPM from scratch**  \n- Training a model to **generate high-resolution images**  \n- Implementing **U-Net-based diffusion architectures**  \n\n### 🔍 **Advanced Diffusion Techniques**  \n- **Classifier-free guidance** for improved generation  \n- **Conditional diffusion models** (text-to-image)  \n- **Speeding up inference using fast sampling methods (DDIM, PNDM)**  \n\n### 🚀 **Real-World Applications**  \n- **Image Denoising \u0026 Super-Resolution**  \n- **Text-to-Image Generation (Stable Diffusion, Imagen, DALL·E 2)**  \n- **Video \u0026 3D Diffusion Models**  \n\n---\n\n## 🚀 Example Code  \n\n### 🖼️ **Simple Forward Diffusion Process**  \n```python\nimport torch\nimport torch.nn.functional as F\n\ndef forward_diffusion(x, noise, t, betas):\n    sqrt_alpha = (1 - betas).cumprod(dim=0).sqrt()\n    return sqrt_alpha[t] * x + torch.sqrt(1 - sqrt_alpha[t]) * noise\n\nx = torch.randn(1, 3, 64, 64)  # Random image\nnoise = torch.randn_like(x)\nbetas = torch.linspace(0.0001, 0.02, 1000)  # Noise schedule\ndiffused_x = forward_diffusion(x, noise, 100, betas)\n```\n\n### 🔄 **Reverse Process with Learned Model**  \n```python\nimport torch.nn as nn\n\nclass SimpleUNet(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.conv1 = nn.Conv2d(3, 64, kernel_size=3, padding=1)\n        self.conv2 = nn.Conv2d(64, 3, kernel_size=3, padding=1)\n\n    def forward(self, x, t):\n        x = F.relu(self.conv1(x))\n        return self.conv2(x)\n\nmodel = SimpleUNet()\nprediction = model(diffused_x, 100)  # Reverse step prediction\n```\n\n---\n\n## 🔥 Cutting-Edge Diffusion Models  \n\n📌 **Stable Diffusion** – Latent space diffusion for **high-resolution text-to-image generation**  \n📌 **DALL·E 2 \u0026 Imagen** – **Transformer-based conditional diffusion models**  \n📌 **Score-Based Generative Models** – SDE-based methods for **high-fidelity image synthesis**  \n📌 **Variational Diffusion Models (VDM)** – **Improving likelihood-based training**  \n\n---\n\n## 🏆 Contributing  \n\nContributions are welcome! 🚀  \n\n🔹 **Fork** the repository  \n🔹 Create a new branch (`git checkout -b feature-name`)  \n🔹 Commit changes (`git commit -m \"Added DDIM sampling\"`)  \n🔹 Push to your branch (`git push origin feature-name`)  \n🔹 Open a pull request  \n\n---\n\n## 📜 License  \n\nThis project is licensed under the **MIT License** – feel free to use, modify, and share the code.  \n\n---\n\n## 📬 Contact  \n\n📧 **Email:** saadsalmanakram1@gmail.com  \n🌐 **GitHub:** [SaadSalmanAkram](https://github.com/saadsalmanakram)  \n💼 **LinkedIn:** [Saad Salman Akram](https://www.linkedin.com/in/saadsalmanakram/)  \n\n---\n\n⚡ **Master Diffusion Models \u0026 Unlock the Future of Generative AI!** ⚡  \n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadsalmanakram%2Fdiffusion-ss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaadsalmanakram%2Fdiffusion-ss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaadsalmanakram%2Fdiffusion-ss/lists"}