Skip to content

Commit a3ddf46

Browse files
committed
Merge branch 'release_candidate'
2 parents f865d3e + 2c11e90 commit a3ddf46

File tree

97 files changed

+3611
-1368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3611
-1368
lines changed

.github/workflows/on_pull_request.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
name: Run Linting/Formatting on Pull Requests
1+
name: Linter
22

33
on:
44
- push
55
- pull_request
66

77
jobs:
88
lint-python:
9+
name: ruff
910
runs-on: ubuntu-latest
11+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1012
steps:
1113
- name: Checkout Code
1214
uses: actions/checkout@v3
@@ -18,11 +20,13 @@ jobs:
1820
# not to have GHA download an (at the time of writing) 4 GB cache
1921
# of PyTorch and other dependencies.
2022
- name: Install Ruff
21-
run: pip install ruff==0.0.265
23+
run: pip install ruff==0.0.272
2224
- name: Run Ruff
2325
run: ruff .
2426
lint-js:
27+
name: eslint
2528
runs-on: ubuntu-latest
29+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
2630
steps:
2731
- name: Checkout Code
2832
uses: actions/checkout@v3

.github/workflows/run_tests.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
name: Run basic features tests on CPU with empty SD model
1+
name: Tests
22

33
on:
44
- push
55
- pull_request
66

77
jobs:
88
test:
9+
name: tests on CPU with empty model
910
runs-on: ubuntu-latest
11+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1012
steps:
1113
- name: Checkout Code
1214
uses: actions/checkout@v3
@@ -39,18 +41,19 @@ jobs:
3941
--skip-prepare-environment
4042
--skip-torch-cuda-test
4143
--test-server
44+
--do-not-download-clip
4245
--no-half
4346
--disable-opt-split-attention
4447
--use-cpu all
45-
--add-stop-route
48+
--api-server-stop
4649
2>&1 | tee output.txt &
4750
- name: Run tests
4851
run: |
4952
wait-for-it --service 127.0.0.1:7860 -t 600
5053
python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
5154
- name: Kill test server
5255
if: always()
53-
run: curl -vv -XPOST http://127.0.0.1:7860/_stop && sleep 10
56+
run: curl -vv -XPOST http://127.0.0.1:7860/sdapi/v1/server-stop && sleep 10
5457
- name: Show coverage
5558
run: |
5659
python -m coverage combine .coverage*
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Pull requests can't target master branch
2+
3+
"on":
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
branches:
10+
- master
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Warning marge into master
17+
run: |
18+
echo -e "::warning::This pull request directly merge into \"master\" branch, normally development happens on \"dev\" branch."
19+
exit 1

CHANGELOG.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
## 1.5.0
2+
3+
### Features:
4+
* SD XL support
5+
* user metadata system for custom networks
6+
* extended Lora metadata editor: set activation text, default weight, view tags, training info
7+
* Lora extension rework to include other types of networks (all that were previously handled by LyCORIS extension)
8+
* show github stars for extenstions
9+
* img2img batch mode can read extra stuff from png info
10+
* img2img batch works with subdirectories
11+
* hotkeys to move prompt elements: alt+left/right
12+
* restyle time taken/VRAM display
13+
* add textual inversion hashes to infotext
14+
* optimization: cache git extension repo information
15+
* move generate button next to the generated picture for mobile clients
16+
* hide cards for networks of incompatible Stable Diffusion version in Lora extra networks interface
17+
* skip installing packages with pip if they all are already installed - startup speedup of about 2 seconds
18+
19+
### Minor:
20+
* checkbox to check/uncheck all extensions in the Installed tab
21+
* add gradio user to infotext and to filename patterns
22+
* allow gif for extra network previews
23+
* add options to change colors in grid
24+
* use natural sort for items in extra networks
25+
* Mac: use empty_cache() from torch 2 to clear VRAM
26+
* added automatic support for installing the right libraries for Navi3 (AMD)
27+
* add option SWIN_torch_compile to accelerate SwinIR upscale
28+
* suppress printing TI embedding info at start to console by default
29+
* speedup extra networks listing
30+
* added `[none]` filename token.
31+
* removed thumbs extra networks view mode (use settings tab to change width/height/scale to get thumbs)
32+
* add always_discard_next_to_last_sigma option to XYZ plot
33+
* automatically switch to 32-bit float VAE if the generated picture has NaNs without the need for `--no-half-vae` commandline flag.
34+
35+
### Extensions and API:
36+
* api endpoints: /sdapi/v1/server-kill, /sdapi/v1/server-restart, /sdapi/v1/server-stop
37+
* allow Script to have custom metaclass
38+
* add model exists status check /sdapi/v1/options
39+
* rename --add-stop-route to --api-server-stop
40+
* add `before_hr` script callback
41+
* add callback `after_extra_networks_activate`
42+
* disable rich exception output in console for API by default, use WEBUI_RICH_EXCEPTIONS env var to enable
43+
* return http 404 when thumb file not found
44+
* allow replacing extensions index with environment variable
45+
46+
### Bug Fixes:
47+
* fix for catch errors when retrieving extension index #11290
48+
* fix very slow loading speed of .safetensors files when reading from network drives
49+
* API cache cleanup
50+
* fix UnicodeEncodeError when writing to file CLIP Interrogator batch mode
51+
* fix warning of 'has_mps' deprecated from PyTorch
52+
* fix problem with extra network saving images as previews losing generation info
53+
* fix throwing exception when trying to resize image with I;16 mode
54+
* fix for #11534: canvas zoom and pan extension hijacking shortcut keys
55+
* fixed launch script to be runnable from any directory
56+
* don't add "Seed Resize: -1x-1" to API image metadata
57+
* correctly remove end parenthesis with ctrl+up/down
58+
* fixing --subpath on newer gradio version
59+
* fix: check fill size none zero when resize (fixes #11425)
60+
* use submit and blur for quick settings textbox
61+
* save img2img batch with images.save_image()
62+
* prevent running preload.py for disabled extensions
63+
* fix: previously, model name was added together with directory name to infotext and to [model_name] filename pattern; directory name is now not included
64+
65+
166
## 1.4.1
267

368
### Bug Fixes:

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ Find the instructions [here](https://github.com/AUTOMATIC1111/stable-diffusion-w
135135
Here's how to add code to this repo: [Contributing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
136136

137137
## Documentation
138+
138139
The documentation was moved from this README over to the project's [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki).
139140

141+
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).
142+
140143
## Credits
141144
Licenses for borrowed code can be found in `Settings -> Licenses` screen, and also in `html/licenses.html` file.
142145

@@ -165,5 +168,6 @@ Licenses for borrowed code can be found in `Settings -> Licenses` screen, and al
165168
- Security advice - RyotaK
166169
- UniPC sampler - Wenliang Zhao - https://github.com/wl-zhao/UniPC
167170
- TAESD - Ollin Boer Bohan - https://github.com/madebyollin/taesd
171+
- LyCORIS - KohakuBlueleaf
168172
- Initial Gradio script - posted on 4chan by an Anonymous user. Thank you Anonymous user.
169173
- (You)

extensions-builtin/LDSR/ldsr_model_arch.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from ldm.models.diffusion.ddim import DDIMSampler
1414
from ldm.util import instantiate_from_config, ismap
15-
from modules import shared, sd_hijack
15+
from modules import shared, sd_hijack, devices
1616

1717
cached_ldsr_model: torch.nn.Module = None
1818

@@ -112,8 +112,7 @@ def super_resolution(self, image, steps=100, target_scale=2, half_attention=Fals
112112

113113

114114
gc.collect()
115-
if torch.cuda.is_available:
116-
torch.cuda.empty_cache()
115+
devices.torch_gc()
117116

118117
im_og = image
119118
width_og, height_og = im_og.size
@@ -150,8 +149,7 @@ def super_resolution(self, image, steps=100, target_scale=2, half_attention=Fals
150149

151150
del model
152151
gc.collect()
153-
if torch.cuda.is_available:
154-
torch.cuda.empty_cache()
152+
devices.torch_gc()
155153

156154
return a
157155

extensions-builtin/LDSR/scripts/ldsr_model.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22

3-
from basicsr.utils.download_util import load_file_from_url
4-
3+
from modules.modelloader import load_file_from_url
54
from modules.upscaler import Upscaler, UpscalerData
65
from ldsr_model_arch import LDSR
76
from modules import shared, script_callbacks, errors
@@ -43,20 +42,17 @@ def load_model(self, path: str):
4342
if local_safetensors_path is not None and os.path.exists(local_safetensors_path):
4443
model = local_safetensors_path
4544
else:
46-
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)
45+
model = local_ckpt_path or load_file_from_url(self.model_url, model_dir=self.model_download_path, file_name="model.ckpt")
4746

48-
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)
47+
yaml = local_yaml_path or load_file_from_url(self.yaml_url, model_dir=self.model_download_path, file_name="project.yaml")
4948

50-
try:
51-
return LDSR(model, yaml)
52-
except Exception:
53-
errors.report("Error importing LDSR", exc_info=True)
54-
return None
49+
return LDSR(model, yaml)
5550

5651
def do_upscale(self, img, path):
57-
ldsr = self.load_model(path)
58-
if ldsr is None:
59-
print("NO LDSR!")
52+
try:
53+
ldsr = self.load_model(path)
54+
except Exception:
55+
errors.report(f"Failed loading LDSR model {path}", exc_info=True)
6056
return img
6157
ddim_steps = shared.opts.ldsr_steps
6258
return ldsr.super_resolution(img, ddim_steps, self.scale)
Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from modules import extra_networks, shared
2-
import lora
2+
import networks
33

44

55
class ExtraNetworkLora(extra_networks.ExtraNetwork):
@@ -9,24 +9,38 @@ def __init__(self):
99
def activate(self, p, params_list):
1010
additional = shared.opts.sd_lora
1111

12-
if additional != "None" and additional in lora.available_loras and not any(x for x in params_list if x.items[0] == additional):
12+
if additional != "None" and additional in networks.available_networks and not any(x for x in params_list if x.items[0] == additional):
1313
p.all_prompts = [x + f"<lora:{additional}:{shared.opts.extra_networks_default_multiplier}>" for x in p.all_prompts]
1414
params_list.append(extra_networks.ExtraNetworkParams(items=[additional, shared.opts.extra_networks_default_multiplier]))
1515

1616
names = []
17-
multipliers = []
17+
te_multipliers = []
18+
unet_multipliers = []
19+
dyn_dims = []
1820
for params in params_list:
1921
assert params.items
2022

21-
names.append(params.items[0])
22-
multipliers.append(float(params.items[1]) if len(params.items) > 1 else 1.0)
23+
names.append(params.positional[0])
2324

24-
lora.load_loras(names, multipliers)
25+
te_multiplier = float(params.positional[1]) if len(params.positional) > 1 else 1.0
26+
te_multiplier = float(params.named.get("te", te_multiplier))
27+
28+
unet_multiplier = float(params.positional[2]) if len(params.positional) > 2 else te_multiplier
29+
unet_multiplier = float(params.named.get("unet", unet_multiplier))
30+
31+
dyn_dim = int(params.positional[3]) if len(params.positional) > 3 else None
32+
dyn_dim = int(params.named["dyn"]) if "dyn" in params.named else dyn_dim
33+
34+
te_multipliers.append(te_multiplier)
35+
unet_multipliers.append(unet_multiplier)
36+
dyn_dims.append(dyn_dim)
37+
38+
networks.load_networks(names, te_multipliers, unet_multipliers, dyn_dims)
2539

2640
if shared.opts.lora_add_hashes_to_infotext:
27-
lora_hashes = []
28-
for item in lora.loaded_loras:
29-
shorthash = item.lora_on_disk.shorthash
41+
network_hashes = []
42+
for item in networks.loaded_networks:
43+
shorthash = item.network_on_disk.shorthash
3044
if not shorthash:
3145
continue
3246

@@ -36,10 +50,10 @@ def activate(self, p, params_list):
3650

3751
alias = alias.replace(":", "").replace(",", "")
3852

39-
lora_hashes.append(f"{alias}: {shorthash}")
53+
network_hashes.append(f"{alias}: {shorthash}")
4054

41-
if lora_hashes:
42-
p.extra_generation_params["Lora hashes"] = ", ".join(lora_hashes)
55+
if network_hashes:
56+
p.extra_generation_params["Lora hashes"] = ", ".join(network_hashes)
4357

4458
def deactivate(self, p):
4559
pass

0 commit comments

Comments
 (0)