add Content tabs

This commit is contained in:
mauwii 2022-09-17 06:34:38 +02:00
parent 7b28b5c9a1
commit b9183b00a0
No known key found for this signature in database
GPG Key ID: D923DB04ADB3F5AB

View File

@ -31,50 +31,57 @@ some time:
[sd-v1-4.ckpt (4.27 GB)](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt) [sd-v1-4.ckpt (4.27 GB)](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/blob/main/sd-v1-4.ckpt)
and note where you have saved it (probably the Downloads folder) and note where you have saved it (probably the Downloads folder)
While that is downloading, open Terminal and run the following commands one at a While that is downloading, open a Terminal and run the following commands:
time.
```{ .bash .annotate } ```bash title="install brew (and Xcode command line tools)"
# install brew (and Xcode command line tools):
/bin/bash -c \ /bin/bash -c \
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
# Now there are two different routes to get the Python (miniconda) environment !!! quote "Conda Installation"
# up and running: Now there are two different ways to set up the Python (miniconda) environment:
#
# 1. Alongside pyenv
# 2. No pyenv
#
# If you don't know what we are talking about, choose 2.
# NOW EITHER DO 1. Standalone
# 1. Installing alongside pyenv 2. with pyenv
brew install pyenv-virtualenv # (1) If you don't know what we are talking about, choose Standalone
pyenv install anaconda3-2022.05
pyenv virtualenv anaconda3-2022.05
eval "$(pyenv init -)"
pyenv activate anaconda3-2022.05
# OR, === "Standalone"
# 2. Installing standalone
# install cmake and rust:
brew install cmake rust
# install miniconda for M1 arm64: ```bash
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh \ # install cmake and rust:
brew install cmake rust
```
=== "M1 arm64"
```bash
# install miniconda for M1 arm64:
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh \
-o Miniconda3-latest-MacOSX-arm64.sh -o Miniconda3-latest-MacOSX-arm64.sh
/bin/bash Miniconda3-latest-MacOSX-arm64.sh /bin/bash Miniconda3-latest-MacOSX-arm64.sh
```
# OR install miniconda for Intel: === "Intel x86_64"
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh \
```bash
# OR install miniconda for Intel:
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh \
-o Miniconda3-latest-MacOSX-x86_64.sh -o Miniconda3-latest-MacOSX-x86_64.sh
/bin/bash Miniconda3-latest-MacOSX-x86_64.sh /bin/bash Miniconda3-latest-MacOSX-x86_64.sh
```
=== "with pyenv"
# EITHER WAY, ```bash
# continue from here brew install pyenv-virtualenv # you might already have this installed, no problem
pyenv install anaconda3-2022.05
pyenv virtualenv anaconda3-2022.05
eval "$(pyenv init -)"
pyenv activate anaconda3-2022.05
```
```{.bash .annotate}
# clone the repo # clone the repo
git clone https://github.com/lstein/stable-diffusion.git git clone https://github.com/lstein/stable-diffusion.git
cd stable-diffusion cd stable-diffusion
@ -84,45 +91,55 @@ cd stable-diffusion
# create symlink to checkpoint # create symlink to checkpoint
mkdir -p models/ldm/stable-diffusion-v1/ mkdir -p models/ldm/stable-diffusion-v1/
PATH_TO_CKPT="$HOME/Downloads" # (2) PATH_TO_CKPT="$HOME/Downloads" # (1)
ln -s "$PATH_TO_CKPT/sd-v1-4.ckpt" \ ln -s "$PATH_TO_CKPT/sd-v1-4.ckpt" \
models/ldm/stable-diffusion-v1/model.ckpt models/ldm/stable-diffusion-v1/model.ckpt
# install packages for arm64 ```
PIP_EXISTS_ACTION=w CONDA_SUBDIR=osx-arm64 \
conda env create \
-f environment-mac.yaml
conda activate ldm
# OR install packages for x86_64 1. or wherever you saved sd-v1-4.ckpt
PIP_EXISTS_ACTION=w CONDA_SUBDIR=osx-x86_64 \
conda env create \
-f environment-mac.yaml
conda activate ldm
!!! quote "Please install the propper package for your Architecture:"
=== "M1 arm64"
```bash
PIP_EXISTS_ACTION=w CONDA_SUBDIR=osx-arm64 \
conda env create \
-f environment-mac.yaml \
&& conda activate ldm
```
=== "Intel x86_64"
```bash
PIP_EXISTS_ACTION=w CONDA_SUBDIR=osx-x86_64 \
conda env create \
-f environment-mac.yaml \
&& conda activate ldm
```
```{.bash .annotate}
# only need to do this once # only need to do this once
python scripts/preload_models.py python scripts/preload_models.py
# run SD! # now you can run SD in CLI mode
python scripts/dream.py --full_precision # (3) python scripts/dream.py --full_precision # (1)
# or run the web interface! # or run the web interface!
python scripts/dream.py --web python scripts/dream.py --web
```
1. you might have this from before, no problem # The original scripts should work as well.
2. or wherever you saved sd-v1-4.ckpt
3. half-precision requires autocast and won't work
The original scripts should work as well.
```bash
python scripts/orig_scripts/txt2img.py \ python scripts/orig_scripts/txt2img.py \
--prompt "a photograph of an astronaut riding a horse" \ --prompt "a photograph of an astronaut riding a horse" \
--plms --plms
``` ```
1. half-precision requires autocast which is unfortunatelly incompatible
---
Note: Note:
```bash ```bash