aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeon Feng <523684+leon0707@users.noreply.github.com>2023-07-18 08:24:14 +0000
committerGitHub <noreply@github.com>2023-07-18 08:24:14 +0000
commita3730bd9becd2f1f5d209885b694b0dec178d110 (patch)
tree8ac9948d89606f7519df786f07f6ddb93c3d2720
parentd6668347c8b85b11b696ac56777cc396e34ee1f9 (diff)
parent871b8687a82bb2ca907d8a49c87aed7635b8fc33 (diff)
downloadstable-diffusion-webui-gfx803-a3730bd9becd2f1f5d209885b694b0dec178d110.tar.gz
stable-diffusion-webui-gfx803-a3730bd9becd2f1f5d209885b694b0dec178d110.tar.bz2
stable-diffusion-webui-gfx803-a3730bd9becd2f1f5d209885b694b0dec178d110.zip
Merge branch 'dev' into fix-11805
-rw-r--r--.github/workflows/on_pull_request.yaml8
-rw-r--r--.github/workflows/run_tests.yaml8
-rw-r--r--.github/workflows/warns_merge_master.yml19
-rw-r--r--CHANGELOG.md60
-rw-r--r--README.md4
-rw-r--r--extensions-builtin/LDSR/ldsr_model_arch.py8
-rw-r--r--extensions-builtin/LDSR/scripts/ldsr_model.py20
-rw-r--r--extensions-builtin/Lora/extra_networks_lora.py38
-rw-r--r--extensions-builtin/Lora/lora.py511
-rw-r--r--extensions-builtin/Lora/lyco_helpers.py21
-rw-r--r--extensions-builtin/Lora/network.py154
-rw-r--r--extensions-builtin/Lora/network_full.py22
-rw-r--r--extensions-builtin/Lora/network_hada.py55
-rw-r--r--extensions-builtin/Lora/network_ia3.py30
-rw-r--r--extensions-builtin/Lora/network_lokr.py64
-rw-r--r--extensions-builtin/Lora/network_lora.py86
-rw-r--r--extensions-builtin/Lora/networks.py463
-rw-r--r--extensions-builtin/Lora/scripts/lora_script.py87
-rw-r--r--extensions-builtin/Lora/ui_edit_user_metadata.py210
-rw-r--r--extensions-builtin/Lora/ui_extra_networks_lora.py82
-rw-r--r--extensions-builtin/ScuNET/scripts/scunet_model.py30
-rw-r--r--extensions-builtin/SwinIR/scripts/swinir_model.py83
-rw-r--r--extensions-builtin/canvas-zoom-and-pan/javascript/zoom.js30
-rw-r--r--extensions-builtin/canvas-zoom-and-pan/scripts/hotkey_config.py1
-rw-r--r--extensions-builtin/mobile/javascript/mobile.js26
-rw-r--r--html/extra-networks-card.html10
-rw-r--r--html/image-update.svg7
-rw-r--r--javascript/badScaleChecker.js108
-rw-r--r--javascript/edit-attention.js5
-rw-r--r--javascript/edit-order.js41
-rw-r--r--javascript/extensions.js18
-rw-r--r--javascript/extraNetworks.js66
-rw-r--r--javascript/hints.js3
-rw-r--r--modules/api/api.py164
-rw-r--r--modules/api/models.py4
-rw-r--r--modules/cache.py120
-rw-r--r--modules/call_queue.py23
-rw-r--r--modules/cmd_args.py2
-rw-r--r--modules/codeformer_model.py6
-rw-r--r--modules/devices.py11
-rw-r--r--modules/esrgan_model.py23
-rw-r--r--modules/extensions.py26
-rw-r--r--modules/extra_networks.py19
-rw-r--r--modules/extras.py3
-rw-r--r--modules/generation_parameters_copypaste.py29
-rw-r--r--modules/gfpgan_model.py2
-rw-r--r--modules/hashes.py33
-rw-r--r--modules/hypernetworks/hypernetwork.py32
-rw-r--r--modules/images.py74
-rw-r--r--modules/img2img.py74
-rw-r--r--modules/interrogate.py3
-rw-r--r--modules/launch_utils.py66
-rw-r--r--modules/lowvram.py53
-rw-r--r--modules/mac_specific.py39
-rw-r--r--modules/modelloader.py31
-rw-r--r--modules/paths.py39
-rw-r--r--modules/postprocessing.py7
-rw-r--r--modules/processing.py59
-rw-r--r--modules/prompt_parser.py95
-rw-r--r--modules/realesrgan_model.py33
-rw-r--r--modules/scripts.py40
-rw-r--r--modules/sd_hijack.py43
-rw-r--r--modules/sd_hijack_clip.py46
-rw-r--r--modules/sd_hijack_open_clip.py36
-rw-r--r--modules/sd_hijack_optimizations.py51
-rw-r--r--modules/sd_hijack_unet.py8
-rw-r--r--modules/sd_models.py57
-rw-r--r--modules/sd_models_config.py9
-rw-r--r--modules/sd_models_xl.py99
-rw-r--r--modules/sd_samplers.py3
-rw-r--r--modules/sd_samplers_compvis.py6
-rw-r--r--modules/sd_samplers_kdiffusion.py45
-rw-r--r--modules/sd_vae_approx.py59
-rw-r--r--modules/sd_vae_taesd.py26
-rw-r--r--modules/shared.py51
-rw-r--r--modules/textual_inversion/logging.py48
-rw-r--r--modules/textual_inversion/preprocess.py2
-rw-r--r--modules/textual_inversion/textual_inversion.py17
-rw-r--r--modules/txt2img.py19
-rw-r--r--modules/ui.py16
-rw-r--r--modules/ui_common.py9
-rw-r--r--modules/ui_extensions.py40
-rw-r--r--modules/ui_extra_networks.py118
-rw-r--r--modules/ui_extra_networks_checkpoints.py32
-rw-r--r--modules/ui_extra_networks_hypernets.py33
-rw-r--r--modules/ui_extra_networks_textual_inversion.py32
-rw-r--r--modules/ui_extra_networks_user_metadata.py195
-rw-r--r--modules/ui_settings.py21
-rw-r--r--requirements.txt1
-rw-r--r--requirements_versions.txt5
-rw-r--r--scripts/xyz_grid.py12
-rw-r--r--style.css196
-rw-r--r--webui.py43
-rwxr-xr-xwebui.sh16
94 files changed, 3533 insertions, 1349 deletions
diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml
index 7b7219fd..78e608ee 100644
--- a/.github/workflows/on_pull_request.yaml
+++ b/.github/workflows/on_pull_request.yaml
@@ -1,4 +1,4 @@
-name: Run Linting/Formatting on Pull Requests
+name: Linter
on:
- push
@@ -6,7 +6,9 @@ on:
jobs:
lint-python:
+ name: ruff
runs-on: ubuntu-latest
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout Code
uses: actions/checkout@v3
@@ -18,11 +20,13 @@ jobs:
# not to have GHA download an (at the time of writing) 4 GB cache
# of PyTorch and other dependencies.
- name: Install Ruff
- run: pip install ruff==0.0.265
+ run: pip install ruff==0.0.272
- name: Run Ruff
run: ruff .
lint-js:
+ name: eslint
runs-on: ubuntu-latest
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout Code
uses: actions/checkout@v3
diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml
index 226cf759..e9370cc0 100644
--- a/.github/workflows/run_tests.yaml
+++ b/.github/workflows/run_tests.yaml
@@ -1,4 +1,4 @@
-name: Run basic features tests on CPU with empty SD model
+name: Tests
on:
- push
@@ -6,7 +6,9 @@ on:
jobs:
test:
+ name: tests on CPU with empty model
runs-on: ubuntu-latest
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout Code
uses: actions/checkout@v3
@@ -42,7 +44,7 @@ jobs:
--no-half
--disable-opt-split-attention
--use-cpu all
- --add-stop-route
+ --api-server-stop
2>&1 | tee output.txt &
- name: Run tests
run: |
@@ -50,7 +52,7 @@ jobs:
python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
- name: Kill test server
if: always()
- run: curl -vv -XPOST http://127.0.0.1:7860/_stop && sleep 10
+ run: curl -vv -XPOST http://127.0.0.1:7860/sdapi/v1/server-stop && sleep 10
- name: Show coverage
run: |
python -m coverage combine .coverage*
diff --git a/.github/workflows/warns_merge_master.yml b/.github/workflows/warns_merge_master.yml
new file mode 100644
index 00000000..ae2aab6b
--- /dev/null
+++ b/.github/workflows/warns_merge_master.yml
@@ -0,0 +1,19 @@
+name: Pull requests can't target master branch
+
+"on":
+ pull_request:
+ types:
+ - opened
+ - synchronize
+ - reopened
+ branches:
+ - master
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Warning marge into master
+ run: |
+ echo -e "::warning::This pull request directly merge into \"master\" branch, normally development happens on \"dev\" branch."
+ exit 1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 925403a9..30783d9d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,63 @@
+## 1.5.0
+
+### Features:
+ * SD XL support
+ * user metadata system for custom networks
+ * extended Lora metadata editor: set activation text, default weight, view tags, training info
+ * show github stars for extenstions
+ * img2img batch mode can read extra stuff from png info
+ * img2img batch works with subdirectories
+ * hotkeys to move prompt elements: alt+left/right
+ * restyle time taken/VRAM display
+ * add textual inversion hashes to infotext
+ * optimization: cache git extension repo information
+
+### Minor:
+ * checkbox to check/uncheck all extensions in the Installed tab
+ * add gradio user to infotext and to filename patterns
+ * allow gif for extra network previews
+ * add options to change colors in grid
+ * use natural sort for items in extra networks
+ * Mac: use empty_cache() from torch 2 to clear VRAM
+ * added automatic support for installing the right libraries for Navi3 (AMD)
+ * add option SWIN_torch_compile to accelerate SwinIR upscale
+ * suppress printing TI embedding info at start to console by default
+ * speedup extra networks listing
+ * added `[none]` filename token.
+ * removed thumbs extra networks view mode (use settings tab to change width/height/scale to get thumbs)
+
+### Extensions and API:
+ * api endpoints: /sdapi/v1/server-kill, /sdapi/v1/server-restart, /sdapi/v1/server-stop
+ * allow Script to have custom metaclass
+ * add model exists status check /sdapi/v1/options
+ * rename --add-stop-route to --api-server-stop
+ * add `before_hr` script callback
+ * add callback `after_extra_networks_activate`
+ * disable rich exception output in console for API by default, use WEBUI_RICH_EXCEPTIONS env var to enable
+ * return http 404 when thumb file not found
+ * allow replacing extensions index with environment variable
+
+### Bug Fixes:
+ * fix for catch errors when retrieving extension index #11290
+ * fix very slow loading speed of .safetensors files when reading from network drives
+ * API cache cleanup
+ * fix UnicodeEncodeError when writing to file CLIP Interrogator batch mode
+ * fix warning of 'has_mps' deprecated from PyTorch
+ * fix problem with extra network saving images as previews losing generation info
+ * fix throwing exception when trying to resize image with I;16 mode
+ * fix for #11534: canvas zoom and pan extension hijacking shortcut keys
+ * fixed launch script to be runnable from any directory
+ * don't add "Seed Resize: -1x-1" to API image metadata
+ * correctly remove end parenthesis with ctrl+up/down
+ * fixing --subpath on newer gradio version
+ * fix: check fill size none zero when resize (fixes #11425)
+ * use submit and blur for quick settings textbox
+ * save img2img batch with images.save_image()
+ *
+
+
+
+
## 1.4.1
### Bug Fixes:
diff --git a/README.md b/README.md
index 73d94960..b796d150 100644
--- a/README.md
+++ b/README.md
@@ -135,8 +135,11 @@ Find the instructions [here](https://github.com/AUTOMATIC1111/stable-diffusion-w
Here's how to add code to this repo: [Contributing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
## Documentation
+
The documentation was moved from this README over to the project's [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki).
+For the purposes of getting Google and other search engines to crawl the wiki, here's a link to the (not for humans) [crawlable wiki](https://github-wiki-see.page/m/AUTOMATIC1111/stable-diffusion-webui/wiki).
+
## Credits
Licenses for borrowed code can be found in `Settings -> Licenses` screen, and also in `html/licenses.html` file.
@@ -165,5 +168,6 @@ Licenses for borrowed code can be found in `Settings -> Licenses` screen, and al
- Security advice - RyotaK
- UniPC sampler - Wenliang Zhao - https://github.com/wl-zhao/UniPC
- TAESD - Ollin Boer Bohan - https://github.com/madebyollin/taesd
+- LyCORIS - KohakuBlueleaf
- Initial Gradio script - posted on 4chan by an Anonymous user. Thank you Anonymous user.
- (You)
diff --git a/extensions-builtin/LDSR/ldsr_model_arch.py b/extensions-builtin/LDSR/ldsr_model_arch.py
index 7f450086..7cac36ce 100644
--- a/extensions-builtin/LDSR/ldsr_model_arch.py
+++ b/extensions-builtin/LDSR/ldsr_model_arch.py
@@ -12,7 +12,7 @@ import safetensors.torch
from ldm.models.diffusion.ddim import DDIMSampler
from ldm.util import instantiate_from_config, ismap
-from modules import shared, sd_hijack
+from modules import shared, sd_hijack, devices
cached_ldsr_model: torch.nn.Module = None
@@ -112,8 +112,7 @@ class LDSR:
gc.collect()
- if torch.cuda.is_available:
- torch.cuda.empty_cache()
+ devices.torch_gc()
im_og = image
width_og, height_og = im_og.size
@@ -150,8 +149,7 @@ class LDSR:
del model
gc.collect()
- if torch.cuda.is_available:
- torch.cuda.empty_cache()
+ devices.torch_gc()
return a
diff --git a/extensions-builtin/LDSR/scripts/ldsr_model.py b/extensions-builtin/LDSR/scripts/ldsr_model.py
index dbd6d331..bd78dece 100644
--- a/extensions-builtin/LDSR/scripts/ldsr_model.py
+++ b/extensions-builtin/LDSR/scripts/ldsr_model.py
@@ -1,7 +1,6 @@
import os
-from basicsr.utils.download_util import load_file_from_url
-
+from modules.modelloader import load_file_from_url
from modules.upscaler import Upscaler, UpscalerData
from ldsr_model_arch import LDSR
from modules import shared, script_callbacks, errors
@@ -43,20 +42,17 @@ class UpscalerLDSR(Upscaler):
if local_safetensors_path is not None and os.path.exists(local_safetensors_path):
model = local_safetensors_path
else:
- model = local_ckpt_path if local_ckpt_path is not None else load_file_from_url(url=self.model_url, model_dir=self.model_download_path, file_name="model.ckpt", progress=True)
+ model = local_ckpt_path or load_file_from_url(self.model_url, model_dir=self.model_download_path, file_name="model.ckpt")
- yaml = local_yaml_path if local_yaml_path is not None else load_file_from_url(url=self.yaml_url, model_dir=self.model_download_path, file_name="project.yaml", progress=True)
+ yaml = local_yaml_path or load_file_from_url(self.yaml_url, model_dir=self.model_download_path, file_name="project.yaml")
- try:
- return LDSR(model, yaml)
- except Exception:
- errors.report("Error importing LDSR", exc_info=True)
- return None
+ return LDSR(model, yaml)
def do_upscale(self, img, path):
- ldsr = self.load_model(path)
- if ldsr is None:
- print("NO LDSR!")
+ try: