Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Examples of Diffusion Models

This repository contains some example applications in which diffusion-based image generation models are used.

Each example/subproject is independent; specific (re-)sources & Co. are explained inside each subproject folder.

  • ddpm/: Training a Denoising Diffusion Probabilistic Model from Scratch
  • diffusers/: Practical Image Generation Examples with HuggingFace Diffusers
  • inpainting_app/: Segementation-Aware In-Painting Application

See the related blog posts for more context:

Setup

In the following, I provide a recipe to set up a conda environment with the necessary packages. Note that a GPU (with at least 12 GB or memory) is required to train and/or using the models.

# Create the necessary Python environment
# NOTE: specific folders might require their own environment
# and have their own requirements.txt
conda env create -f conda.yaml
conda activate genai

# If you have CUDA, install CUDA support with the propper CUDA version, e.g. v12.1 (doesn't need to match 13.0)
pip install torch torchvision torchaudio torchtext --index-url https://download.pytorch.org/whl/cu121
# OTHERWISE, install CPU version -- BUT many examples won't work!
pip install torch torchvision torchaudio torchtext
# Compile rest of dependencies and install them
pip-compile requirements.in
pip install -r requirements.txt

# If we need a new dependency,
# add it to requirements.in 
# (WATCH OUT: try to follow alphabetical order)
# And then:
pip-compile requirements.in
pip install -r requirements.txt

For these examples, I used

Related Resources

Other related repositories of mine:

Mikel Sagardia, 2025
No guaranties.

About

A repository with some examples which use diffusion-based image generation models.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages