• Stars
    star
    740
  • Rank 59,154 (Top 2 %)
  • Language
    Python
  • Created about 2 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Self-contained, minimalistic implementation of diffusion models with Pytorch.

minDiffusion

Goal of this educational repository is to provide a self-contained, minimalistic implementation of diffusion models using Pytorch.

Many implementations of diffusion models can be a bit overwhelming. Here, superminddpm : under 200 lines of code, fully self contained implementation of DDPM with Pytorch is a good starting point for anyone who wants to get started with Denoising Diffusion Models, without having to spend time on the details.

Simply:

$ python superminddpm.py

Above script is self-contained. (Of course, you need to have pytorch and torchvision installed. Latest version should suffice. We do not use any cutting edge features.)

If you want to use the bit more refactored code, that runs CIFAR10 dataset:

$ python train_cifar10.py

Above result took about 2 hours of training on single 3090 GPU. Top 8 images are generated, bottom 8 are ground truth.

Here is another example, trained on 100 epochs (about 1.5 hours)

Currently has:

  • Tiny implementation of DDPM
  • MNIST, CIFAR dataset.
  • Simple unet structure. + Simple Time embeddings.
  • CelebA dataset.

TODOS

  • DDIM
  • Classifier Guidance
  • Multimodality

Updates!

  • Using more parameter yields better result for MNIST.
  • More comments in superminddpm.py

More Repositories

1

lora

Using Low-rank adaptation to quickly fine-tune diffusion models.
Jupyter Notebook
6,645
star
2

paint-with-words-sd

Implementation of Paint-with-words with Stable Diffusion : method from eDiff-I that let you generate image from text-labeled segmentation map.
Jupyter Notebook
632
star
3

minSDXL

Huggingface-compatible SDXL Unet implementation that is readily hackable
Jupyter Notebook
345
star
4

consistency_models

Unofficial Implementation of Consistency Models in pytorch
Python
243
star
5

d3pm

Minimal Implementation of a D3PM in pytorch
Jupyter Notebook
130
star
6

realformer-pytorch

Implementation of RealFormer using pytorch
Python
99
star
7

magicmix

Unofficial Implementation of MagicMix
Python
97
star
8

min-max-gpt

Minimal (400 LOC) implementation Maximum (multi-node, FSDP) GPT training
Python
94
star
9

t2i-adapter-diffusers

Python
84
star
10

minRF

Minimal implementation of scalable rectified flow transformers, based on SD3's approach
Python
83
star
11

promptplusplus

Jupyter Notebook
69
star
12

sdxl_inversions

Jupyter Notebook
50
star
13

clipping-CLIP-to-GAN

Python
40
star
14

karras-power-ema-tutorial

Python
40
star
15

ezmup

Simple implementation of muP, based on Spectral Condition for Feature Learning
Python
35
star
16

insightful-nn-papers

These papers will provide unique insightful concepts that will broaden your perspective on neural networks and deep learning
33
star
17

fim-llama-deepspeed

Python
30
star
18

auto_llm_codebase_analysis

Python
24
star
19

min-max-in-dit

Python
20
star
20

inversion_edits

Jupyter Notebook
16
star
21

zeroshot-storytelling

Github repository for Zero Shot Visual Storytelling
Python
15
star
22

imagenet.int8

Python
12
star
23

poly2SOP

Transformer takes a polynomial, expresses it as sum of powers.
Python
11
star
24

planning-with-diffusion-tutorial

Jupyter Notebook
10
star
25

smallest_working_performer

Python
9
star
26

n-body-dynamic-cuda

Cuda
6
star
27

reverse_eng_deepspeed_study

DeepSpeed Study, focused on reverse engineering and enhancing documentation
Python
6
star
28

smallest_working_gpt

gpt that is even smaller
Python
6
star
29

lora_dreambooth_replicate

Jupyter Notebook
4
star
30

Algorithms-TSNE

How are algorithms really related? We use data from solved.ac and matrix factorization to find out.
Python
4
star
31

rectified-flow

Jupyter Notebook
4
star
32

neural-tsp-pytorch

Python
3
star
33

binclone_python

Python
3
star
34

policy-optimization-torch

Python
2
star
35

samsung_s1t1

Jupyter Notebook
2
star
36

culll

Python
2
star
37

latex-quick-figures

atom package
JavaScript
2
star
38

cattalk

Jupyter Notebook
2
star
39

railabweb

Source code for Railab website
HTML
1
star
40

unn-lstm-torch

Python
1
star
41

arp-spoofing

C++
1
star
42

cv

Simple CV (pdf, Latex)
1
star
43

send-arp

C++
1
star
44

project_structured_prompt

Jupyter Notebook
1
star
45

netfilter

C
1
star
46

project_RF

Python
1
star
47

PGAT

On Using Transformer as Password Guessing Attacker
Python
1
star
48

Super-Simple-LSTM-Template

Python
1
star
49

SemanticSegmentationTrainerTemplate

Python
1
star
50

Freshman_2

Lecture notes from my Freshman 2nd semester
HTML
1
star
51

tellghsomething

κ΅°λŒ€κ°„ κ·œν˜„μ΄μ—κ²Œ 짧은 νŽΈμ§€λ₯Ό μ“°μž. λ‹€λ§Œ μžλ™μœΌλ‘œ...
TypeScript
1
star
52

pcap-test

C++
1
star