aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/run_tests.yaml31
-rw-r--r--.gitignore1
-rw-r--r--CODEOWNERS23
-rw-r--r--README.md30
-rw-r--r--javascript/edit-attention.js3
-rw-r--r--javascript/generationParams.js33
-rw-r--r--javascript/hints.js6
-rw-r--r--javascript/progressbar.js2
-rw-r--r--javascript/ui.js6
-rw-r--r--launch.py121
-rw-r--r--localizations/ar_AR.json518
-rw-r--r--localizations/de_DE.json458
-rw-r--r--localizations/es_ES.json692
-rw-r--r--localizations/fr_FR.json415
-rw-r--r--localizations/it_IT.json1233
-rw-r--r--localizations/ja_JP.json482
-rw-r--r--localizations/ko_KR.json581
-rw-r--r--localizations/pt_BR.json485
-rw-r--r--localizations/ru_RU.json475
-rw-r--r--localizations/tr_TR.json423
-rw-r--r--localizations/zh_CN.json624
-rw-r--r--localizations/zh_TW.json598
-rw-r--r--modules/api/api.py200
-rw-r--r--modules/api/models.py86
-rw-r--r--modules/call_queue.py98
-rw-r--r--modules/codeformer_model.py3
-rw-r--r--modules/deepbooru.py258
-rw-r--r--modules/deepbooru_model.py676
-rw-r--r--modules/devices.py88
-rw-r--r--modules/esrgan_model.py2
-rw-r--r--modules/extensions.py16
-rw-r--r--modules/extras.py57
-rw-r--r--modules/generation_parameters_copypaste.py13
-rw-r--r--modules/gfpgan_model.py4
-rw-r--r--modules/hypernetworks/hypernetwork.py346
-rw-r--r--modules/hypernetworks/ui.py2
-rw-r--r--modules/images.py43
-rw-r--r--modules/img2img.py34
-rw-r--r--modules/interrogate.py3
-rw-r--r--modules/ldsr_model_arch.py14
-rw-r--r--modules/localization.py6
-rw-r--r--modules/lowvram.py8
-rw-r--r--modules/modelloader.py1
-rw-r--r--modules/ngrok.py13
-rw-r--r--modules/paths.py2
-rw-r--r--modules/processing.py132
-rw-r--r--modules/safe.py58
-rw-r--r--modules/script_callbacks.py127
-rw-r--r--modules/script_loading.py34
-rw-r--r--modules/scripts.py136
-rw-r--r--modules/scunet_model.py2
-rw-r--r--modules/sd_hijack.py322
-rw-r--r--modules/sd_hijack_checkpoint.py10
-rw-r--r--modules/sd_hijack_clip.py301
-rw-r--r--modules/sd_hijack_inpainting.py19
-rw-r--r--modules/sd_hijack_open_clip.py37
-rw-r--r--modules/sd_models.py63
-rw-r--r--modules/sd_samplers.py93
-rw-r--r--modules/sd_vae.py36
-rw-r--r--modules/shared.py111
-rw-r--r--modules/styles.py11
-rw-r--r--modules/swinir_model.py8
-rw-r--r--modules/textual_inversion/autocrop.py6
-rw-r--r--modules/textual_inversion/dataset.py141
-rw-r--r--modules/textual_inversion/preprocess.py172
-rw-r--r--modules/textual_inversion/textual_inversion.py334
-rw-r--r--modules/textual_inversion/ui.py2
-rw-r--r--modules/txt2img.py3
-rw-r--r--modules/ui.py265
-rw-r--r--modules/ui_extensions.py66
-rw-r--r--modules/ui_tempdir.py62
-rw-r--r--modules/upscaler.py12
-rw-r--r--requirements.txt5
-rw-r--r--requirements_versions.txt5
-rw-r--r--scripts/img2imgalt.py4
-rw-r--r--scripts/prompt_matrix.py2
-rw-r--r--scripts/prompts_from_file.py6
-rw-r--r--scripts/xy_grid.py22
-rw-r--r--style.css5
-rw-r--r--test/advanced_features/__init__.py0
-rw-r--r--test/advanced_features/extras_test.py (renamed from test/extras_test.py)4
-rw-r--r--test/advanced_features/txt2img_test.py47
-rw-r--r--test/basic_features/__init__.py0
-rw-r--r--test/basic_features/img2img_test.py (renamed from test/img2img_test.py)4
-rw-r--r--test/basic_features/txt2img_test.py (renamed from test/txt2img_test.py)12
-rw-r--r--test/basic_features/utils_test.py53
-rw-r--r--test/server_poll.py13
-rw-r--r--test/test_files/empty.ptbin0 -> 431 bytes
-rw-r--r--v1-inference.yaml70
-rw-r--r--webui-user.sh3
-rw-r--r--webui.bat12
-rw-r--r--webui.py91
-rwxr-xr-xwebui.sh30
93 files changed, 3644 insertions, 8520 deletions
diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml
new file mode 100644
index 00000000..49dc92bd
--- /dev/null
+++ b/.github/workflows/run_tests.yaml
@@ -0,0 +1,31 @@
+name: Run basic features tests on CPU with empty SD model
+
+on:
+ - push
+ - pull_request
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Code
+ uses: actions/checkout@v3
+ - name: Set up Python 3.10
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.10.6
+ - uses: actions/cache@v3
+ with:
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
+ restore-keys: ${{ runner.os }}-pip-
+ - name: Run tests
+ run: python launch.py --tests basic_features --no-half --disable-opt-split-attention --use-cpu all --skip-torch-cuda-test
+ - name: Upload main app stdout-stderr
+ uses: actions/upload-artifact@v3
+ if: always()
+ with:
+ name: stdout-stderr
+ path: |
+ test/stdout.txt
+ test/stderr.txt
diff --git a/.gitignore b/.gitignore
index ee53044c..21fa26a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
__pycache__
*.ckpt
+*.safetensors
*.pth
/ESRGAN/*
/SwinIR/*
diff --git a/CODEOWNERS b/CODEOWNERS
index a48d8012..7438c9bc 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -1,13 +1,12 @@
* @AUTOMATIC1111
-/localizations/ar_AR.json @xmodar @blackneoo
-/localizations/de_DE.json @LunixWasTaken
-/localizations/es_ES.json @innovaciones
-/localizations/fr_FR.json @tumbly
-/localizations/it_IT.json @EugenioBuffo
-/localizations/ja_JP.json @yuuki76
-/localizations/ko_KR.json @36DB
-/localizations/pt_BR.json @M-art-ucci
-/localizations/ru_RU.json @kabachuha
-/localizations/tr_TR.json @camenduru
-/localizations/zh_CN.json @dtlnor @bgluminous
-/localizations/zh_TW.json @benlisquare
+
+# if you were managing a localization and were removed from this file, this is because
+# the intended way to do localizations now is via extensions. See:
+# https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions
+# Make a repo with your localization and since you are still listed as a collaborator
+# you can add it to the wiki page yourself. This change is because some people complained
+# the git commit log is cluttered with things unrelated to almost everyone and
+# because I believe this is the best overall for the project to handle localizations almost
+# entirely without my oversight.
+
+
diff --git a/README.md b/README.md
index 55c050d5..8a4ffade 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ Check the [custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-web
- separate prompts using uppercase `AND`
- also supports weights for prompts: `a cat :1.2 AND a dog AND a penguin :2.2`
- No token limit for prompts (original stable diffusion lets you use up to 75 tokens)
-- DeepDanbooru integration, creates danbooru style tags for anime prompts (add --deepdanbooru to commandline args)
+- DeepDanbooru integration, creates danbooru style tags for anime prompts
- [xformers](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers), major speed increase for select cards: (add --xformers to commandline args)
- via extension: [History tab](https://github.com/yfszzx/stable-diffusion-webui-images-browser): view, direct and delete images conveniently within the UI
- Generate forever option
@@ -84,26 +84,7 @@ Check the [custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-web
- API
- Support for dedicated [inpainting model](https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion) by RunwayML.
- via extension: [Aesthetic Gradients](https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients), a way to generate images with a specific aesthetic by using clip images embds (implementation of [https://github.com/vicgalle/stable-diffusion-aesthetic-gradients](https://github.com/vicgalle/stable-diffusion-aesthetic-gradients))
-
-## Where are Aesthetic Gradients?!?!
-Aesthetic Gradients are now an extension. You can install it using git:
-
-```commandline
-git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients extensions/aesthetic-gradients
-```
-
-After running this command, make sure that you have `aesthetic-gradients` dir in webui's `extensions` directory and restart
-the UI. The interface for Aesthetic Gradients should appear exactly the same as it was.
-
-## Where is History/Image browser?!?!
-Image browser is now an extension. You can install it using git:
-
-```commandline
-git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser extensions/images-browser
-```
-
-After running this command, make sure that you have `images-browser` dir in webui's `extensions` directory and restart
-the UI. The interface for Image browser should appear exactly the same as it was.
+- [Stable Diffusion 2.0](https://github.com/Stability-AI/stablediffusion) support - see [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#stable-diffusion-20) for instructions
## Installation and Running
Make sure the required [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) are met and follow the instructions available for both [NVidia](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs) (recommended) and [AMD](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs) GPUs.
@@ -155,14 +136,15 @@ The documentation was moved from this README over to the project's [wiki](https:
- Swin2SR - https://github.com/mv-lab/swin2sr
- LDSR - https://github.com/Hafiidz/latent-diffusion
- Ideas for optimizations - https://github.com/basujindal/stable-diffusion
-- Doggettx - Cross Attention layer optimization - https://github.com/Doggettx/stable-diffusion, original idea for prompt editing.
-- InvokeAI, lstein - Cross Attention layer optimization - https://github.com/invoke-ai/InvokeAI (originally http://github.com/lstein/stable-diffusion)
-- Rinon Gal - Textual Inversion - https://github.com/rinongal/textual_inversion (we're not using his code, but we are using his ideas).
+- Cross Attention layer optimization - Doggettx - https://github.com/Doggettx/stable-diffusion, original idea for prompt editing.
+- Cross Attention layer optimization - InvokeAI, lstein - https://github.com/invoke-ai/InvokeAI (originally http://github.com/lstein/stable-diffusion)
+- Textual Inversion - Rinon Gal - https://github.com/rinongal/textual_inversion (we're not using his code, but we are using his ideas).
- Idea for SD upscale - https://github.com/jquesnelle/txt2imghd
- Noise generation for outpainting mk2 - https://github.com/parlance-zz/g-diffuser-bot
- CLIP interrogator idea and borrowing some code - https://github.com/pharmapsychotic/clip-interrogator
- Idea for Composable Diffusion - https://github.com/energy-based-model/Compositional-Visual-Generation-with-Composable-Diffusion-Models-PyTorch
- xformers - https://github.com/facebookresearch/xformers
- DeepDanbooru - interrogator for anime diffusers https://github.com/KichangKim/DeepDanbooru
+- Security advice - RyotaK
- Initial Gradio script - posted on 4chan by an Anonymous user. Thank you Anonymous user.
- (You)
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js
index c0d29a74..b947cbec 100644
--- a/javascript/edit-attention.js
+++ b/javascript/edit-attention.js
@@ -1,7 +1,6 @@
addEventListener('keydown', (event) => {
let target = event.originalTarget || event.composedPath()[0];
- if (!target.hasAttribute("placeholder")) return;
- if (!target.placeholder.toLowerCase().includes("prompt")) return;
+ if (!target.matches("#toprow textarea.gr-text-input[placeholder]")) return;
if (! (event.metaKey || event.ctrlKey)) return;
diff --git a/javascript/generationParams.js b/javascript/generationParams.js
new file mode 100644
index 00000000..95f05093
--- /dev/null
+++ b/javascript/generationParams.js
@@ -0,0 +1,33 @@
+// attaches listeners to the txt2img and img2img galleries to update displayed generation param text when the image changes
+
+let txt2img_gallery, img2img_gallery, modal = undefined;
+onUiUpdate(function(){
+ if (!txt2img_gallery) {
+ txt2img_gallery = attachGalleryListeners("txt2img")
+ }
+ if (!img2img_gallery) {
+ img2img_gallery = attachGalleryListeners("img2img")
+ }
+ if (!modal) {
+ modal = gradioApp().getElementById('lightboxModal')
+ modalObserver.observe(modal, { attributes : true, attributeFilter : ['style'] });
+ }
+});
+
+let modalObserver = new MutationObserver(function(mutations) {
+ mutations.forEach(function(mutationRecord) {
+ let selectedTab = gradioApp().querySelector('#tabs div button.bg-white')?.innerText
+ if (mutationRecord.target.style.display === 'none' && selectedTab === 'txt2img' || selectedTab === 'img2img')
+ gradioApp().getElementById(selectedTab+"_generation_info_button").click()
+ });
+});
+
+function attachGalleryListeners(tab_name) {
+ gallery = gradioApp().querySelector('#'+tab_name+'_gallery')
+ gallery?.addEventListener('click', () => gradioApp().getElementById(tab_name+"_generation_info_button").click());
+ gallery?.addEventListener('keydown', (e) => {
+ if (e.keyCode == 37 || e.keyCode == 39) // left or right arrow
+ gradioApp().getElementById(tab_name+"_generation_info_button").click()
+ });
+ return gallery;
+}
diff --git a/javascript/hints.js b/javascript/hints.js
index 623bc25c..57db35be 100644
--- a/javascript/hints.js
+++ b/javascript/hints.js
@@ -62,8 +62,8 @@ titles = {
"Interrogate": "Reconstruct prompt from existing image and put it into the prompt field.",
- "Images filename pattern": "Use following tags to define how filenames for images are chosen: [steps], [cfg], [prompt], [prompt_no_styles], [prompt_spaces], [width], [height], [styles], [sampler], [seed], [model_hash], [prompt_words], [date], [datetime], [datetime<Format>], [datetime<Format><Time Zone>], [job_timestamp]; leave empty for default.",