Stable Diffusion

From Interaction Station Wiki
Jump to navigation Jump to search

Generating images from a sentence using Stable Diffusion

Stable Diffusion is an AI algorithm developed by CompVis and sponsored primarily by Stability AI, a startup that aims to be the driving-force behind the open-source AI. The algorithm itself builds on ideas from Open AI’s DALL-E 2, Google’s Imagen and other image generation models, with some extra optimizations.

Running Stable Diffusion (SD)

At the time of writing, Stable Diffusion (SD) is only installed on the PCs in classroom WH.02.110. So find yourself a PC and login to Ubuntu.

Parameters

--prompt "a painting of a fantasy landscape": Sentence (prompt) to generate an image off, between double quotes
--outdir outputs/txt2img-samples: Directory (folder) to save the generated image to
--skip_grid: Generate single images instead of multiple images in a grid
--skip_save: Do not save images
--ddim_steps 50: Steps for image processing, higher means more detail. Worse results past 250
--fixed_code
--ddim_eta
--n_iter
--H
--W
--C
--f
--n_samples 5: How many images to generate for each given prompt
--n_rows 5: Rows in the grid
--scale
--from-file
--seed
--small_batch: Reduce time when generate a smaller batch of image
--precision

Image sizes

[1:1] Square: --W 512 --H 512
[16:9] Widescreen: --W 1024 --H 576
[9:16] Mobile first (Instagram stories, Snapchat etc): --W 576 --H 1024
[10:16] Portrait: --W 640 --H 1024

Code

Github: https://github.com/mywdka/stable-diffusion

Tools

Dataset explorer: https://knn5.laion.ai (mirror)
Prompt builder: https://promptomania.com/stable-diffusion-prompt-builder/
Img to prompt: https://replicate.com/methexis-inc/img2prompt
Prompt examples: https://lexica.art/
Have I Been Trained: https://haveibeentrained.com/

Community

Discord: http://discord.gg/stablediffusion