Home

Awesome

Diffusion models tutorial

A while ago Stable Diffusion Public Release made available to everyone one of the most powerful deep learning models for image generation.

This repository contains:

1. ๐Ÿš€ Quick start

๐Ÿ“ƒ Read up

Check these slides for a short introduction about the idea behind diffusion models and stable diffusion.

๐Ÿ’ป Play with notebooks

To try out Stable Diffusion by running run one of the Colab notebooks below.

To try out Stable Diffusion 2, you can run one of the Colab notebooks below.

โš’ Understand the theory and learn to build pipelines

To run the notebooks you need to have several libraries installed. You can do that by installing Anaconda (or Miniconda) and then create the environment using the provided env files.

First, try to create the environment using environment.yml:

conda env create -f environment.yml

If it doesn't work out, try with env_flex.yml that allows for a more flexible installation.

conda env create -f env_flex.yml

The risk here is that it will install more recent versions of the software packages and the notebooks might give some errors. You might need to this more flexible install also if you are on Windows.

2. ๐Ÿ’ก Prompt engineering guide

Let's say you want to draw an image of lion. The raw promt, lion will give you images that are usually a bit chaotic or worse quality.

<div> <img src="./img/lion_short.png" width="250"/> </div>

To obtain better results, the prompt should be egineered. A basic recipe is the following:

raw prompt + style + artist + details

Example of elaborated prompts:

"Professional photograph of a lion with a black mane, high quality, highly detailed, award-winning, hd, 8k, awe-inspirin"

<div> <img src="./img/lion_long1.png" width="600"/> </div>

"retrofuturistic portrait of a lion in astro suit, space graphics art in background, close up, wlop, dan mumford, artgerm, liam brazier, peter mohrbacher, raw, featured in artstation, octane render, cinematic, elegant, intricate, 8 k"

<div> <img src="./img/lion_long.png" width="600"/> </div>

To see more examples of prompts and get inspirations, check here. To find a prompt for a specific image, you can use this image classifier notebook.

3. ๐Ÿ“š Resources

Repositories

Colab notebooks (demo)

Colab notebooks (tutorials)

Blogs

Papers