One time:
1. Have "conda" installed.
2. clone https://github.com/CompVis/stable-diffusion
3. `conda env create -f environment.yaml`
4. activate the Venv with `conda activate ldm`
5. Download weights from https://huggingface.co/CompVis/stable-diffusion-v-1-4-origin... (requires registration).
6. `mkdir -p models/ldm/stable-diffusion-v1/`
7. `ln -s <path/to/model.ckpt> models/ldm/stable-diffusion-v1/model.ckpt`. (you can download the other version of the model, like v1-1, v1-2, and v1-3 and symlink them instead if you prefer).
To run:
1. activate venv with `conda activate ldm` (unless still in a prompt running inside the venv).
2. `python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plms`.
Also there is a safety filter in the code that will black out NSFW or otherwise expected to be offensive images (presumably also including things like swastikas, gore, etc). It is trivial to disable by editing the source if you want.