## add mkdocs-material

I already begun with formating /  revising the sites
This commit is contained in:
mauwii 2022-09-14 00:57:37 +02:00
parent 89da371f48
commit 1bd22523b1
No known key found for this signature in database
GPG Key ID: D923DB04ADB3F5AB
14 changed files with 341 additions and 77 deletions

6
.prettierrc.yaml Normal file
View File

@ -0,0 +1,6 @@
endOfLine: lf
tabWidth: 2
useTabs: false
singleQuote: true
quoteProps: as-needed
embeddedLanguageFormatting: auto

View File

@ -1,7 +1,7 @@
<h1 align='center'><b>Stable Diffusion Dream Script</b></h1>
<p align='center'>
<img src="docs/assets/logo.png"/>
<img src="assets/logo.png"/>
</p>
<p align="center">
@ -39,9 +39,11 @@ templates. They will help aid diagnose issues faster._
This fork is supported across multiple platforms. You can find individual installation instructions below.
- ## [Linux](docs/installation/INSTALL_LINUX.md)
- ## [Windows](docs/installation/INSTALL_WINDOWS.md)
- ## [Macintosh](docs/installation/INSTALL_MAC.md)
- ## [Linux](installation\INSTALL_LINUX.md)
- ## [Windows](installation\INSTALL_WINDOWS.md)
- ## [Macintosh](installation\INSTALL_MAC.md)
## **Hardware Requirements**
@ -157,7 +159,7 @@ For support,
please use this repository's GitHub Issues tracking service. Feel free
to send me an email if you use and like the script.
Original portions of the software are Copyright (c) 2020 Lincoln D. Stein (https://github.com/lstein)
Original portions of the software are Copyright (c) 2020 Lincoln D. Stein (<https://github.com/lstein>)
# Further Reading

13
docs/.markdownlint.json Normal file
View File

@ -0,0 +1,13 @@
{
"default": true,
"MD013": false,
"MD007": false,
"MD033": {
"allowed_elements": [
"br",
"figure",
"figcaption"
]
},
"MD046": false
}

View File

@ -1,4 +1,6 @@
# **Changelog**
---
title: **Changelog**
---
## v1.13 (in process)
@ -10,8 +12,6 @@
- Can specify --grid on dream.py command line as the default.
- Miscellaneous internal bug and stability fixes.
---
## v1.12 (28 August 2022)
- Improved file handling, including ability to read prompts from standard input.
@ -24,8 +24,6 @@
[Oceanswave](https://github.com/oceanswave) for their work on this.
- You can now swap samplers on the dream> command line. [Blessedcoolant](https://github.com/blessedcoolant)
---
## v1.11 (26 August 2022)
- NEW FEATURE: Support upscaling and face enhancement using the GFPGAN module. (kudos to [Oceanswave](https://github.com/Oceanswave)
@ -37,8 +35,6 @@
for a synopsis of how this works. Note that when this feature is eventually added to the main branch, it will may be modified
significantly.
---
## v1.10 (25 August 2022)
- A barebones but fully functional interactive web server for online generation of txt2img and img2img.
@ -97,23 +93,17 @@
- You can use the "cd" and "pwd" commands at the dream> prompt to set and retrieve
the path of the output directory.
---
## v1.04 (22 August 2022 - after the drop)
- Updated README to reflect installation of the released weights.
- Suppressed very noisy and inconsequential warning when loading the frozen CLIP
tokenizer.
---
## v1.03 (22 August 2022)
- The original txt2img and img2img scripts from the CompViz repository have been moved into
a subfolder named "orig_scripts", to reduce confusion.
---
## v1.02 (21 August 2022)
- A copy of the prompt and all of its switches and options is now stored in the corresponding
@ -121,17 +111,9 @@
or an image editor that allows you to explore the full metadata.
**Please run "conda env update -f environment.yaml" to load the k_lms dependencies!!**
---
## v1.01 (21 August 2022)
- added k_lms sampling.
**Please run "conda env update -f environment.yaml" to load the k_lms dependencies!!**
- use half precision arithmetic by default, resulting in faster execution and lower memory requirements
Pass argument --full_precision to dream.py to get slower but more accurate image generation
---
## Links
- **[Read Me](../readme.md)**

View File

@ -1,4 +1,8 @@
# **Interactive Command-Line Interface**
---
title: "CLI"
---
**Interactive Command Line Interface**
The `dream.py` script, located in `scripts/dream.py`, provides an interactive interface to image generation similar to the "dream mothership" bot that Stable AI provided on its Discord server.
@ -13,7 +17,7 @@ The script is confirmed to work on Linux, Windows and Mac systems.
_Note:_ This script runs from the command-line or can be used as a Web application. The Web GUI is currently rudimentary, but a much better replacement is on its way.
```
```bash
(ldm) ~/stable-diffusion$ python3 ./scripts/dream.py
* Initializing, be patient...
Loading model from models/ldm/text2img-large/model.ckpt
@ -54,7 +58,7 @@ The script itself also recognizes a series of command-line switches
that will change important global defaults, such as the directory for
image outputs and the location of the model weight files.
## List of arguments recognized at the command line:
## List of arguments recognized at the command line
These command-line arguments can be passed to dream.py when you first
run it from the Windows, Mac or Linux command line. Some set defaults
@ -103,7 +107,7 @@ from text (txt2img), to embellish an existing image or sketch
(img2img), or to selectively alter chosen regions of the image
(inpainting).
### This is an example of txt2img:
### This is an example of txt2img
~~~~
dream> waterfall and rainbow -W640 -H480
@ -140,8 +144,7 @@ Note that the width and height of the image must be multiples of
64. You can provide different values, but they will be rounded down to
the nearest multiple of 64.
### This is an example of img2img:
### This is an example of img2img
~~~~
dream> waterfall and rainbow -I./vacation-photo.png -W640 -H480 --fit
@ -162,7 +165,7 @@ accepts additional options:
| --fit | -F | False | Scale the image to fit into the specified -H and -W dimensions |
| --strength <float> | -s<float> | 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.|
### This is an example of inpainting:
### This is an example of inpainting
~~~~
dream> waterfall and rainbow -I./vacation-photo.png -M./vacation-mask.png -W640 -H480 --fit
@ -182,7 +185,6 @@ well as the --mask (-M) argument:
|--------------------|------------|---------------------|--------------|
| --init_mask <path> | -M<path> | None |Path to an image the same size as the initial_image, with areas for inpainting made transparent.|
# Command-line editing and completion
If you are on a Macintosh or Linux machine, the command-line offers
@ -225,4 +227,3 @@ dream> zebra with a mustache -I./test-pictures<TAB>
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.

View File

@ -1,5 +1,6 @@
# **Image-to-Image**
---
title: **Image-to-Image**
---
This script also provides an img2img feature that lets you seed your
creations with an initial drawing or photo. This is a really cool
feature that tells stable diffusion to build the prompt on top of the

View File

@ -1,3 +1,7 @@
---
title: other
---
## **Google Colab**
Stable Diffusion AI Notebook: <a
@ -19,7 +23,7 @@ with itself. To use it, add the `--seamless` option when starting the
script which will result in all generated images to tile, or for each
`dream>` prompt as shown here:
```
```python
dream> "pond garden with lotus by claude monet" --seamless -s100 -n4
```
@ -40,13 +44,13 @@ innovative packaging for a squid's dinner -S137038382
Then pass this file's name to `dream.py` when you invoke it:
```
```bash
(ldm) ~/stable-diffusion$ python3 scripts/dream.py --from_file "path/to/prompts.txt"
```
You may read a series of prompts from standard input by providing a filename of `-`:
```
```bash
(ldm) ~/stable-diffusion$ echo "a beautiful day" | python3 scripts/dream.py --from_file -
```

View File

@ -1,25 +1,36 @@
# **Personalizing Text-to-Image Generation**
---
title: TEXTUAL_INVERSION
---
You may personalize the generated images to provide your own styles or objects by training a new LDM checkpoint and introducing a new vocabulary to the fixed model as a (.pt) embeddings file. Alternatively, you may use or train HuggingFace Concepts embeddings files (.bin) from https://huggingface.co/sd-concepts-library and its associated notebooks.
## **Personalizing Text-to-Image Generation**
**Training**
You may personalize the generated images to provide your own styles or objects
by training a new LDM checkpoint and introducing a new vocabulary to the fixed
model as a (.pt) embeddings file. Alternatively, you may use or train HuggingFace
Concepts embeddings files (.bin) from <https://huggingface.co/sd-concepts-library>
and its associated notebooks.
## **Training**
To train, prepare a folder that contains images sized at 512x512 and execute the following:
**WINDOWS**: As the default backend is not available on Windows, if you're using that platform, set the environment variable `PL_TORCH_DISTRIBUTED_BACKEND=gloo`
### WINDOWS:
```
(ldm) ~/stable-diffusion$ python3 ./main.py --base ./configs/stable-diffusion/v1-finetune.yaml \
-t \
--actual_resume ./models/ldm/stable-diffusion-v1/model.ckpt \
-n my_cat \
--gpus 0, \
--data_root D:/textual-inversion/my_cat \
--init_word 'cat'
As the default backend is not available on Windows, if you're using that platform,
set the environment variable `PL_TORCH_DISTRIBUTED_BACKEND` to `gloo`
```bash
python3 ./main.py --base ./configs/stable-diffusion/v1-finetune.yaml \
--actual_resume ./models/ldm/stable-diffusion-v1/model.ckpt \
-t \
-n my_cat \
--gpus 0 \
--data_root D:/textual-inversion/my_cat \
--init_word 'cat'
```
During the training process, files will be created in
/logs/[project][time][project]/ where you can see the process.
`/logs/[project][time][project]/` where you can see the process.
Conditioning contains the training prompts inputs, reconstruction the
input images for the training epoch samples, samples scaled for a
@ -27,9 +38,11 @@ sample of the prompt and one with the init word provided.
On a RTX3090, the process for SD will take ~1h @1.6 iterations/sec.
_Note_: According to the associated paper, the optimal number of
images is 3-5. Your model may not converge if you use more images than
that.
!!! Info _Note_
According to the associated paper, the optimal number of
images is 3-5. Your model may not converge if you use more images than
that.
Training will run indefinitely, but you may wish to stop it (with
ctrl-c) before the heat death of the universe, when you find a low
@ -38,33 +51,40 @@ limit on the number of training steps by decreasing the "max_steps"
option in configs/stable_diffusion/v1-finetune.yaml (currently set to
4000000)
**Running**
## **Running**
Once the model is trained, specify the trained .pt or .bin file when
starting dream using
```
(ldm) ~/stable-diffusion$ python3 ./scripts/dream.py --embedding_path /path/to/embedding.pt --full_precision
```bash
python3 ./scripts/dream.py \
--embedding_path /path/to/embedding.pt \
--full_precision
```
Then, to utilize your subject at the dream prompt
```
```bash
dream> "a photo of *"
```
This also works with image2image
```
```bash
dream> "waterfall and rainbow in the style of *" --init_img=./init-images/crude_drawing.png --strength=0.5 -s100 -n4
```
For .pt files it's also possible to train multiple tokens (modify the placeholder string in `configs/stable-diffusion/v1-finetune.yaml`) and combine LDM checkpoints using:
For .pt files it's also possible to train multiple tokens (modify the
placeholder string in `configs/stable-diffusion/v1-finetune.yaml`) and
combine LDM checkpoints using:
```
(ldm) ~/stable-diffusion$ python3 ./scripts/merge_embeddings.py \
--manager_ckpts /path/to/first/embedding.pt /path/to/second/embedding.pt [...] \
--output_path /path/to/output/embedding.pt
```bash
python3 ./scripts/merge_embeddings.py \
--manager_ckpts /path/to/first/embedding.pt \
[</path/to/second/embedding.pt> [...]] \
--output_path /path/to/output/embedding.pt
```
Credit goes to rinongal and the repository located at https://github.com/rinongal/textual_inversion Please see the repository and associated paper for details and limitations.
Credit goes to rinongal and the repository
Please see [the repository](https://github.com/rinongal/textual_inversion) and associated paper for details and limitations.

View File

@ -1,4 +1,8 @@
# **Frequently Asked Questions**
---
title: F.A.Q.
---
## **Frequently Asked Questions**
Here are a few common installation problems and their solutions. Often these are caused by incomplete installations or crashes during the
install process.

163
docs/index.md Normal file
View File

@ -0,0 +1,163 @@
---
title: Home
---
<h1 align='center'><b>Stable Diffusion Dream Script</b></h1>
![logo](./assets/logo.png){align='center'}
<p align="center">
<img src="https://img.shields.io/github/last-commit/lstein/stable-diffusion?logo=Python&logoColor=green&style=for-the-badge" alt="last-commit"/>
<img src="https://img.shields.io/github/stars/lstein/stable-diffusion?logo=GitHub&style=for-the-badge" alt="stars"/>
<br>
<img src="https://img.shields.io/github/issues/lstein/stable-diffusion?logo=GitHub&style=for-the-badge" alt="issues"/>
<img src="https://img.shields.io/github/issues-pr/lstein/stable-diffusion?logo=GitHub&style=for-the-badge" alt="pull-requests"/>
</p>
---
This is a fork of
[CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion),
the open source text-to-image generator. It provides a streamlined
process with various new features and options to aid the image
generation process. It runs on Windows, Mac and Linux machines,
and runs on GPU cards with as little as 4 GB or RAM.
_Note: This fork is rapidly evolving. Please use the
[Issues](https://github.com/lstein/stable-diffusion/issues) tab to
report bugs and make feature requests. Be sure to use the provided
templates. They will help aid diagnose issues faster._
## **Table of Contents**
- [**Table of Contents**](#table-of-contents)
- [Installation](#installation)
- [**Hardware Requirements**](#hardware-requirements)
- [**System**](#system)
- [**Memory**](#memory)
- [**Disk**](#disk)
- [**Note**](#note)
- [Features](#features)
- [**Major Features**](#major-features)
- [**Other Features**](#other-features)
- [Latest Changes](#latest-changes)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [**Contributors**](#contributors)
- [Support](#support)
- [Further Reading](#further-reading)
## Installation
This fork is supported across multiple platforms. You can find individual installation instructions below.
- [Linux](./installation/INSTALL_LINUX.md)
- [Windows](./installation/INSTALL_WINDOWS.md)
- [Macintosh](./installation/INSTALL_MAC.md)
## **Hardware Requirements**
### **System**
You wil need one of the following:
- An NVIDIA-based graphics card with 4 GB or more VRAM memory.
- An Apple computer with an M1 chip.
### **Memory**
- At least 12 GB Main Memory RAM.
### **Disk**
- At least 6 GB of free disk space for the machine learning model, Python, and all its dependencies.
### **Note**
If you are have a Nvidia 10xx series card (e.g. the 1080ti), please
run the dream script in full-precision mode as shown below.
Similarly, specify full-precision mode on Apple M1 hardware.
To run in full-precision mode, start `dream.py` with the
`--full_precision` flag:
```bash
(ldm) ~/stable-diffusion$ python scripts/dream.py --full_precision
```
## 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)
## Latest Changes
- v1.14 (11 September 2022)
- Memory optimizations for small-RAM cards. 512x512 now possible on 4 GB GPUs.
- Full support for Apple hardware with M1 or M2 chips.
- Add "seamless mode" for circular tiling of image. Generates beautiful effects. ([prixt](https://github.com/prixt)).
- Inpainting support.
- Improved web server GUI.
- Lots of code and documentation cleanups.
- v1.13 (3 September 2022
- Support image variations (see [VARIATIONS](./features/VARIATIONS.md) ([Kevin Gibbons](https://github.com/bakkot) and many contributors and reviewers)
- Supports a Google Colab notebook for a standalone server running on Google hardware [Arturo Mendivil](https://github.com/artmen1516)
- WebUI supports GFPGAN/ESRGAN facial reconstruction and upscaling [Kevin Gibbons](https://github.com/bakkot)
- WebUI supports incremental display of in-progress images during generation [Kevin Gibbons](https://github.com/bakkot)
- A new configuration file scheme that allows new models (including upcoming stable-diffusion-v1.5)
to be added without altering the code. ([David Wager](https://github.com/maddavid12))
- Can specify --grid on dream.py command line as the default.
- Miscellaneous internal bug and stability fixes.
- Works on M1 Apple hardware.
- Multiple bug fixes.
For older changelogs, please visit **[CHANGELOGS](./CHANGELOG.md)**.
## Troubleshooting
Please check out our **[Q&A](./help/TROUBLESHOOT.md)** to get solutions for common installation problems and other issues.
## Contributing
Anyone who wishes to contribute to this project, whether documentation, features, bug fixes, code cleanup, testing, or code reviews, is very much encouraged to do so. If you are unfamiliar with
how to contribute to GitHub projects, here is a [Getting Started Guide](https://opensource.com/article/19/7/create-pull-request-github).
A full set of contribution guidelines, along with templates, are in progress, but for now the most important thing is to **make your pull request against the "development" branch**, and not against "main". This will help keep public breakage to a minimum and will allow you to propose more radical changes.
### **Contributors**
This fork is a combined effort of various people from across the world. [Check out the list of all these amazing people](./CONTRIBUTORS.md). We thank them for their time, hard work and effort.
## Support
For support,
please use this repository's GitHub Issues tracking service. Feel free
to send me an email if you use and like the script.
Original portions of the software are Copyright (c) 2020 Lincoln D. Stein (https://github.com/lstein)
## Further Reading
Please see the original README for more information on this software
and underlying algorithm, located in the file [README-CompViz.md](./README-CompViz.md).

View File

@ -1,14 +1,16 @@
# Contributors
---
title: **Contributors**
---
The list of all the amazing people who have contributed to the various features that you get to experience in this fork.
We thank them for all of their time and hard work.
_Original Author:_
## __Original Author:__
- Lincoln D. Stein <lincoln.stein@gmail.com>
- [Lincoln D. Stein](mailto:lincoln.stein@gmail.com)
_Contributions by:_
## __Contributions by:__
- [Sean McLellan](https://github.com/Oceanswave)
- [Kevin Gibbons](https://github.com/bakkot)
@ -46,7 +48,7 @@ _Contributions by:_
- [Samuel Husso](https://github.com/shusso)
- [nicolai256](https://github.com/nicolai256)
_Original CompVis Authors:_
## __Original CompVis Authors:__
- [Robin Rombach](https://github.com/rromb)
- [Patrick von Platen](https://github.com/patrickvonplaten)

View File

@ -1,4 +1,8 @@
# Original README from CompViz/stable-diffusion
---
title: CompViz-Readme
---
# *README from [CompViz/stable-diffusion](https://github.com/CompVis/stable-diffusion)*
_Stable Diffusion was made possible thanks to a collaboration with [Stability AI](https://stability.ai/) and [Runway](https://runwayml.com/) and builds upon our previous work:_
@ -9,7 +13,7 @@ _Stable Diffusion was made possible thanks to a collaboration with [Stability AI
[Patrick Esser](https://github.com/pesser),
[Björn Ommer](https://hci.iwr.uni-heidelberg.de/Staff/bommer)<br/>
**CVPR '22 Oral**
## **CVPR '22 Oral**
which is available on [GitHub](https://github.com/CompVis/latent-diffusion). PDF at [arXiv](https://arxiv.org/abs/2112.10752). Please also visit our [Project page](https://ommer-lab.com/research/latent-diffusion-models/).
@ -27,14 +31,14 @@ See [this section](#stable-diffusion-v1) below and the [model card](https://hugg
A suitable [conda](https://conda.io/) environment named `ldm` can be created
and activated with:
```
```bash
conda env create -f environment.yaml
conda activate ldm
```
You can also update an existing [latent diffusion](https://github.com/CompVis/latent-diffusion) environment by running
```
```bash
conda install pytorch torchvision -c pytorch
pip install transformers==4.19.2
pip install -e .

1
docs/requirements.txt Normal file
View File

@ -0,0 +1 @@
mkdocs-material

61
mkdocs.yml Normal file
View File

@ -0,0 +1,61 @@
site_name: Dream Script Docs
# Repository
repo_name: mauwii/stable-diffusion
repo_url: https://github.com/mauwii/stable-diffusion
edit_uri: edit/main/docs/
# Copyright
copyright: Copyright &copy; 2022 Lincoln D. Stein <lincoln.stein@gmail.com>
# Configuration
theme:
name: material
# Extensions
markdown_extensions:
- abbr
- admonition
- attr_list
- def_list
- footnotes
- meta
- md_in_html
- toc:
permalink: true
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.magiclink:
repo_url_shorthand: true
user: 'Mauwii'
repo: 'stable-diffusion'
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.snippets
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- tables
# Plugins
# plugins:
# - search
# - git-revision-date
# - mike