From ead0e92bacc98ef2e77e9670491ad183cf053d51 Mon Sep 17 00:00:00 2001 From: mauwii Date: Mon, 19 Sep 2022 08:36:42 +0200 Subject: [PATCH] remove feature list from index.md since in menu fix double bs python path in cli.md and fix tables again add more keys in cli.md fix annotations in install_mac.md remove torchaudio from pythorch-nightly installation fix self reference --- docs/features/CLI.md | 74 ++++++++++++++++---------------- docs/index.md | 28 ++---------- docs/installation/INSTALL_MAC.md | 18 ++++---- 3 files changed, 48 insertions(+), 72 deletions(-) diff --git a/docs/features/CLI.md b/docs/features/CLI.md index 7c3dae4a5a..3287c07827 100644 --- a/docs/features/CLI.md +++ b/docs/features/CLI.md @@ -71,26 +71,26 @@ These command-line arguments can be passed to `dream.py` when you first run it f or Linux command line. Some set defaults that can be overridden on a per-prompt basis (see [List of prompt arguments] (#list-of-prompt-arguments). Others -| Argument | Shortcut | Default | Description | -| ------------------------- | ------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------- | -| `--help` | `-h` | | Print a concise help message. | -| `--outdir ` | `-o` | `outputs/img_samples` | Location for generated images. | -| `--prompt_as_dir` | `-p` | `False` | Name output directories using the prompt text. | -| `--from_file ` | | `None` | Read list of prompts from a file. Use "-" to read from
standard input | -| `--model ` | | `stable-diffusion-1.4` | Loads model specified in configs/models.yaml. Currently
one of "stable-diffusion-1.4" or "laion400m" | -| `--full_precision` | `-F` | `False` | Run in slower full-precision mode. Needed for Macintosh
M1/M2 hardware and some older video cards. | -| `--web` | | `False` | Start in web server mode | -| `--host ` | | `localhost` | Which network interface web server should listen on.
Set to 0.0.0.0 to listen on any. | -| `--port ` | | `9090` | Which port web server should listen for requests on. | -| `--config ` | | `configs/models.yaml` | Configuration file for models and their weights. | -| `--iterations ` | `-n` | `1` | How many images to generate per prompt. | -| `--grid` | `-g` | `False` | Save all image series as a grid rather than individually. | -| `--sampler ` | `-A` | `k_lms` | Sampler to use. Use -h to get list of available samplers. | -| `--seamless` | | `False` | Create interesting effects by tiling elements of the image. | -| `--embedding_path ` | | `None` | Path to pre-trained embedding manager checkpoints,
for custom models | -| `--gfpgan_dir` | | `src/gfpgan` | Path to where GFPGAN is installed. | -| `--gfpgan_model_path` | | see bellow\* | Path to GFPGAN model file, relative to `--gfpgan_dir`. | -| `--device ` | `-d` | `torch.cuda.current_device()` | Device to run SD on, e.g. "cuda:0" | +Argument | Shortcut | Default | Description | +------------------------- | ------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------- | +`--help` | `-h` | | Print a concise help message. | +`--outdir ` | `-o` | `outputs/img_samples` | Location for generated images. | +`--prompt_as_dir` | `-p` | `False` | Name output directories using the prompt text. | +`--from_file ` | | `None` | Read list of prompts from a file. Use `-` to read from
standard input | +`--model ` | | `stable-diffusion-1.4` | Loads model specified in configs/models.yaml. Currently
one of "stable-diffusion-1.4" or "laion400m" | +`--full_precision` | `-F` | `False` | Run in slower full-precision mode. Needed for Macintosh
M1/M2 hardware and some older video cards. | +`--web` | | `False` | Start in web server mode | +`--host ` | | `localhost` | Which network interface web server should listen on.
Set to 0.0.0.0 to listen on any. | +`--port ` | | `9090` | Which port web server should listen for requests on. | +`--config ` | | `configs/models.yaml` | Configuration file for models and their weights. | +`--iterations ` | `-n` | `1` | How many images to generate per prompt. | +`--grid` | `-g` | `False` | Save all image series as a grid rather than individually. | +`--sampler ` | `-A` | `k_lms` | Sampler to use. Use -h to get list of available samplers. | +`--seamless` | | `False` | Create interesting effects by tiling elements of the image. | +`--embedding_path ` | | `None` | Path to pre-trained embedding manager checkpoints,
for custom models | +`--gfpgan_dir` | | `src/gfpgan` | Path to where GFPGAN is installed. | +`--gfpgan_model_path` | | see bellow\* | Path to GFPGAN model file, relative to `--gfpgan_dir`. | +`--device ` | `-d` | `torch.cuda.current_device()` | Device to run SD on, e.g. "cuda:0" | \*`experiments/pretrained_models/GFPGANv1.3.pth` @@ -107,7 +107,7 @@ These arguments are deprecated but still work: On Windows systems, you may run into problems when passing the dream script standard backslashed path names because the Python interpreter treats `\` as an escape. You can either double your - slashes (ick): `C:\\\\path\\\\to\\\\my\\\\file`, or use Linux/Mac style forward slashes (better): + slashes (ick): `C:\\path\\to\\my\\file`, or use Linux/Mac style forward slashes (better): `C:/path/to/my/file`. ### List of prompt arguments @@ -137,9 +137,9 @@ Those are the `dream` commands that apply to txt2img: | `--steps ` | `-s` | `50` | How many steps of refinement to apply | | `--cfg_scale ` | `-C` | `7.5` | How hard to try to match the prompt to the generated
image; any number greater than 0.0
works, but the useful range is roughly 5.0 to 20.0 | | `--seed ` | `-S` | `None` | Set the random seed for the next series of images.
This can be used to recreate an image generated previously. | -| `--sampler ` | `-A` | `k_lms` | Sampler to use. Use `-h` to get list of available samplers. | +| `--sampler ` | `-A` | `k_lms` | Sampler to use. Use `-h` to get list of available samplers. | | `--grid` | `-g` | `False` | Turn on grid mode to return a single image combining
all the images generated by this prompt | -| `--individual` | `-i` | `True` | Turn off grid mode (deprecated; leave off `--grid` instead) | +| `--individual` | `-i` | `True` | Turn off grid mode (deprecated; leave off `--grid` instead) | | `--outdir ` | `-o` | `outputs/img_samples` | Temporarily change the location of these images | | `--seamless` | | `False` | Activate seamless tiling for interesting effects | | `--log_tokenization` | `-t` | `False` | Display a color-coded list of the parsed tokens
derived from the prompt | @@ -175,14 +175,14 @@ chain as the the reference image for each step in the chain. In addition to the command-line options recognized by txt2img, img2img accepts additional options: -| Argument | Shortcut | Default | Description | -| --------------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `--init_img ` | `-I` | `None` | Path to the initialization image | -| `--init_color ` | | `None` | Path to reference image for color correction | -| `--fit` | `-F` | `False` | Scale the image to fit into the specified -H and -W dimensions | -| `--strength ` | `-f` | `0.75` | How hard to try to match the prompt to the initial image. Ranges from 0.0-0.99, with higher values replacing the initial image completely. | +| Argument | Shortcut | Default | Description | +| --------------------- | ---------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `--init_img ` | `-I` | `None` | Path to the initialization image | +| `--init_color ` | | `None` | Path to reference image for color correction | +| `--fit` | `-F` | `False` | Scale the image to fit into the specified -H and -W dimensions | +| `--strength ` | `-f` | `0.75` | How hard to try to match the prompt to the initial image. Ranges from 0.0-0.99,
with higher values replacing the initial image completely. | -#### inpainting +#### Inpainting !!! example @@ -195,11 +195,11 @@ In addition to the command-line options recognized by txt2img, img2img accepts a the areas to overpaint made transparent, but you must be careful not to destroy the pixels underneath when you create the transparent areas. See [Inpainting](./INPAINTING.md) for details. -inpainting accepts all the arguments used for txt2img and img2img, as well as the `--mask` (`-M`) +Inpainting accepts all the arguments used for txt2img and img2img, as well as the `--mask` (`-M`) argument: -| Argument | Shortcut | Default | Description | -| -------------------- | ---------- | ------- | ------------------------------------------------------------------------------------------------ | +| Argument | Shortcut | Default | Description | +| -------------------- | ---------- | ------- | --------------------------------------------------------------------------------------------------- | | `--init_mask ` | `-M` | `None` | Path to an image the same size as the initial_image, with areas for
inpainting made transparent. | ## Command-line editing and completion @@ -226,15 +226,15 @@ winpty python scripts\dream.py On the Mac and Linux platforms, when you exit `dream.py`, the last 1000 lines of your command-line history will be saved. When you restart `dream.py`, you can access the saved history using the -up-arrow key. +++up++ key. In addition, limited command-line completion is installed. In various contexts, you can start typing your command and press tab. A list of potential completions will be presented to you. You can then type a little more, hit tab again, and eventually autocomplete what you want. When specifying file paths using the one-letter shortcuts, the CLI will attempt to complete -pathnames for you. This is most handy for the -I (init image) and -M (init mask) paths. To initiate -completion, start the path with a slash ("/") or "./". For example: +pathnames for you. This is most handy for the `-I` (init image) and `-M` (init mask) paths. To initiate +completion, start the path with a slash `/` or `./`, for example: ```bash dream> "zebra with a mustache" -I./test-pictures @@ -242,6 +242,6 @@ dream> "zebra with a mustache" -I./test-pictures -I./test-pictures/bad-sketch.png -I./test-pictures/man_with_eagle/ ``` -You can then type "z", hit ++tab++ again, and it will autofill to "zebra.jpg". +You can then type ++z++, hit ++tab++ again, and it will autofill to `zebra.jpg`. More text completion features (such as autocompleting seeds) are on their way. diff --git a/docs/index.md b/docs/index.md index c4a524d00b..cb9c358617 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,6 @@ --- title: Home +template: main.html --- -
+
# :material-script-text-outline: Stable Diffusion Dream Script @@ -42,6 +43,7 @@ title: Home [latest commit to dev link]: https://github.com/lstein/stable-diffusion/commits/development [latest release badge]: https://flat.badgen.net/github/release/lstein/stable-diffusion/development?icon=github [latest release link]: https://github.com/lstein/stable-diffusion/releases +
This is a fork of [CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion), the open @@ -93,30 +95,6 @@ You wil need one of the following: ```bash (ldm) ~/stable-diffusion$ python scripts/dream.py --full_precision ``` - -## :octicons-list-unordered-24: Features - -### Major Features - -- [Interactive Command Line Interface](features/CLI.md) -- [Image To Image](features/IMG2IMG.md) -- [Inpainting Support](features/INPAINTING.md) -- [GFPGAN and Real-ESRGAN Support](features/UPSCALE.md) -- [Seamless Tiling](features/OTHER.md#seamless-tiling) -- [Google Colab](features/OTHER.md#google-colab) -- [Web Server](features/WEB.md) -- [Reading Prompts From File](features/OTHER.md#reading-prompts-from-a-file) -- [Shortcut: Reusing Seeds](features/OTHER.md#shortcuts-reusing-seeds) -- [Weighted Prompts](features/OTHER.md#weighted-prompts) -- [Variations](features/VARIATIONS.md) -- [Personalizing Text-to-Image Generation](features/TEXTUAL_INVERSION.md) -- [Simplified API for text to image generation](features/OTHER.md#simplified-api) - -### Other Features - -- [Creating Transparent Regions for Inpainting](features/INPAINTING.md#creating-transparent-regions-for-inpainting) -- [Preload Models](features/OTHER.md#preload-models) - ## :octicons-log-16: Latest Changes ### v1.14 (11 September 2022) diff --git a/docs/installation/INSTALL_MAC.md b/docs/installation/INSTALL_MAC.md index d45a1140af..a305b8912b 100644 --- a/docs/installation/INSTALL_MAC.md +++ b/docs/installation/INSTALL_MAC.md @@ -83,14 +83,14 @@ While that is downloading, open a Terminal and run the following commands: === "with pyenv" ```{.bash .annotate} - brew install rust pyenv-virtualenv # (1) + brew install rust pyenv-virtualenv # (1)! pyenv install anaconda3-2022.05 pyenv virtualenv anaconda3-2022.05 eval "$(pyenv init -)" pyenv activate anaconda3-2022.05 ``` - 1. you might already have this installed, no problem + 1. You might already have this installed, if that is the case just continue. ```{.bash .annotate title="local repo setup"} # clone the repo @@ -102,7 +102,7 @@ cd stable-diffusion # create symlink to checkpoint mkdir -p models/ldm/stable-diffusion-v1/ -PATH_TO_CKPT="$HOME/Downloads" # (1) +PATH_TO_CKPT="$HOME/Downloads" # (1)! ln -s "$PATH_TO_CKPT/sd-v1-4.ckpt" \ models/ldm/stable-diffusion-v1/model.ckpt @@ -136,7 +136,7 @@ ln -s "$PATH_TO_CKPT/sd-v1-4.ckpt" \ python scripts/preload_models.py # now you can run SD in CLI mode -python scripts/dream.py --full_precision # (1) +python scripts/dream.py --full_precision # (1)! # or run the web interface! python scripts/dream.py --web @@ -169,9 +169,7 @@ get several errors. Here's the errors I've seen and found solutions for. ### Is it slow? -Be sure to specify 1 sample and 1 iteration. - -```bash +```bash title="Be sure to specify 1 sample and 1 iteration." python ./scripts/orig_scripts/txt2img.py \ --prompt "ocean" \ --ddim_steps 5 \ @@ -197,8 +195,8 @@ One debugging step is to update to the latest version of PyTorch nightly. conda install \ pytorch \ torchvision \ - torchaudio \ - -c pytorch-nightly + -c pytorch-nightly \ + -n ldm ``` If it takes forever to run @@ -397,7 +395,7 @@ python scripts/preload_models.py WARNING: this will be slower than running natively on MPS. ``` -The lstein branch includes this fix in +This fork already includes a fix for this in [environment-mac.yaml](https://github.com/lstein/stable-diffusion/blob/main/environment-mac.yaml). ---