Commit
•
488e0ba
1
Parent(s):
f61242b
Upload 84 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- stable-diffusion-webui/.eslintignore +4 -0
- stable-diffusion-webui/.eslintrc.js +97 -0
- stable-diffusion-webui/.git-blame-ignore-revs +2 -0
- stable-diffusion-webui/.github/ISSUE_TEMPLATE/feature_request.yml +40 -0
- stable-diffusion-webui/.github/pull_request_template.md +15 -0
- stable-diffusion-webui/.gitignore +39 -0
- stable-diffusion-webui/.pylintrc +3 -0
- stable-diffusion-webui/CHANGELOG.md +507 -0
- stable-diffusion-webui/CITATION.cff +7 -0
- stable-diffusion-webui/CODEOWNERS +12 -0
- stable-diffusion-webui/LICENSE.txt +663 -0
- stable-diffusion-webui/README.md +177 -0
- stable-diffusion-webui/__pycache__/launch.cpython-310.pyc +0 -0
- stable-diffusion-webui/cache.json +58 -0
- stable-diffusion-webui/cache/version.txt +1 -0
- stable-diffusion-webui/config.json +210 -0
- stable-diffusion-webui/configs/alt-diffusion-inference.yaml +72 -0
- stable-diffusion-webui/configs/instruct-pix2pix.yaml +98 -0
- stable-diffusion-webui/configs/v1-inference.yaml +70 -0
- stable-diffusion-webui/configs/v1-inpainting-inference.yaml +70 -0
- stable-diffusion-webui/embeddings/Place Textual Inversion embeddings here.txt +0 -0
- stable-diffusion-webui/environment-wsl2.yaml +11 -0
- stable-diffusion-webui/extensions/put extensions here.txt +0 -0
- stable-diffusion-webui/html/card-no-preview.png +0 -0
- stable-diffusion-webui/html/extra-networks-card.html +14 -0
- stable-diffusion-webui/html/extra-networks-no-cards.html +8 -0
- stable-diffusion-webui/html/footer.html +15 -0
- stable-diffusion-webui/html/licenses.html +690 -0
- stable-diffusion-webui/javascript/dragdrop.js +130 -0
- stable-diffusion-webui/javascript/edit-order.js +41 -0
- stable-diffusion-webui/javascript/extraNetworks.js +349 -0
- stable-diffusion-webui/javascript/hints.js +203 -0
- stable-diffusion-webui/javascript/hires_fix.js +18 -0
- stable-diffusion-webui/javascript/imageMaskFix.js +43 -0
- stable-diffusion-webui/javascript/imageviewerGamepad.js +63 -0
- stable-diffusion-webui/javascript/inputAccordion.js +37 -0
- stable-diffusion-webui/javascript/localStorage.js +26 -0
- stable-diffusion-webui/javascript/localization.js +205 -0
- stable-diffusion-webui/javascript/notification.js +49 -0
- stable-diffusion-webui/javascript/resizeHandle.js +141 -0
- stable-diffusion-webui/javascript/token-counters.js +83 -0
- stable-diffusion-webui/javascript/ui.js +368 -0
- stable-diffusion-webui/javascript/ui_settings_hints.js +62 -0
- stable-diffusion-webui/launch.py +48 -0
- stable-diffusion-webui/localizations/Put localization files here.txt +0 -0
- stable-diffusion-webui/package.json +11 -0
- stable-diffusion-webui/params.txt +2 -0
- stable-diffusion-webui/pyproject.toml +35 -0
- stable-diffusion-webui/requirements-test.txt +3 -0
- stable-diffusion-webui/requirements.txt +34 -0
stable-diffusion-webui/.eslintignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
extensions
|
2 |
+
extensions-disabled
|
3 |
+
repositories
|
4 |
+
venv
|
stable-diffusion-webui/.eslintrc.js
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global module */
|
2 |
+
module.exports = {
|
3 |
+
env: {
|
4 |
+
browser: true,
|
5 |
+
es2021: true,
|
6 |
+
},
|
7 |
+
extends: "eslint:recommended",
|
8 |
+
parserOptions: {
|
9 |
+
ecmaVersion: "latest",
|
10 |
+
},
|
11 |
+
rules: {
|
12 |
+
"arrow-spacing": "error",
|
13 |
+
"block-spacing": "error",
|
14 |
+
"brace-style": "error",
|
15 |
+
"comma-dangle": ["error", "only-multiline"],
|
16 |
+
"comma-spacing": "error",
|
17 |
+
"comma-style": ["error", "last"],
|
18 |
+
"curly": ["error", "multi-line", "consistent"],
|
19 |
+
"eol-last": "error",
|
20 |
+
"func-call-spacing": "error",
|
21 |
+
"function-call-argument-newline": ["error", "consistent"],
|
22 |
+
"function-paren-newline": ["error", "consistent"],
|
23 |
+
"indent": ["error", 4],
|
24 |
+
"key-spacing": "error",
|
25 |
+
"keyword-spacing": "error",
|
26 |
+
"linebreak-style": ["error", "unix"],
|
27 |
+
"no-extra-semi": "error",
|
28 |
+
"no-mixed-spaces-and-tabs": "error",
|
29 |
+
"no-multi-spaces": "error",
|
30 |
+
"no-redeclare": ["error", {builtinGlobals: false}],
|
31 |
+
"no-trailing-spaces": "error",
|
32 |
+
"no-unused-vars": "off",
|
33 |
+
"no-whitespace-before-property": "error",
|
34 |
+
"object-curly-newline": ["error", {consistent: true, multiline: true}],
|
35 |
+
"object-curly-spacing": ["error", "never"],
|
36 |
+
"operator-linebreak": ["error", "after"],
|
37 |
+
"quote-props": ["error", "consistent-as-needed"],
|
38 |
+
"semi": ["error", "always"],
|
39 |
+
"semi-spacing": "error",
|
40 |
+
"semi-style": ["error", "last"],
|
41 |
+
"space-before-blocks": "error",
|
42 |
+
"space-before-function-paren": ["error", "never"],
|
43 |
+
"space-in-parens": ["error", "never"],
|
44 |
+
"space-infix-ops": "error",
|
45 |
+
"space-unary-ops": "error",
|
46 |
+
"switch-colon-spacing": "error",
|
47 |
+
"template-curly-spacing": ["error", "never"],
|
48 |
+
"unicode-bom": "error",
|
49 |
+
},
|
50 |
+
globals: {
|
51 |
+
//script.js
|
52 |
+
gradioApp: "readonly",
|
53 |
+
executeCallbacks: "readonly",
|
54 |
+
onAfterUiUpdate: "readonly",
|
55 |
+
onOptionsChanged: "readonly",
|
56 |
+
onUiLoaded: "readonly",
|
57 |
+
onUiUpdate: "readonly",
|
58 |
+
uiCurrentTab: "writable",
|
59 |
+
uiElementInSight: "readonly",
|
60 |
+
uiElementIsVisible: "readonly",
|
61 |
+
//ui.js
|
62 |
+
opts: "writable",
|
63 |
+
all_gallery_buttons: "readonly",
|
64 |
+
selected_gallery_button: "readonly",
|
65 |
+
selected_gallery_index: "readonly",
|
66 |
+
switch_to_txt2img: "readonly",
|
67 |
+
switch_to_img2img_tab: "readonly",
|
68 |
+
switch_to_img2img: "readonly",
|
69 |
+
switch_to_sketch: "readonly",
|
70 |
+
switch_to_inpaint: "readonly",
|
71 |
+
switch_to_inpaint_sketch: "readonly",
|
72 |
+
switch_to_extras: "readonly",
|
73 |
+
get_tab_index: "readonly",
|
74 |
+
create_submit_args: "readonly",
|
75 |
+
restart_reload: "readonly",
|
76 |
+
updateInput: "readonly",
|
77 |
+
//extraNetworks.js
|
78 |
+
requestGet: "readonly",
|
79 |
+
popup: "readonly",
|
80 |
+
// from python
|
81 |
+
localization: "readonly",
|
82 |
+
// progrssbar.js
|
83 |
+
randomId: "readonly",
|
84 |
+
requestProgress: "readonly",
|
85 |
+
// imageviewer.js
|
86 |
+
modalPrevImage: "readonly",
|
87 |
+
modalNextImage: "readonly",
|
88 |
+
// token-counters.js
|
89 |
+
setupTokenCounters: "readonly",
|
90 |
+
// localStorage.js
|
91 |
+
localSet: "readonly",
|
92 |
+
localGet: "readonly",
|
93 |
+
localRemove: "readonly",
|
94 |
+
// resizeHandle.js
|
95 |
+
setupResizeHandle: "writable"
|
96 |
+
}
|
97 |
+
};
|
stable-diffusion-webui/.git-blame-ignore-revs
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
# Apply ESlint
|
2 |
+
9c54b78d9dde5601e916f308d9a9d6953ec39430
|
stable-diffusion-webui/.github/ISSUE_TEMPLATE/feature_request.yml
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Feature request
|
2 |
+
description: Suggest an idea for this project
|
3 |
+
title: "[Feature Request]: "
|
4 |
+
labels: ["enhancement"]
|
5 |
+
|
6 |
+
body:
|
7 |
+
- type: checkboxes
|
8 |
+
attributes:
|
9 |
+
label: Is there an existing issue for this?
|
10 |
+
description: Please search to see if an issue already exists for the feature you want, and that it's not implemented in a recent build/commit.
|
11 |
+
options:
|
12 |
+
- label: I have searched the existing issues and checked the recent builds/commits
|
13 |
+
required: true
|
14 |
+
- type: markdown
|
15 |
+
attributes:
|
16 |
+
value: |
|
17 |
+
*Please fill this form with as much information as possible, provide screenshots and/or illustrations of the feature if possible*
|
18 |
+
- type: textarea
|
19 |
+
id: feature
|
20 |
+
attributes:
|
21 |
+
label: What would your feature do ?
|
22 |
+
description: Tell us about your feature in a very clear and simple way, and what problem it would solve
|
23 |
+
validations:
|
24 |
+
required: true
|
25 |
+
- type: textarea
|
26 |
+
id: workflow
|
27 |
+
attributes:
|
28 |
+
label: Proposed workflow
|
29 |
+
description: Please provide us with step by step information on how you'd like the feature to be accessed and used
|
30 |
+
value: |
|
31 |
+
1. Go to ....
|
32 |
+
2. Press ....
|
33 |
+
3. ...
|
34 |
+
validations:
|
35 |
+
required: true
|
36 |
+
- type: textarea
|
37 |
+
id: misc
|
38 |
+
attributes:
|
39 |
+
label: Additional information
|
40 |
+
description: Add any other context or screenshots about the feature request here.
|
stable-diffusion-webui/.github/pull_request_template.md
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Description
|
2 |
+
|
3 |
+
* a simple description of what you're trying to accomplish
|
4 |
+
* a summary of changes in code
|
5 |
+
* which issues it fixes, if any
|
6 |
+
|
7 |
+
## Screenshots/videos:
|
8 |
+
|
9 |
+
|
10 |
+
## Checklist:
|
11 |
+
|
12 |
+
- [ ] I have read [contributing wiki page](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
|
13 |
+
- [ ] I have performed a self-review of my own code
|
14 |
+
- [ ] My code follows the [style guidelines](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing#code-style)
|
15 |
+
- [ ] My code passes [tests](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Tests)
|
stable-diffusion-webui/.gitignore
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__pycache__
|
2 |
+
*.ckpt
|
3 |
+
*.safetensors
|
4 |
+
*.pth
|
5 |
+
/ESRGAN/*
|
6 |
+
/SwinIR/*
|
7 |
+
/repositories
|
8 |
+
/venv
|
9 |
+
/tmp
|
10 |
+
/model.ckpt
|
11 |
+
/models/**/*
|
12 |
+
/GFPGANv1.3.pth
|
13 |
+
/gfpgan/weights/*.pth
|
14 |
+
/ui-config.json
|
15 |
+
/outputs
|
16 |
+
/config.json
|
17 |
+
/log
|
18 |
+
/webui.settings.bat
|
19 |
+
/embeddings
|
20 |
+
/styles.csv
|
21 |
+
/params.txt
|
22 |
+
/styles.csv.bak
|
23 |
+
/webui-user.bat
|
24 |
+
/webui-user.sh
|
25 |
+
/interrogate
|
26 |
+
/user.css
|
27 |
+
/.idea
|
28 |
+
notification.mp3
|
29 |
+
/SwinIR
|
30 |
+
/textual_inversion
|
31 |
+
.vscode
|
32 |
+
/extensions
|
33 |
+
/test/stdout.txt
|
34 |
+
/test/stderr.txt
|
35 |
+
/cache.json*
|
36 |
+
/config_states/
|
37 |
+
/node_modules
|
38 |
+
/package-lock.json
|
39 |
+
/.coverage*
|
stable-diffusion-webui/.pylintrc
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
# See https://pylint.pycqa.org/en/latest/user_guide/messages/message_control.html
|
2 |
+
[MESSAGES CONTROL]
|
3 |
+
disable=C,R,W,E,I
|
stable-diffusion-webui/CHANGELOG.md
ADDED
@@ -0,0 +1,507 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## 1.6.0
|
2 |
+
|
3 |
+
### Features:
|
4 |
+
* refiner support [#12371](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12371)
|
5 |
+
* add NV option for Random number generator source setting, which allows to generate same pictures on CPU/AMD/Mac as on NVidia videocards
|
6 |
+
* add style editor dialog
|
7 |
+
* hires fix: add an option to use a different checkpoint for second pass ([#12181](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12181))
|
8 |
+
* option to keep multiple loaded models in memory ([#12227](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12227))
|
9 |
+
* new samplers: Restart, DPM++ 2M SDE Exponential, DPM++ 2M SDE Heun, DPM++ 2M SDE Heun Karras, DPM++ 2M SDE Heun Exponential, DPM++ 3M SDE, DPM++ 3M SDE Karras, DPM++ 3M SDE Exponential ([#12300](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12300), [#12519](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12519), [#12542](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12542))
|
10 |
+
* rework DDIM, PLMS, UniPC to use CFG denoiser same as in k-diffusion samplers:
|
11 |
+
* makes all of them work with img2img
|
12 |
+
* makes prompt composition posssible (AND)
|
13 |
+
* makes them available for SDXL
|
14 |
+
* always show extra networks tabs in the UI ([#11808](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11808))
|
15 |
+
* use less RAM when creating models ([#11958](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11958), [#12599](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12599))
|
16 |
+
* textual inversion inference support for SDXL
|
17 |
+
* extra networks UI: show metadata for SD checkpoints
|
18 |
+
* checkpoint merger: add metadata support
|
19 |
+
* prompt editing and attention: add support for whitespace after the number ([ red : green : 0.5 ]) (seed breaking change) ([#12177](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12177))
|
20 |
+
* VAE: allow selecting own VAE for each checkpoint (in user metadata editor)
|
21 |
+
* VAE: add selected VAE to infotext
|
22 |
+
* options in main UI: add own separate setting for txt2img and img2img, correctly read values from pasted infotext, add setting for column count ([#12551](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12551))
|
23 |
+
* add resize handle to txt2img and img2img tabs, allowing to change the amount of horizontable space given to generation parameters and resulting image gallery ([#12687](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12687), [#12723](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12723))
|
24 |
+
* change default behavior for batching cond/uncond -- now it's on by default, and is disabled by an UI setting (Optimizatios -> Batch cond/uncond) - if you are on lowvram/medvram and are getting OOM exceptions, you will need to enable it
|
25 |
+
* show current position in queue and make it so that requests are processed in the order of arrival ([#12707](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12707))
|
26 |
+
* add `--medvram-sdxl` flag that only enables `--medvram` for SDXL models
|
27 |
+
* prompt editing timeline has separate range for first pass and hires-fix pass (seed breaking change) ([#12457](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12457))
|
28 |
+
|
29 |
+
### Minor:
|
30 |
+
* img2img batch: RAM savings, VRAM savings, .tif, .tiff in img2img batch ([#12120](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12120), [#12514](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12514), [#12515](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12515))
|
31 |
+
* postprocessing/extras: RAM savings ([#12479](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12479))
|
32 |
+
* XYZ: in the axis labels, remove pathnames from model filenames
|
33 |
+
* XYZ: support hires sampler ([#12298](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12298))
|
34 |
+
* XYZ: new option: use text inputs instead of dropdowns ([#12491](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12491))
|
35 |
+
* add gradio version warning
|
36 |
+
* sort list of VAE checkpoints ([#12297](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12297))
|
37 |
+
* use transparent white for mask in inpainting, along with an option to select the color ([#12326](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12326))
|
38 |
+
* move some settings to their own section: img2img, VAE
|
39 |
+
* add checkbox to show/hide dirs for extra networks
|
40 |
+
* Add TAESD(or more) options for all the VAE encode/decode operation ([#12311](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12311))
|
41 |
+
* gradio theme cache, new gradio themes, along with explanation that the user can input his own values ([#12346](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12346), [#12355](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12355))
|
42 |
+
* sampler fixes/tweaks: s_tmax, s_churn, s_noise, s_tmax ([#12354](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12354), [#12356](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12356), [#12357](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12357), [#12358](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12358), [#12375](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12375), [#12521](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12521))
|
43 |
+
* update README.md with correct instructions for Linux installation ([#12352](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12352))
|
44 |
+
* option to not save incomplete images, on by default ([#12338](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12338))
|
45 |
+
* enable cond cache by default
|
46 |
+
* git autofix for repos that are corrupted ([#12230](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12230))
|
47 |
+
* allow to open images in new browser tab by middle mouse button ([#12379](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12379))
|
48 |
+
* automatically open webui in browser when running "locally" ([#12254](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12254))
|
49 |
+
* put commonly used samplers on top, make DPM++ 2M Karras the default choice
|
50 |
+
* zoom and pan: option to auto-expand a wide image, improved integration ([#12413](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12413), [#12727](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12727))
|
51 |
+
* option to cache Lora networks in memory
|
52 |
+
* rework hires fix UI to use accordion
|
53 |
+
* face restoration and tiling moved to settings - use "Options in main UI" setting if you want them back
|
54 |
+
* change quicksettings items to have variable width
|
55 |
+
* Lora: add Norm module, add support for bias ([#12503](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12503))
|
56 |
+
* Lora: output warnings in UI rather than fail for unfitting loras; switch to logging for error output in console
|
57 |
+
* support search and display of hashes for all extra network items ([#12510](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12510))
|
58 |
+
* add extra noise param for img2img operations ([#12564](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12564))
|
59 |
+
* support for Lora with bias ([#12584](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12584))
|
60 |
+
* make interrupt quicker ([#12634](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12634))
|
61 |
+
* configurable gallery height ([#12648](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12648))
|
62 |
+
* make results column sticky ([#12645](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12645))
|
63 |
+
* more hash filename patterns ([#12639](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12639))
|
64 |
+
* make image viewer actually fit the whole page ([#12635](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12635))
|
65 |
+
* make progress bar work independently from live preview display which results in it being updated a lot more often
|
66 |
+
* forbid Full live preview method for medvram and add a setting to undo the forbidding
|
67 |
+
* make it possible to localize tooltips and placeholders
|
68 |
+
* add option to align with sgm repo's sampling implementation ([#12818](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12818))
|
69 |
+
* Restore faces and Tiling generation parameters have been moved to settings out of main UI
|
70 |
+
* if you want to put them back into main UI, use `Options in main UI` setting on the UI page.
|
71 |
+
|
72 |
+
### Extensions and API:
|
73 |
+
* gradio 3.41.2
|
74 |
+
* also bump versions for packages: transformers, GitPython, accelerate, scikit-image, timm, tomesd
|
75 |
+
* support tooltip kwarg for gradio elements: gr.Textbox(label='hello', tooltip='world')
|
76 |
+
* properly clear the total console progressbar when using txt2img and img2img from API
|
77 |
+
* add cmd_arg --disable-extra-extensions and --disable-all-extensions ([#12294](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12294))
|
78 |
+
* shared.py and webui.py split into many files
|
79 |
+
* add --loglevel commandline argument for logging
|
80 |
+
* add a custom UI element that combines accordion and checkbox
|
81 |
+
* avoid importing gradio in tests because it spams warnings
|
82 |
+
* put infotext label for setting into OptionInfo definition rather than in a separate list
|
83 |
+
* make `StableDiffusionProcessingImg2Img.mask_blur` a property, make more inline with PIL `GaussianBlur` ([#12470](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12470))
|
84 |
+
* option to make scripts UI without gr.Group
|
85 |
+
* add a way for scripts to register a callback for before/after just a single component's creation
|
86 |
+
* use dataclass for StableDiffusionProcessing
|
87 |
+
* store patches for Lora in a specialized module instead of inside torch
|
88 |
+
* support http/https URLs in API ([#12663](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12663), [#12698](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12698))
|
89 |
+
* add extra noise callback ([#12616](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12616))
|
90 |
+
* dump current stack traces when exiting with SIGINT
|
91 |
+
* add type annotations for extra fields of shared.sd_model
|
92 |
+
|
93 |
+
### Bug Fixes:
|
94 |
+
* Don't crash if out of local storage quota for javascriot localStorage
|
95 |
+
* XYZ plot do not fail if an exception occurs
|
96 |
+
* fix missing TI hash in infotext if generation uses both negative and positive TI ([#12269](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12269))
|
97 |
+
* localization fixes ([#12307](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12307))
|
98 |
+
* fix sdxl model invalid configuration after the hijack
|
99 |
+
* correctly toggle extras checkbox for infotext paste ([#12304](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12304))
|
100 |
+
* open raw sysinfo link in new page ([#12318](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12318))
|
101 |
+
* prompt parser: Account for empty field in alternating words syntax ([#12319](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12319))
|
102 |
+
* add tab and carriage return to invalid filename chars ([#12327](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12327))
|
103 |
+
* fix api only Lora not working ([#12387](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12387))
|
104 |
+
* fix options in main UI misbehaving when there's just one element
|
105 |
+
* make it possible to use a sampler from infotext even if it's hidden in the dropdown
|
106 |
+
* fix styles missing from the prompt in infotext when making a grid of batch of multiplie images
|
107 |
+
* prevent bogus progress output in console when calculating hires fix dimensions
|
108 |
+
* fix --use-textbox-seed
|
109 |
+
* fix broken `Lora/Networks: use old method` option ([#12466](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12466))
|
110 |
+
* properly return `None` for VAE hash when using `--no-hashing` ([#12463](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12463))
|
111 |
+
* MPS/macOS fixes and optimizations ([#12526](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12526))
|
112 |
+
* add second_order to samplers that mistakenly didn't have it
|
113 |
+
* when refreshing cards in extra networks UI, do not discard user's custom resolution
|
114 |
+
* fix processing error that happens if batch_size is not a multiple of how many prompts/negative prompts there are ([#12509](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12509))
|
115 |
+
* fix inpaint upload for alpha masks ([#12588](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12588))
|
116 |
+
* fix exception when image sizes are not integers ([#12586](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12586))
|
117 |
+
* fix incorrect TAESD Latent scale ([#12596](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12596))
|
118 |
+
* auto add data-dir to gradio-allowed-path ([#12603](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12603))
|
119 |
+
* fix exception if extensuions dir is missing ([#12607](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12607))
|
120 |
+
* fix issues with api model-refresh and vae-refresh ([#12638](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12638))
|
121 |
+
* fix img2img background color for transparent images option not being used ([#12633](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12633))
|
122 |
+
* attempt to resolve NaN issue with unstable VAEs in fp32 mk2 ([#12630](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12630))
|
123 |
+
* implement missing undo hijack for SDXL
|
124 |
+
* fix xyz swap axes ([#12684](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12684))
|
125 |
+
* fix errors in backup/restore tab if any of config files are broken ([#12689](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12689))
|
126 |
+
* fix SD VAE switch error after model reuse ([#12685](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12685))
|
127 |
+
* fix trying to create images too large for the chosen format ([#12667](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12667))
|
128 |
+
* create Gradio temp directory if necessary ([#12717](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12717))
|
129 |
+
* prevent possible cache loss if exiting as it's being written by using an atomic operation to replace the cache with the new version
|
130 |
+
* set devices.dtype_unet correctly
|
131 |
+
* run RealESRGAN on GPU for non-CUDA devices ([#12737](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12737))
|
132 |
+
* prevent extra network buttons being obscured by description for very small card sizes ([#12745](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12745))
|
133 |
+
* fix error that causes some extra networks to be disabled if both <lora:> and <lyco:> are present in the prompt
|
134 |
+
* fix defaults settings page breaking when any of main UI tabs are hidden
|
135 |
+
* fix incorrect save/display of new values in Defaults page in settings
|
136 |
+
* fix for Reload UI function: if you reload UI on one tab, other opened tabs will no longer stop working
|
137 |
+
* fix an error that prevents VAE being reloaded after an option change if a VAE near the checkpoint exists ([#12797](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12737))
|
138 |
+
* hide broken image crop tool ([#12792](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12737))
|
139 |
+
* don't show hidden samplers in dropdown for XYZ script ([#12780](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12737))
|
140 |
+
* fix style editing dialog breaking if it's opened in both img2img and txt2img tabs
|
141 |
+
* fix a bug allowing users to bypass gradio and API authentication (reported by vysecurity)
|
142 |
+
* fix notification not playing when built-in webui tab is inactive ([#12834](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12834))
|
143 |
+
* honor `--skip-install` for extension installers ([#12832](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12832))
|
144 |
+
* don't print blank stdout in extension installers ([#12833](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12832), [#12855](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12855))
|
145 |
+
* do not change quicksettings dropdown option when value returned is `None` ([#12854](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/12854))
|
146 |
+
* get progressbar to display correctly in extensions tab
|
147 |
+
|
148 |
+
|
149 |
+
## 1.5.2
|
150 |
+
|
151 |
+
### Bug Fixes:
|
152 |
+
* fix memory leak when generation fails
|
153 |
+
* update doggettx cross attention optimization to not use an unreasonable amount of memory in some edge cases -- suggestion by MorkTheOrk
|
154 |
+
|
155 |
+
|
156 |
+
## 1.5.1
|
157 |
+
|
158 |
+
### Minor:
|
159 |
+
* support parsing text encoder blocks in some new LoRAs
|
160 |
+
* delete scale checker script due to user demand
|
161 |
+
|
162 |
+
### Extensions and API:
|
163 |
+
* add postprocess_batch_list script callback
|
164 |
+
|
165 |
+
### Bug Fixes:
|
166 |
+
* fix TI training for SD1
|
167 |
+
* fix reload altclip model error
|
168 |
+
* prepend the pythonpath instead of overriding it
|
169 |
+
* fix typo in SD_WEBUI_RESTARTING
|
170 |
+
* if txt2img/img2img raises an exception, finally call state.end()
|
171 |
+
* fix composable diffusion weight parsing
|
172 |
+
* restyle Startup profile for black users
|
173 |
+
* fix webui not launching with --nowebui
|
174 |
+
* catch exception for non git extensions
|
175 |
+
* fix some options missing from /sdapi/v1/options
|
176 |
+
* fix for extension update status always saying "unknown"
|
177 |
+
* fix display of extra network cards that have `<>` in the name
|
178 |
+
* update lora extension to work with python 3.8
|
179 |
+
|
180 |
+
|
181 |
+
## 1.5.0
|
182 |
+
|
183 |
+
### Features:
|
184 |
+
* SD XL support
|
185 |
+
* user metadata system for custom networks
|
186 |
+
* extended Lora metadata editor: set activation text, default weight, view tags, training info
|
187 |
+
* Lora extension rework to include other types of networks (all that were previously handled by LyCORIS extension)
|
188 |
+
* show github stars for extenstions
|
189 |
+
* img2img batch mode can read extra stuff from png info
|
190 |
+
* img2img batch works with subdirectories
|
191 |
+
* hotkeys to move prompt elements: alt+left/right
|
192 |
+
* restyle time taken/VRAM display
|
193 |
+
* add textual inversion hashes to infotext
|
194 |
+
* optimization: cache git extension repo information
|
195 |
+
* move generate button next to the generated picture for mobile clients
|
196 |
+
* hide cards for networks of incompatible Stable Diffusion version in Lora extra networks interface
|
197 |
+
* skip installing packages with pip if they all are already installed - startup speedup of about 2 seconds
|
198 |
+
|
199 |
+
### Minor:
|
200 |
+
* checkbox to check/uncheck all extensions in the Installed tab
|
201 |
+
* add gradio user to infotext and to filename patterns
|
202 |
+
* allow gif for extra network previews
|
203 |
+
* add options to change colors in grid
|
204 |
+
* use natural sort for items in extra networks
|
205 |
+
* Mac: use empty_cache() from torch 2 to clear VRAM
|
206 |
+
* added automatic support for installing the right libraries for Navi3 (AMD)
|
207 |
+
* add option SWIN_torch_compile to accelerate SwinIR upscale
|
208 |
+
* suppress printing TI embedding info at start to console by default
|
209 |
+
* speedup extra networks listing
|
210 |
+
* added `[none]` filename token.
|
211 |
+
* removed thumbs extra networks view mode (use settings tab to change width/height/scale to get thumbs)
|
212 |
+
* add always_discard_next_to_last_sigma option to XYZ plot
|
213 |
+
* automatically switch to 32-bit float VAE if the generated picture has NaNs without the need for `--no-half-vae` commandline flag.
|
214 |
+
|
215 |
+
### Extensions and API:
|
216 |
+
* api endpoints: /sdapi/v1/server-kill, /sdapi/v1/server-restart, /sdapi/v1/server-stop
|
217 |
+
* allow Script to have custom metaclass
|
218 |
+
* add model exists status check /sdapi/v1/options
|
219 |
+
* rename --add-stop-route to --api-server-stop
|
220 |
+
* add `before_hr` script callback
|
221 |
+
* add callback `after_extra_networks_activate`
|
222 |
+
* disable rich exception output in console for API by default, use WEBUI_RICH_EXCEPTIONS env var to enable
|
223 |
+
* return http 404 when thumb file not found
|
224 |
+
* allow replacing extensions index with environment variable
|
225 |
+
|
226 |
+
### Bug Fixes:
|
227 |
+
* fix for catch errors when retrieving extension index #11290
|
228 |
+
* fix very slow loading speed of .safetensors files when reading from network drives
|
229 |
+
* API cache cleanup
|
230 |
+
* fix UnicodeEncodeError when writing to file CLIP Interrogator batch mode
|
231 |
+
* fix warning of 'has_mps' deprecated from PyTorch
|
232 |
+
* fix problem with extra network saving images as previews losing generation info
|
233 |
+
* fix throwing exception when trying to resize image with I;16 mode
|
234 |
+
* fix for #11534: canvas zoom and pan extension hijacking shortcut keys
|
235 |
+
* fixed launch script to be runnable from any directory
|
236 |
+
* don't add "Seed Resize: -1x-1" to API image metadata
|
237 |
+
* correctly remove end parenthesis with ctrl+up/down
|
238 |
+
* fixing --subpath on newer gradio version
|
239 |
+
* fix: check fill size none zero when resize (fixes #11425)
|
240 |
+
* use submit and blur for quick settings textbox
|
241 |
+
* save img2img batch with images.save_image()
|
242 |
+
* prevent running preload.py for disabled extensions
|
243 |
+
* fix: previously, model name was added together with directory name to infotext and to [model_name] filename pattern; directory name is now not included
|
244 |
+
|
245 |
+
|
246 |
+
## 1.4.1
|
247 |
+
|
248 |
+
### Bug Fixes:
|
249 |
+
* add queue lock for refresh-checkpoints
|
250 |
+
|
251 |
+
## 1.4.0
|
252 |
+
|
253 |
+
### Features:
|
254 |
+
* zoom controls for inpainting
|
255 |
+
* run basic torch calculation at startup in parallel to reduce the performance impact of first generation
|
256 |
+
* option to pad prompt/neg prompt to be same length
|
257 |
+
* remove taming_transformers dependency
|
258 |
+
* custom k-diffusion scheduler settings
|
259 |
+
* add an option to show selected settings in main txt2img/img2img UI
|
260 |
+
* sysinfo tab in settings
|
261 |
+
* infer styles from prompts when pasting params into the UI
|
262 |
+
* an option to control the behavior of the above
|
263 |
+
|
264 |
+
### Minor:
|
265 |
+
* bump Gradio to 3.32.0
|
266 |
+
* bump xformers to 0.0.20
|
267 |
+
* Add option to disable token counters
|
268 |
+
* tooltip fixes & optimizations
|
269 |
+
* make it possible to configure filename for the zip download
|
270 |
+
* `[vae_filename]` pattern for filenames
|
271 |
+
* Revert discarding penultimate sigma for DPM-Solver++(2M) SDE
|
272 |
+
* change UI reorder setting to multiselect
|
273 |
+
* read version info form CHANGELOG.md if git version info is not available
|
274 |
+
* link footer API to Wiki when API is not active
|
275 |
+
* persistent conds cache (opt-in optimization)
|
276 |
+
|
277 |
+
### Extensions:
|
278 |
+
* After installing extensions, webui properly restarts the process rather than reloads the UI
|
279 |
+
* Added VAE listing to web API. Via: /sdapi/v1/sd-vae
|
280 |
+
* custom unet support
|
281 |
+
* Add onAfterUiUpdate callback
|
282 |
+
* refactor EmbeddingDatabase.register_embedding() to allow unregistering
|
283 |
+
* add before_process callback for scripts
|
284 |
+
* add ability for alwayson scripts to specify section and let user reorder those sections
|
285 |
+
|
286 |
+
### Bug Fixes:
|
287 |
+
* Fix dragging text to prompt
|
288 |
+
* fix incorrect quoting for infotext values with colon in them
|
289 |
+
* fix "hires. fix" prompt sharing same labels with txt2img_prompt
|
290 |
+
* Fix s_min_uncond default type int
|
291 |
+
* Fix for #10643 (Inpainting mask sometimes not working)
|
292 |
+
* fix bad styling for thumbs view in extra networks #10639
|
293 |
+
* fix for empty list of optimizations #10605
|
294 |
+
* small fixes to prepare_tcmalloc for Debian/Ubuntu compatibility
|
295 |
+
* fix --ui-debug-mode exit
|
296 |
+
* patch GitPython to not use leaky persistent processes
|
297 |
+
* fix duplicate Cross attention optimization after UI reload
|
298 |
+
* torch.cuda.is_available() check for SdOptimizationXformers
|
299 |
+
* fix hires fix using wrong conds in second pass if using Loras.
|
300 |
+
* handle exception when parsing generation parameters from png info
|
301 |
+
* fix upcast attention dtype error
|
302 |
+
* forcing Torch Version to 1.13.1 for RX 5000 series GPUs
|
303 |
+
* split mask blur into X and Y components, patch Outpainting MK2 accordingly
|
304 |
+
* don't die when a LoRA is a broken symlink
|
305 |
+
* allow activation of Generate Forever during generation
|
306 |
+
|
307 |
+
|
308 |
+
## 1.3.2
|
309 |
+
|
310 |
+
### Bug Fixes:
|
311 |
+
* fix files served out of tmp directory even if they are saved to disk
|
312 |
+
* fix postprocessing overwriting parameters
|
313 |
+
|
314 |
+
## 1.3.1
|
315 |
+
|
316 |
+
### Features:
|
317 |
+
* revert default cross attention optimization to Doggettx
|
318 |
+
|
319 |
+
### Bug Fixes:
|
320 |
+
* fix bug: LoRA don't apply on dropdown list sd_lora
|
321 |
+
* fix png info always added even if setting is not enabled
|
322 |
+
* fix some fields not applying in xyz plot
|
323 |
+
* fix "hires. fix" prompt sharing same labels with txt2img_prompt
|
324 |
+
* fix lora hashes not being added properly to infotex if there is only one lora
|
325 |
+
* fix --use-cpu failing to work properly at startup
|
326 |
+
* make --disable-opt-split-attention command line option work again
|
327 |
+
|
328 |
+
## 1.3.0
|
329 |
+
|
330 |
+
### Features:
|
331 |
+
* add UI to edit defaults
|
332 |
+
* token merging (via dbolya/tomesd)
|
333 |
+
* settings tab rework: add a lot of additional explanations and links
|
334 |
+
* load extensions' Git metadata in parallel to loading the main program to save a ton of time during startup
|
335 |
+
* update extensions table: show branch, show date in separate column, and show version from tags if available
|
336 |
+
* TAESD - another option for cheap live previews
|
337 |
+
* allow choosing sampler and prompts for second pass of hires fix - hidden by default, enabled in settings
|
338 |
+
* calculate hashes for Lora
|
339 |
+
* add lora hashes to infotext
|
340 |
+
* when pasting infotext, use infotext's lora hashes to find local loras for `<lora:xxx:1>` entries whose hashes match loras the user has
|
341 |
+
* select cross attention optimization from UI
|
342 |
+
|
343 |
+
### Minor:
|
344 |
+
* bump Gradio to 3.31.0
|
345 |
+
* bump PyTorch to 2.0.1 for macOS and Linux AMD
|
346 |
+
* allow setting defaults for elements in extensions' tabs
|
347 |
+
* allow selecting file type for live previews
|
348 |
+
* show "Loading..." for extra networks when displaying for the first time
|
349 |
+
* suppress ENSD infotext for samplers that don't use it
|
350 |
+
* clientside optimizations
|
351 |
+
* add options to show/hide hidden files and dirs in extra networks, and to not list models/files in hidden directories
|
352 |
+
* allow whitespace in styles.csv
|
353 |
+
* add option to reorder tabs
|
354 |
+
* move some functionality (swap resolution and set seed to -1) to client
|
355 |
+
* option to specify editor height for img2img
|
356 |
+
* button to copy image resolution into img2img width/height sliders
|
357 |
+
* switch from pyngrok to ngrok-py
|
358 |
+
* lazy-load images in extra networks UI
|
359 |
+
* set "Navigate image viewer with gamepad" option to false by default, by request
|
360 |
+
* change upscalers to download models into user-specified directory (from commandline args) rather than the default models/<...>
|
361 |
+
* allow hiding buttons in ui-config.json
|
362 |
+
|
363 |
+
### Extensions:
|
364 |
+
* add /sdapi/v1/script-info api
|
365 |
+
* use Ruff to lint Python code
|
366 |
+
* use ESlint to lint Javascript code
|
367 |
+
* add/modify CFG callbacks for Self-Attention Guidance extension
|
368 |
+
* add command and endpoint for graceful server stopping
|
369 |
+
* add some locals (prompts/seeds/etc) from processing function into the Processing class as fields
|
370 |
+
* rework quoting for infotext items that have commas in them to use JSON (should be backwards compatible except for cases where it didn't work previously)
|
371 |
+
* add /sdapi/v1/refresh-loras api checkpoint post request
|
372 |
+
* tests overhaul
|
373 |
+
|
374 |
+
### Bug Fixes:
|
375 |
+
* fix an issue preventing the program from starting if the user specifies a bad Gradio theme
|
376 |
+
* fix broken prompts from file script
|
377 |
+
* fix symlink scanning for extra networks
|
378 |
+
* fix --data-dir ignored when launching via webui-user.bat COMMANDLINE_ARGS
|
379 |
+
* allow web UI to be ran fully offline
|
380 |
+
* fix inability to run with --freeze-settings
|
381 |
+
* fix inability to merge checkpoint without adding metadata
|
382 |
+
* fix extra networks' save preview image not adding infotext for jpeg/webm
|
383 |
+
* remove blinking effect from text in hires fix and scale resolution preview
|
384 |
+
* make links to `http://<...>.git` extensions work in the extension tab
|
385 |
+
* fix bug with webui hanging at startup due to hanging git process
|
386 |
+
|
387 |
+
|
388 |
+
## 1.2.1
|
389 |
+
|
390 |
+
### Features:
|
391 |
+
* add an option to always refer to LoRA by filenames
|
392 |
+
|
393 |
+
### Bug Fixes:
|
394 |
+
* never refer to LoRA by an alias if multiple LoRAs have same alias or the alias is called none
|
395 |
+
* fix upscalers disappearing after the user reloads UI
|
396 |
+
* allow bf16 in safe unpickler (resolves problems with loading some LoRAs)
|
397 |
+
* allow web UI to be ran fully offline
|
398 |
+
* fix localizations not working
|
399 |
+
* fix error for LoRAs: `'LatentDiffusion' object has no attribute 'lora_layer_mapping'`
|
400 |
+
|
401 |
+
## 1.2.0
|
402 |
+
|
403 |
+
### Features:
|
404 |
+
* do not wait for Stable Diffusion model to load at startup
|
405 |
+
* add filename patterns: `[denoising]`
|
406 |
+
* directory hiding for extra networks: dirs starting with `.` will hide their cards on extra network tabs unless specifically searched for
|
407 |
+
* LoRA: for the `<...>` text in prompt, use name of LoRA that is in the metdata of the file, if present, instead of filename (both can be used to activate LoRA)
|
408 |
+
* LoRA: read infotext params from kohya-ss's extension parameters if they are present and if his extension is not active
|
409 |
+
* LoRA: fix some LoRAs not working (ones that have 3x3 convolution layer)
|
410 |
+
* LoRA: add an option to use old method of applying LoRAs (producing same results as with kohya-ss)
|
411 |
+
* add version to infotext, footer and console output when starting
|
412 |
+
* add links to wiki for filename pattern settings
|
413 |
+
* add extended info for quicksettings setting and use multiselect input instead of a text field
|
414 |
+
|
415 |
+
### Minor:
|
416 |
+
* bump Gradio to 3.29.0
|
417 |
+
* bump PyTorch to 2.0.1
|
418 |
+
* `--subpath` option for gradio for use with reverse proxy
|
419 |
+
* Linux/macOS: use existing virtualenv if already active (the VIRTUAL_ENV environment variable)
|
420 |
+
* do not apply localizations if there are none (possible frontend optimization)
|
421 |
+
* add extra `None` option for VAE in XYZ plot
|
422 |
+
* print error to console when batch processing in img2img fails
|
423 |
+
* create HTML for extra network pages only on demand
|
424 |
+
* allow directories starting with `.` to still list their models for LoRA, checkpoints, etc
|
425 |
+
* put infotext options into their own category in settings tab
|
426 |
+
* do not show licenses page when user selects Show all pages in settings
|
427 |
+
|
428 |
+
### Extensions:
|
429 |
+
* tooltip localization support
|
430 |
+
* add API method to get LoRA models with prompt
|
431 |
+
|
432 |
+
### Bug Fixes:
|
433 |
+
* re-add `/docs` endpoint
|
434 |
+
* fix gamepad navigation
|
435 |
+
* make the lightbox fullscreen image function properly
|
436 |
+
* fix squished thumbnails in extras tab
|
437 |
+
* keep "search" filter for extra networks when user refreshes the tab (previously it showed everthing after you refreshed)
|
438 |
+
* fix webui showing the same image if you configure the generation to always save results into same file
|
439 |
+
* fix bug with upscalers not working properly
|
440 |
+
* fix MPS on PyTorch 2.0.1, Intel Macs
|
441 |
+
* make it so that custom context menu from contextMenu.js only disappears after user's click, ignoring non-user click events
|
442 |
+
* prevent Reload UI button/link from reloading the page when it's not yet ready
|
443 |
+
* fix prompts from file script failing to read contents from a drag/drop file
|
444 |
+
|
445 |
+
|
446 |
+
## 1.1.1
|
447 |
+
### Bug Fixes:
|
448 |
+
* fix an error that prevents running webui on PyTorch<2.0 without --disable-safe-unpickle
|
449 |
+
|
450 |
+
## 1.1.0
|
451 |
+
### Features:
|
452 |
+
* switch to PyTorch 2.0.0 (except for AMD GPUs)
|
453 |
+
* visual improvements to custom code scripts
|
454 |
+
* add filename patterns: `[clip_skip]`, `[hasprompt<>]`, `[batch_number]`, `[generation_number]`
|
455 |
+
* add support for saving init images in img2img, and record their hashes in infotext for reproducability
|
456 |
+
* automatically select current word when adjusting weight with ctrl+up/down
|
457 |
+
* add dropdowns for X/Y/Z plot
|
458 |
+
* add setting: Stable Diffusion/Random number generator source: makes it possible to make images generated from a given manual seed consistent across different GPUs
|
459 |
+
* support Gradio's theme API
|
460 |
+
* use TCMalloc on Linux by default; possible fix for memory leaks
|
461 |
+
* add optimization option to remove negative conditioning at low sigma values #9177
|
462 |
+
* embed model merge metadata in .safetensors file
|
463 |
+
* extension settings backup/restore feature #9169
|
464 |
+
* add "resize by" and "resize to" tabs to img2img
|
465 |
+
* add option "keep original size" to textual inversion images preprocess
|
466 |
+
* image viewer scrolling via analog stick
|
467 |
+
* button to restore the progress from session lost / tab reload
|
468 |
+
|
469 |
+
### Minor:
|
470 |
+
* bump Gradio to 3.28.1
|
471 |
+
* change "scale to" to sliders in Extras tab
|
472 |
+
* add labels to tool buttons to make it possible to hide them
|
473 |
+
* add tiled inference support for ScuNET
|
474 |
+
* add branch support for extension installation
|
475 |
+
* change Linux installation script to install into current directory rather than `/home/username`
|
476 |
+
* sort textual inversion embeddings by name (case-insensitive)
|
477 |
+
* allow styles.csv to be symlinked or mounted in docker
|
478 |
+
* remove the "do not add watermark to images" option
|
479 |
+
* make selected tab configurable with UI config
|
480 |
+
* make the extra networks UI fixed height and scrollable
|
481 |
+
* add `disable_tls_verify` arg for use with self-signed certs
|
482 |
+
|
483 |
+
### Extensions:
|
484 |
+
* add reload callback
|
485 |
+
* add `is_hr_pass` field for processing
|
486 |
+
|
487 |
+
### Bug Fixes:
|
488 |
+
* fix broken batch image processing on 'Extras/Batch Process' tab
|
489 |
+
* add "None" option to extra networks dropdowns
|
490 |
+
* fix FileExistsError for CLIP Interrogator
|
491 |
+
* fix /sdapi/v1/txt2img endpoint not working on Linux #9319
|
492 |
+
* fix disappearing live previews and progressbar during slow tasks
|
493 |
+
* fix fullscreen image view not working properly in some cases
|
494 |
+
* prevent alwayson_scripts args param resizing script_arg list when they are inserted in it
|
495 |
+
* fix prompt schedule for second order samplers
|
496 |
+
* fix image mask/composite for weird resolutions #9628
|
497 |
+
* use correct images for previews when using AND (see #9491)
|
498 |
+
* one broken image in img2img batch won't stop all processing
|
499 |
+
* fix image orientation bug in train/preprocess
|
500 |
+
* fix Ngrok recreating tunnels every reload
|
501 |
+
* fix `--realesrgan-models-path` and `--ldsr-models-path` not working
|
502 |
+
* fix `--skip-install` not working
|
503 |
+
* use SAMPLE file format in Outpainting Mk2 & Poorman
|
504 |
+
* do not fail all LoRAs if some have failed to load when making a picture
|
505 |
+
|
506 |
+
## 1.0.0
|
507 |
+
* everything
|
stable-diffusion-webui/CITATION.cff
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
cff-version: 1.2.0
|
2 |
+
message: "If you use this software, please cite it as below."
|
3 |
+
authors:
|
4 |
+
- given-names: AUTOMATIC1111
|
5 |
+
title: "Stable Diffusion Web UI"
|
6 |
+
date-released: 2022-08-22
|
7 |
+
url: "https://github.com/AUTOMATIC1111/stable-diffusion-webui"
|
stable-diffusion-webui/CODEOWNERS
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
* @AUTOMATIC1111
|
2 |
+
|
3 |
+
# if you were managing a localization and were removed from this file, this is because
|
4 |
+
# the intended way to do localizations now is via extensions. See:
|
5 |
+
# https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions
|
6 |
+
# Make a repo with your localization and since you are still listed as a collaborator
|
7 |
+
# you can add it to the wiki page yourself. This change is because some people complained
|
8 |
+
# the git commit log is cluttered with things unrelated to almost everyone and
|
9 |
+
# because I believe this is the best overall for the project to handle localizations almost
|
10 |
+
# entirely without my oversight.
|
11 |
+
|
12 |
+
|
stable-diffusion-webui/LICENSE.txt
ADDED
@@ -0,0 +1,663 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 19 November 2007
|
3 |
+
|
4 |
+
Copyright (c) 2023 AUTOMATIC1111
|
5 |
+
|
6 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
7 |
+
Everyone is permitted to copy and distribute verbatim copies
|
8 |
+
of this license document, but changing it is not allowed.
|
9 |
+
|
10 |
+
Preamble
|
11 |
+
|
12 |
+
The GNU Affero General Public License is a free, copyleft license for
|
13 |
+
software and other kinds of works, specifically designed to ensure
|
14 |
+
cooperation with the community in the case of network server software.
|
15 |
+
|
16 |
+
The licenses for most software and other practical works are designed
|
17 |
+
to take away your freedom to share and change the works. By contrast,
|
18 |
+
our General Public Licenses are intended to guarantee your freedom to
|
19 |
+
share and change all versions of a program--to make sure it remains free
|
20 |
+
software for all its users.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
Developers that use our General Public Licenses protect your rights
|
30 |
+
with two steps: (1) assert copyright on the software, and (2) offer
|
31 |
+
you this License which gives you legal permission to copy, distribute
|
32 |
+
and/or modify the software.
|
33 |
+
|
34 |
+
A secondary benefit of defending all users' freedom is that
|
35 |
+
improvements made in alternate versions of the program, if they
|
36 |
+
receive widespread use, become available for other developers to
|
37 |
+
incorporate. Many developers of free software are heartened and
|
38 |
+
encouraged by the resulting cooperation. However, in the case of
|
39 |
+
software used on network servers, this result may fail to come about.
|
40 |
+
The GNU General Public License permits making a modified version and
|
41 |
+
letting the public access it on a server without ever releasing its
|
42 |
+
source code to the public.
|
43 |
+
|
44 |
+
The GNU Affero General Public License is designed specifically to
|
45 |
+
ensure that, in such cases, the modified source code becomes available
|
46 |
+
to the community. It requires the operator of a network server to
|
47 |
+
provide the source code of the modified version running there to the
|
48 |
+
users of that server. Therefore, public use of a modified version, on
|
49 |
+
a publicly accessible server, gives the public access to the source
|
50 |
+
code of the modified version.
|
51 |
+
|
52 |
+
An older license, called the Affero General Public License and
|
53 |
+
published by Affero, was designed to accomplish similar goals. This is
|
54 |
+
a different license, not a version of the Affero GPL, but Affero has
|
55 |
+
released a new version of the Affero GPL which permits relicensing under
|
56 |
+
this license.
|
57 |
+
|
58 |
+
The precise terms and conditions for copying, distribution and
|
59 |
+
modification follow.
|
60 |
+
|
61 |
+
TERMS AND CONDITIONS
|
62 |
+
|
63 |
+
0. Definitions.
|
64 |
+
|
65 |
+
"This License" refers to version 3 of the GNU Affero General Public License.
|
66 |
+
|
67 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
68 |
+
works, such as semiconductor masks.
|
69 |
+
|
70 |
+
"The Program" refers to any copyrightable work licensed under this
|
71 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
72 |
+
"recipients" may be individuals or organizations.
|
73 |
+
|
74 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
75 |
+
in a fashion requiring copyright permission, other than the making of an
|
76 |
+
exact copy. The resulting work is called a "modified version" of the
|
77 |
+
earlier work or a work "based on" the earlier work.
|
78 |
+
|
79 |
+
A "covered work" means either the unmodified Program or a work based
|
80 |
+
on the Program.
|
81 |
+
|
82 |
+
To "propagate" a work means to do anything with it that, without
|
83 |
+
permission, would make you directly or secondarily liable for
|
84 |
+
infringement under applicable copyright law, except executing it on a
|
85 |
+
computer or modifying a private copy. Propagation includes copying,
|
86 |
+
distribution (with or without modification), making available to the
|
87 |
+
public, and in some countries other activities as well.
|
88 |
+
|
89 |
+
To "convey" a work means any kind of propagation that enables other
|
90 |
+
parties to make or receive copies. Mere interaction with a user through
|
91 |
+
a computer network, with no transfer of a copy, is not conveying.
|
92 |
+
|
93 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
94 |
+
to the extent that it includes a convenient and prominently visible
|
95 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
96 |
+
tells the user that there is no warranty for the work (except to the
|
97 |
+
extent that warranties are provided), that licensees may convey the
|
98 |
+
work under this License, and how to view a copy of this License. If
|
99 |
+
the interface presents a list of user commands or options, such as a
|
100 |
+
menu, a prominent item in the list meets this criterion.
|
101 |
+
|
102 |
+
1. Source Code.
|
103 |
+
|
104 |
+
The "source code" for a work means the preferred form of the work
|
105 |
+
for making modifications to it. "Object code" means any non-source
|
106 |
+
form of a work.
|
107 |
+
|
108 |
+
A "Standard Interface" means an interface that either is an official
|
109 |
+
standard defined by a recognized standards body, or, in the case of
|
110 |
+
interfaces specified for a particular programming language, one that
|
111 |
+
is widely used among developers working in that language.
|
112 |
+
|
113 |
+
The "System Libraries" of an executable work include anything, other
|
114 |
+
than the work as a whole, that (a) is included in the normal form of
|
115 |
+
packaging a Major Component, but which is not part of that Major
|
116 |
+
Component, and (b) serves only to enable use of the work with that
|
117 |
+
Major Component, or to implement a Standard Interface for which an
|
118 |
+
implementation is available to the public in source code form. A
|
119 |
+
"Major Component", in this context, means a major essential component
|
120 |
+
(kernel, window system, and so on) of the specific operating system
|
121 |
+
(if any) on which the executable work runs, or a compiler used to
|
122 |
+
produce the work, or an object code interpreter used to run it.
|
123 |
+
|
124 |
+
The "Corresponding Source" for a work in object code form means all
|
125 |
+
the source code needed to generate, install, and (for an executable
|
126 |
+
work) run the object code and to modify the work, including scripts to
|
127 |
+
control those activities. However, it does not include the work's
|
128 |
+
System Libraries, or general-purpose tools or generally available free
|
129 |
+
programs which are used unmodified in performing those activities but
|
130 |
+
which are not part of the work. For example, Corresponding Source
|
131 |
+
includes interface definition files associated with source files for
|
132 |
+
the work, and the source code for shared libraries and dynamically
|
133 |
+
linked subprograms that the work is specifically designed to require,
|
134 |
+
such as by intimate data communication or control flow between those
|
135 |
+
subprograms and other parts of the work.
|
136 |
+
|
137 |
+
The Corresponding Source need not include anything that users
|
138 |
+
can regenerate automatically from other parts of the Corresponding
|
139 |
+
Source.
|
140 |
+
|
141 |
+
The Corresponding Source for a work in source code form is that
|
142 |
+
same work.
|
143 |
+
|
144 |
+
2. Basic Permissions.
|
145 |
+
|
146 |
+
All rights granted under this License are granted for the term of
|
147 |
+
copyright on the Program, and are irrevocable provided the stated
|
148 |
+
conditions are met. This License explicitly affirms your unlimited
|
149 |
+
permission to run the unmodified Program. The output from running a
|
150 |
+
covered work is covered by this License only if the output, given its
|
151 |
+
content, constitutes a covered work. This License acknowledges your
|
152 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
153 |
+
|
154 |
+
You may make, run and propagate covered works that you do not
|
155 |
+
convey, without conditions so long as your license otherwise remains
|
156 |
+
in force. You may convey covered works to others for the sole purpose
|
157 |
+
of having them make modifications exclusively for you, or provide you
|
158 |
+
with facilities for running those works, provided that you comply with
|
159 |
+
the terms of this License in conveying all material for which you do
|
160 |
+
not control copyright. Those thus making or running the covered works
|
161 |
+
for you must do so exclusively on your behalf, under your direction
|
162 |
+
and control, on terms that prohibit them from making any copies of
|
163 |
+
your copyrighted material outside their relationship with you.
|
164 |
+
|
165 |
+
Conveying under any other circumstances is permitted solely under
|
166 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
167 |
+
makes it unnecessary.
|
168 |
+
|
169 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
170 |
+
|
171 |
+
No covered work shall be deemed part of an effective technological
|
172 |
+
measure under any applicable law fulfilling obligations under article
|
173 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
174 |
+
similar laws prohibiting or restricting circumvention of such
|
175 |
+
measures.
|
176 |
+
|
177 |
+
When you convey a covered work, you waive any legal power to forbid
|
178 |
+
circumvention of technological measures to the extent such circumvention
|
179 |
+
is effected by exercising rights under this License with respect to
|
180 |
+
the covered work, and you disclaim any intention to limit operation or
|
181 |
+
modification of the work as a means of enforcing, against the work's
|
182 |
+
users, your or third parties' legal rights to forbid circumvention of
|
183 |
+
technological measures.
|
184 |
+
|
185 |
+
4. Conveying Verbatim Copies.
|
186 |
+
|
187 |
+
You may convey verbatim copies of the Program's source code as you
|
188 |
+
receive it, in any medium, provided that you conspicuously and
|
189 |
+
appropriately publish on each copy an appropriate copyright notice;
|
190 |
+
keep intact all notices stating that this License and any
|
191 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
192 |
+
keep intact all notices of the absence of any warranty; and give all
|
193 |
+
recipients a copy of this License along with the Program.
|
194 |
+
|
195 |
+
You may charge any price or no price for each copy that you convey,
|
196 |
+
and you may offer support or warranty protection for a fee.
|
197 |
+
|
198 |
+
5. Conveying Modified Source Versions.
|
199 |
+
|
200 |
+
You may convey a work based on the Program, or the modifications to
|
201 |
+
produce it from the Program, in the form of source code under the
|
202 |
+
terms of section 4, provided that you also meet all of these conditions:
|
203 |
+
|
204 |
+
a) The work must carry prominent notices stating that you modified
|
205 |
+
it, and giving a relevant date.
|
206 |
+
|
207 |
+
b) The work must carry prominent notices stating that it is
|
208 |
+
released under this License and any conditions added under section
|
209 |
+
7. This requirement modifies the requirement in section 4 to
|
210 |
+
"keep intact all notices".
|
211 |
+
|
212 |
+
c) You must license the entire work, as a whole, under this
|
213 |
+
License to anyone who comes into possession of a copy. This
|
214 |
+
License will therefore apply, along with any applicable section 7
|
215 |
+
additional terms, to the whole of the work, and all its parts,
|
216 |
+
regardless of how they are packaged. This License gives no
|
217 |
+
permission to license the work in any other way, but it does not
|
218 |
+
invalidate such permission if you have separately received it.
|
219 |
+
|
220 |
+
d) If the work has interactive user interfaces, each must display
|
221 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
222 |
+
interfaces that do not display Appropriate Legal Notices, your
|
223 |
+
work need not make them do so.
|
224 |
+
|
225 |
+
A compilation of a covered work with other separate and independent
|
226 |
+
works, which are not by their nature extensions of the covered work,
|
227 |
+
and which are not combined with it such as to form a larger program,
|
228 |
+
in or on a volume of a storage or distribution medium, is called an
|
229 |
+
"aggregate" if the compilation and its resulting copyright are not
|
230 |
+
used to limit the access or legal rights of the compilation's users
|
231 |
+
beyond what the individual works permit. Inclusion of a covered work
|
232 |
+
in an aggregate does not cause this License to apply to the other
|
233 |
+
parts of the aggregate.
|
234 |
+
|
235 |
+
6. Conveying Non-Source Forms.
|
236 |
+
|
237 |
+
You may convey a covered work in object code form under the terms
|
238 |
+
of sections 4 and 5, provided that you also convey the
|
239 |
+
machine-readable Corresponding Source under the terms of this License,
|
240 |
+
in one of these ways:
|
241 |
+
|
242 |
+
a) Convey the object code in, or embodied in, a physical product
|
243 |
+
(including a physical distribution medium), accompanied by the
|
244 |
+
Corresponding Source fixed on a durable physical medium
|
245 |
+
customarily used for software interchange.
|
246 |
+
|
247 |
+
b) Convey the object code in, or embodied in, a physical product
|
248 |
+
(including a physical distribution medium), accompanied by a
|
249 |
+
written offer, valid for at least three years and valid for as
|
250 |
+
long as you offer spare parts or customer support for that product
|
251 |
+
model, to give anyone who possesses the object code either (1) a
|
252 |
+
copy of the Corresponding Source for all the software in the
|
253 |
+
product that is covered by this License, on a durable physical
|
254 |
+
medium customarily used for software interchange, for a price no
|
255 |
+
more than your reasonable cost of physically performing this
|
256 |
+
conveying of source, or (2) access to copy the
|
257 |
+
Corresponding Source from a network server at no charge.
|
258 |
+
|
259 |
+
c) Convey individual copies of the object code with a copy of the
|
260 |
+
written offer to provide the Corresponding Source. This
|
261 |
+
alternative is allowed only occasionally and noncommercially, and
|
262 |
+
only if you received the object code with such an offer, in accord
|
263 |
+
with subsection 6b.
|
264 |
+
|
265 |
+
d) Convey the object code by offering access from a designated
|
266 |
+
place (gratis or for a charge), and offer equivalent access to the
|
267 |
+
Corresponding Source in the same way through the same place at no
|
268 |
+
further charge. You need not require recipients to copy the
|
269 |
+
Corresponding Source along with the object code. If the place to
|
270 |
+
copy the object code is a network server, the Corresponding Source
|
271 |
+
may be on a different server (operated by you or a third party)
|
272 |
+
that supports equivalent copying facilities, provided you maintain
|
273 |
+
clear directions next to the object code saying where to find the
|
274 |
+
Corresponding Source. Regardless of what server hosts the
|
275 |
+
Corresponding Source, you remain obligated to ensure that it is
|
276 |
+
available for as long as needed to satisfy these requirements.
|
277 |
+
|
278 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
279 |
+
you inform other peers where the object code and Corresponding
|
280 |
+
Source of the work are being offered to the general public at no
|
281 |
+
charge under subsection 6d.
|
282 |
+
|
283 |
+
A separable portion of the object code, whose source code is excluded
|
284 |
+
from the Corresponding Source as a System Library, need not be
|
285 |
+
included in conveying the object code work.
|
286 |
+
|
287 |
+
A "User Product" is either (1) a "consumer product", which means any
|
288 |
+
tangible personal property which is normally used for personal, family,
|
289 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
290 |
+
into a dwelling. In determining whether a product is a consumer product,
|
291 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
292 |
+
product received by a particular user, "normally used" refers to a
|
293 |
+
typical or common use of that class of product, regardless of the status
|
294 |
+
of the particular user or of the way in which the particular user
|
295 |
+
actually uses, or expects or is expected to use, the product. A product
|
296 |
+
is a consumer product regardless of whether the product has substantial
|
297 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
298 |
+
the only significant mode of use of the product.
|
299 |
+
|
300 |
+
"Installation Information" for a User Product means any methods,
|
301 |
+
procedures, authorization keys, or other information required to install
|
302 |
+
and execute modified versions of a covered work in that User Product from
|
303 |
+
a modified version of its Corresponding Source. The information must
|
304 |
+
suffice to ensure that the continued functioning of the modified object
|
305 |
+
code is in no case prevented or interfered with solely because
|
306 |
+
modification has been made.
|
307 |
+
|
308 |
+
If you convey an object code work under this section in, or with, or
|
309 |
+
specifically for use in, a User Product, and the conveying occurs as
|
310 |
+
part of a transaction in which the right of possession and use of the
|
311 |
+
User Product is transferred to the recipient in perpetuity or for a
|
312 |
+
fixed term (regardless of how the transaction is characterized), the
|
313 |
+
Corresponding Source conveyed under this section must be accompanied
|
314 |
+
by the Installation Information. But this requirement does not apply
|
315 |
+
if neither you nor any third party retains the ability to install
|
316 |
+
modified object code on the User Product (for example, the work has
|
317 |
+
been installed in ROM).
|
318 |
+
|
319 |
+
The requirement to provide Installation Information does not include a
|
320 |
+
requirement to continue to provide support service, warranty, or updates
|
321 |
+
for a work that has been modified or installed by the recipient, or for
|
322 |
+
the User Product in which it has been modified or installed. Access to a
|
323 |
+
network may be denied when the modification itself materially and
|
324 |
+
adversely affects the operation of the network or violates the rules and
|
325 |
+
protocols for communication across the network.
|
326 |
+
|
327 |
+
Corresponding Source conveyed, and Installation Information provided,
|
328 |
+
in accord with this section must be in a format that is publicly
|
329 |
+
documented (and with an implementation available to the public in
|
330 |
+
source code form), and must require no special password or key for
|
331 |
+
unpacking, reading or copying.
|
332 |
+
|
333 |
+
7. Additional Terms.
|
334 |
+
|
335 |
+
"Additional permissions" are terms that supplement the terms of this
|
336 |
+
License by making exceptions from one or more of its conditions.
|
337 |
+
Additional permissions that are applicable to the entire Program shall
|
338 |
+
be treated as though they were included in this License, to the extent
|
339 |
+
that they are valid under applicable law. If additional permissions
|
340 |
+
apply only to part of the Program, that part may be used separately
|
341 |
+
under those permissions, but the entire Program remains governed by
|
342 |
+
this License without regard to the additional permissions.
|
343 |
+
|
344 |
+
When you convey a copy of a covered work, you may at your option
|
345 |
+
remove any additional permissions from that copy, or from any part of
|
346 |
+
it. (Additional permissions may be written to require their own
|
347 |
+
removal in certain cases when you modify the work.) You may place
|
348 |
+
additional permissions on material, added by you to a covered work,
|
349 |
+
for which you have or can give appropriate copyright permission.
|
350 |
+
|
351 |
+
Notwithstanding any other provision of this License, for material you
|
352 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
353 |
+
that material) supplement the terms of this License with terms:
|
354 |
+
|
355 |
+
a) Disclaiming warranty or limiting liability differently from the
|
356 |
+
terms of sections 15 and 16 of this License; or
|
357 |
+
|
358 |
+
b) Requiring preservation of specified reasonable legal notices or
|
359 |
+
author attributions in that material or in the Appropriate Legal
|
360 |
+
Notices displayed by works containing it; or
|
361 |
+
|
362 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
363 |
+
requiring that modified versions of such material be marked in
|
364 |
+
reasonable ways as different from the original version; or
|
365 |
+
|
366 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
367 |
+
authors of the material; or
|
368 |
+
|
369 |
+
e) Declining to grant rights under trademark law for use of some
|
370 |
+
trade names, trademarks, or service marks; or
|
371 |
+
|
372 |
+
f) Requiring indemnification of licensors and authors of that
|
373 |
+
material by anyone who conveys the material (or modified versions of
|
374 |
+
it) with contractual assumptions of liability to the recipient, for
|
375 |
+
any liability that these contractual assumptions directly impose on
|
376 |
+
those licensors and authors.
|
377 |
+
|
378 |
+
All other non-permissive additional terms are considered "further
|
379 |
+
restrictions" within the meaning of section 10. If the Program as you
|
380 |
+
received it, or any part of it, contains a notice stating that it is
|
381 |
+
governed by this License along with a term that is a further
|
382 |
+
restriction, you may remove that term. If a license document contains
|
383 |
+
a further restriction but permits relicensing or conveying under this
|
384 |
+
License, you may add to a covered work material governed by the terms
|
385 |
+
of that license document, provided that the further restriction does
|
386 |
+
not survive such relicensing or conveying.
|
387 |
+
|
388 |
+
If you add terms to a covered work in accord with this section, you
|
389 |
+
must place, in the relevant source files, a statement of the
|
390 |
+
additional terms that apply to those files, or a notice indicating
|
391 |
+
where to find the applicable terms.
|
392 |
+
|
393 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
394 |
+
form of a separately written license, or stated as exceptions;
|
395 |
+
the above requirements apply either way.
|
396 |
+
|
397 |
+
8. Termination.
|
398 |
+
|
399 |
+
You may not propagate or modify a covered work except as expressly
|
400 |
+
provided under this License. Any attempt otherwise to propagate or
|
401 |
+
modify it is void, and will automatically terminate your rights under
|
402 |
+
this License (including any patent licenses granted under the third
|
403 |
+
paragraph of section 11).
|
404 |
+
|
405 |
+
However, if you cease all violation of this License, then your
|
406 |
+
license from a particular copyright holder is reinstated (a)
|
407 |
+
provisionally, unless and until the copyright holder explicitly and
|
408 |
+
finally terminates your license, and (b) permanently, if the copyright
|
409 |
+
holder fails to notify you of the violation by some reasonable means
|
410 |
+
prior to 60 days after the cessation.
|
411 |
+
|
412 |
+
Moreover, your license from a particular copyright holder is
|
413 |
+
reinstated permanently if the copyright holder notifies you of the
|
414 |
+
violation by some reasonable means, this is the first time you have
|
415 |
+
received notice of violation of this License (for any work) from that
|
416 |
+
copyright holder, and you cure the violation prior to 30 days after
|
417 |
+
your receipt of the notice.
|
418 |
+
|
419 |
+
Termination of your rights under this section does not terminate the
|
420 |
+
licenses of parties who have received copies or rights from you under
|
421 |
+
this License. If your rights have been terminated and not permanently
|
422 |
+
reinstated, you do not qualify to receive new licenses for the same
|
423 |
+
material under section 10.
|
424 |
+
|
425 |
+
9. Acceptance Not Required for Having Copies.
|
426 |
+
|
427 |
+
You are not required to accept this License in order to receive or
|
428 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
429 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
430 |
+
to receive a copy likewise does not require acceptance. However,
|
431 |
+
nothing other than this License grants you permission to propagate or
|
432 |
+
modify any covered work. These actions infringe copyright if you do
|
433 |
+
not accept this License. Therefore, by modifying or propagating a
|
434 |
+
covered work, you indicate your acceptance of this License to do so.
|
435 |
+
|
436 |
+
10. Automatic Licensing of Downstream Recipients.
|
437 |
+
|
438 |
+
Each time you convey a covered work, the recipient automatically
|
439 |
+
receives a license from the original licensors, to run, modify and
|
440 |
+
propagate that work, subject to this License. You are not responsible
|
441 |
+
for enforcing compliance by third parties with this License.
|
442 |
+
|
443 |
+
An "entity transaction" is a transaction transferring control of an
|
444 |
+
organization, or substantially all assets of one, or subdividing an
|
445 |
+
organization, or merging organizations. If propagation of a covered
|
446 |
+
work results from an entity transaction, each party to that
|
447 |
+
transaction who receives a copy of the work also receives whatever
|
448 |
+
licenses to the work the party's predecessor in interest had or could
|
449 |
+
give under the previous paragraph, plus a right to possession of the
|
450 |
+
Corresponding Source of the work from the predecessor in interest, if
|
451 |
+
the predecessor has it or can get it with reasonable efforts.
|
452 |
+
|
453 |
+
You may not impose any further restrictions on the exercise of the
|
454 |
+
rights granted or affirmed under this License. For example, you may
|
455 |
+
not impose a license fee, royalty, or other charge for exercise of
|
456 |
+
rights granted under this License, and you may not initiate litigation
|
457 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
458 |
+
any patent claim is infringed by making, using, selling, offering for
|
459 |
+
sale, or importing the Program or any portion of it.
|
460 |
+
|
461 |
+
11. Patents.
|
462 |
+
|
463 |
+
A "contributor" is a copyright holder who authorizes use under this
|
464 |
+
License of the Program or a work on which the Program is based. The
|
465 |
+
work thus licensed is called the contributor's "contributor version".
|
466 |
+
|
467 |
+
A contributor's "essential patent claims" are all patent claims
|
468 |
+
owned or controlled by the contributor, whether already acquired or
|
469 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
470 |
+
by this License, of making, using, or selling its contributor version,
|
471 |
+
but do not include claims that would be infringed only as a
|
472 |
+
consequence of further modification of the contributor version. For
|
473 |
+
purposes of this definition, "control" includes the right to grant
|
474 |
+
patent sublicenses in a manner consistent with the requirements of
|
475 |
+
this License.
|
476 |
+
|
477 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
478 |
+
patent license under the contributor's essential patent claims, to
|
479 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
480 |
+
propagate the contents of its contributor version.
|
481 |
+
|
482 |
+
In the following three paragraphs, a "patent license" is any express
|
483 |
+
agreement or commitment, however denominated, not to enforce a patent
|
484 |
+
(such as an express permission to practice a patent or covenant not to
|
485 |
+
sue for patent infringement). To "grant" such a patent license to a
|
486 |
+
party means to make such an agreement or commitment not to enforce a
|
487 |
+
patent against the party.
|
488 |
+
|
489 |
+
If you convey a covered work, knowingly relying on a patent license,
|
490 |
+
and the Corresponding Source of the work is not available for anyone
|
491 |
+
to copy, free of charge and under the terms of this License, through a
|
492 |
+
publicly available network server or other readily accessible means,
|
493 |
+
then you must either (1) cause the Corresponding Source to be so
|
494 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
495 |
+
patent license for this particular work, or (3) arrange, in a manner
|
496 |
+
consistent with the requirements of this License, to extend the patent
|
497 |
+
license to downstream recipients. "Knowingly relying" means you have
|
498 |
+
actual knowledge that, but for the patent license, your conveying the
|
499 |
+
covered work in a country, or your recipient's use of the covered work
|
500 |
+
in a country, would infringe one or more identifiable patents in that
|
501 |
+
country that you have reason to believe are valid.
|
502 |
+
|
503 |
+
If, pursuant to or in connection with a single transaction or
|
504 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
505 |
+
covered work, and grant a patent license to some of the parties
|
506 |
+
receiving the covered work authorizing them to use, propagate, modify
|
507 |
+
or convey a specific copy of the covered work, then the patent license
|
508 |
+
you grant is automatically extended to all recipients of the covered
|
509 |
+
work and works based on it.
|
510 |
+
|
511 |
+
A patent license is "discriminatory" if it does not include within
|
512 |
+
the scope of its coverage, prohibits the exercise of, or is
|
513 |
+
conditioned on the non-exercise of one or more of the rights that are
|
514 |
+
specifically granted under this License. You may not convey a covered
|
515 |
+
work if you are a party to an arrangement with a third party that is
|
516 |
+
in the business of distributing software, under which you make payment
|
517 |
+
to the third party based on the extent of your activity of conveying
|
518 |
+
the work, and under which the third party grants, to any of the
|
519 |
+
parties who would receive the covered work from you, a discriminatory
|
520 |
+
patent license (a) in connection with copies of the covered work
|
521 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
522 |
+
for and in connection with specific products or compilations that
|
523 |
+
contain the covered work, unless you entered into that arrangement,
|
524 |
+
or that patent license was granted, prior to 28 March 2007.
|
525 |
+
|
526 |
+
Nothing in this License shall be construed as excluding or limiting
|
527 |
+
any implied license or other defenses to infringement that may
|
528 |
+
otherwise be available to you under applicable patent law.
|
529 |
+
|
530 |
+
12. No Surrender of Others' Freedom.
|
531 |
+
|
532 |
+
If conditions are imposed on you (whether by court order, agreement or
|
533 |
+
otherwise) that contradict the conditions of this License, they do not
|
534 |
+
excuse you from the conditions of this License. If you cannot convey a
|
535 |
+
covered work so as to satisfy simultaneously your obligations under this
|
536 |
+
License and any other pertinent obligations, then as a consequence you may
|
537 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
538 |
+
to collect a royalty for further conveying from those to whom you convey
|
539 |
+
the Program, the only way you could satisfy both those terms and this
|
540 |
+
License would be to refrain entirely from conveying the Program.
|
541 |
+
|
542 |
+
13. Remote Network Interaction; Use with the GNU General Public License.
|
543 |
+
|
544 |
+
Notwithstanding any other provision of this License, if you modify the
|
545 |
+
Program, your modified version must prominently offer all users
|
546 |
+
interacting with it remotely through a computer network (if your version
|
547 |
+
supports such interaction) an opportunity to receive the Corresponding
|
548 |
+
Source of your version by providing access to the Corresponding Source
|
549 |
+
from a network server at no charge, through some standard or customary
|
550 |
+
means of facilitating copying of software. This Corresponding Source
|
551 |
+
shall include the Corresponding Source for any work covered by version 3
|
552 |
+
of the GNU General Public License that is incorporated pursuant to the
|
553 |
+
following paragraph.
|
554 |
+
|
555 |
+
Notwithstanding any other provision of this License, you have
|
556 |
+
permission to link or combine any covered work with a work licensed
|
557 |
+
under version 3 of the GNU General Public License into a single
|
558 |
+
combined work, and to convey the resulting work. The terms of this
|
559 |
+
License will continue to apply to the part which is the covered work,
|
560 |
+
but the work with which it is combined will remain governed by version
|
561 |
+
3 of the GNU General Public License.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU Affero General Public License from time to time. Such new versions
|
567 |
+
will be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU Affero General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU Affero General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU Affero General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
635 |
+
Copyright (C) <year> <name of author>
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU Affero General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU Affero General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU Affero General Public License
|
648 |
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If your software can interact with users remotely through a computer
|
653 |
+
network, you should also make sure that it provides a way for users to
|
654 |
+
get its source. For example, if your program is a web application, its
|
655 |
+
interface could display a "Source" link that leads users to an archive
|
656 |
+
of the code. There are many ways you could offer source, and different
|
657 |
+
solutions will be better for different programs; see section 13 for the
|
658 |
+
specific requirements.
|
659 |
+
|
660 |
+
You should also get your employer (if you work as a programmer) or school,
|
661 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
662 |
+
For more information on this, and how to apply and follow the GNU AGPL, see
|
663 |
+
<https://www.gnu.org/licenses/>.
|
stable-diffusion-webui/README.md
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Stable Diffusion web UI
|
2 |
+
A browser interface based on Gradio library for Stable Diffusion.
|
3 |
+
|
4 |
+
![](screenshot.png)
|
5 |
+
|
6 |
+
## Features
|
7 |
+
[Detailed feature showcase with images](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features):
|
8 |
+
- Original txt2img and img2img modes
|
9 |
+
- One click install and run script (but you still must install python and git)
|
10 |
+
- Outpainting
|
11 |
+
- Inpainting
|
12 |
+
- Color Sketch
|
13 |
+
- Prompt Matrix
|
14 |
+
- Stable Diffusion Upscale
|
15 |
+
- Attention, specify parts of text that the model should pay more attention to
|
16 |
+
- a man in a `((tuxedo))` - will pay more attention to tuxedo
|
17 |
+
- a man in a `(tuxedo:1.21)` - alternative syntax
|
18 |
+
- select text and press `Ctrl+Up` or `Ctrl+Down` (or `Command+Up` or `Command+Down` if you're on a MacOS) to automatically adjust attention to selected text (code contributed by anonymous user)
|
19 |
+
- Loopback, run img2img processing multiple times
|
20 |
+
- X/Y/Z plot, a way to draw a 3 dimensional plot of images with different parameters
|
21 |
+
- Textual Inversion
|
22 |
+
- have as many embeddings as you want and use any names you like for them
|
23 |
+
- use multiple embeddings with different numbers of vectors per token
|
24 |
+
- works with half precision floating point numbers
|
25 |
+
- train embeddings on 8GB (also reports of 6GB working)
|
26 |
+
- Extras tab with:
|
27 |
+
- GFPGAN, neural network that fixes faces
|
28 |
+
- CodeFormer, face restoration tool as an alternative to GFPGAN
|
29 |
+
- RealESRGAN, neural network upscaler
|
30 |
+
- ESRGAN, neural network upscaler with a lot of third party models
|
31 |
+
- SwinIR and Swin2SR ([see here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/2092)), neural network upscalers
|
32 |
+
- LDSR, Latent diffusion super resolution upscaling
|
33 |
+
- Resizing aspect ratio options
|
34 |
+
- Sampling method selection
|
35 |
+
- Adjust sampler eta values (noise multiplier)
|
36 |
+
- More advanced noise setting options
|
37 |
+
- Interrupt processing at any time
|
38 |
+
- 4GB video card support (also reports of 2GB working)
|
39 |
+
- Correct seeds for batches
|
40 |
+
- Live prompt token length validation
|
41 |
+
- Generation parameters
|
42 |
+
- parameters you used to generate images are saved with that image
|
43 |
+
- in PNG chunks for PNG, in EXIF for JPEG
|
44 |
+
- can drag the image to PNG info tab to restore generation parameters and automatically copy them into UI
|
45 |
+
- can be disabled in settings
|
46 |
+
- drag and drop an image/text-parameters to promptbox
|
47 |
+
- Read Generation Parameters Button, loads parameters in promptbox to UI
|
48 |
+
- Settings page
|
49 |
+
- Running arbitrary python code from UI (must run with `--allow-code` to enable)
|
50 |
+
- Mouseover hints for most UI elements
|
51 |
+
- Possible to change defaults/mix/max/step values for UI elements via text config
|
52 |
+
- Tiling support, a checkbox to create images that can be tiled like textures
|
53 |
+
- Progress bar and live image generation preview
|
54 |
+
- Can use a separate neural network to produce previews with almost none VRAM or compute requirement
|
55 |
+
- Negative prompt, an extra text field that allows you to list what you don't want to see in generated image
|
56 |
+
- Styles, a way to save part of prompt and easily apply them via dropdown later
|
57 |
+
- Variations, a way to generate same image but with tiny differences
|
58 |
+
- Seed resizing, a way to generate same image but at slightly different resolution
|
59 |
+
- CLIP interrogator, a button that tries to guess prompt from an image
|
60 |
+
- Prompt Editing, a way to change prompt mid-generation, say to start making a watermelon and switch to anime girl midway
|
61 |
+
- Batch Processing, process a group of files using img2img
|
62 |
+
- Img2img Alternative, reverse Euler method of cross attention control
|
63 |
+
- Highres Fix, a convenience option to produce high resolution pictures in one click without usual distortions
|
64 |
+
- Reloading checkpoints on the fly
|
65 |
+
- Checkpoint Merger, a tab that allows you to merge up to 3 checkpoints into one
|
66 |
+
- [Custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Scripts) with many extensions from community
|
67 |
+
- [Composable-Diffusion](https://energy-based-model.github.io/Compositional-Visual-Generation-with-Composable-Diffusion-Models/), a way to use multiple prompts at once
|
68 |
+
- separate prompts using uppercase `AND`
|
69 |
+
- also supports weights for prompts: `a cat :1.2 AND a dog AND a penguin :2.2`
|
70 |
+
- No token limit for prompts (original stable diffusion lets you use up to 75 tokens)
|
71 |
+
- DeepDanbooru integration, creates danbooru style tags for anime prompts
|
72 |
+
- [xformers](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Xformers), major speed increase for select cards: (add `--xformers` to commandline args)
|
73 |
+
- via extension: [History tab](https://github.com/yfszzx/stable-diffusion-webui-images-browser): view, direct and delete images conveniently within the UI
|
74 |
+
- Generate forever option
|
75 |
+
- Training tab
|
76 |
+
- hypernetworks and embeddings options
|
77 |
+
- Preprocessing images: cropping, mirroring, autotagging using BLIP or deepdanbooru (for anime)
|
78 |
+
- Clip skip
|
79 |
+
- Hypernetworks
|
80 |
+
- Loras (same as Hypernetworks but more pretty)
|
81 |
+
- A separate UI where you can choose, with preview, which embeddings, hypernetworks or Loras to add to your prompt
|
82 |
+
- Can select to load a different VAE from settings screen
|
83 |
+
- Estimated completion time in progress bar
|
84 |
+
- API
|
85 |
+
- Support for dedicated [inpainting model](https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion) by RunwayML
|
86 |
+
- 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 embeds (implementation of [https://github.com/vicgalle/stable-diffusion-aesthetic-gradients](https://github.com/vicgalle/stable-diffusion-aesthetic-gradients))
|
87 |
+
- [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
|
88 |
+
- [Alt-Diffusion](https://arxiv.org/abs/2211.06679) support - see [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#alt-diffusion) for instructions
|
89 |
+
- Now without any bad letters!
|
90 |
+
- Load checkpoints in safetensors format
|
91 |
+
- Eased resolution restriction: generated image's dimension must be a multiple of 8 rather than 64
|
92 |
+
- Now with a license!
|
93 |
+
- Reorder elements in the UI from settings screen
|
94 |
+
|
95 |
+
## Installation and Running
|
96 |
+
Make sure the required [dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies) are met and follow the instructions available for:
|
97 |
+
- [NVidia](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs) (recommended)
|
98 |
+
- [AMD](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs) GPUs.
|
99 |
+
- [Intel CPUs, Intel GPUs (both integrated and discrete)](https://github.com/openvinotoolkit/stable-diffusion-webui/wiki/Installation-on-Intel-Silicon) (external wiki page)
|
100 |
+
|
101 |
+
Alternatively, use online services (like Google Colab):
|
102 |
+
|
103 |
+
- [List of Online Services](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Online-Services)
|
104 |
+
|
105 |
+
### Installation on Windows 10/11 with NVidia-GPUs using release package
|
106 |
+
1. Download `sd.webui.zip` from [v1.0.0-pre](https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre) and extract it's contents.
|
107 |
+
2. Run `update.bat`.
|
108 |
+
3. Run `run.bat`.
|
109 |
+
> For more details see [Install-and-Run-on-NVidia-GPUs](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs)
|
110 |
+
|
111 |
+
### Automatic Installation on Windows
|
112 |
+
1. Install [Python 3.10.6](https://www.python.org/downloads/release/python-3106/) (Newer version of Python does not support torch), checking "Add Python to PATH".
|
113 |
+
2. Install [git](https://git-scm.com/download/win).
|
114 |
+
3. Download the stable-diffusion-webui repository, for example by running `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git`.
|
115 |
+
4. Run `webui-user.bat` from Windows Explorer as normal, non-administrator, user.
|
116 |
+
|
117 |
+
### Automatic Installation on Linux
|
118 |
+
1. Install the dependencies:
|
119 |
+
```bash
|
120 |
+
# Debian-based:
|
121 |
+
sudo apt install wget git python3 python3-venv libgl1 libglib2.0-0
|
122 |
+
# Red Hat-based:
|
123 |
+
sudo dnf install wget git python3
|
124 |
+
# Arch-based:
|
125 |
+
sudo pacman -S wget git python3
|
126 |
+
```
|
127 |
+
2. Navigate to the directory you would like the webui to be installed and execute the following command:
|
128 |
+
```bash
|
129 |
+
wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
|
130 |
+
```
|
131 |
+
3. Run `webui.sh`.
|
132 |
+
4. Check `webui-user.sh` for options.
|
133 |
+
### Installation on Apple Silicon
|
134 |
+
|
135 |
+
Find the instructions [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon).
|
136 |
+
|
137 |
+
## Contributing
|
138 |
+
Here's how to add code to this repo: [Contributing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
|
139 |
+
|
140 |
+
## Documentation
|
141 |
+
|
142 |
+
The documentation was moved from this README over to the project's [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki).
|
143 |
+
|
144 |
+
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).
|
145 |
+
|
146 |
+
## Credits
|
147 |
+
Licenses for borrowed code can be found in `Settings -> Licenses` screen, and also in `html/licenses.html` file.
|
148 |
+
|
149 |
+
- Stable Diffusion - https://github.com/CompVis/stable-diffusion, https://github.com/CompVis/taming-transformers
|
150 |
+
- k-diffusion - https://github.com/crowsonkb/k-diffusion.git
|
151 |
+
- GFPGAN - https://github.com/TencentARC/GFPGAN.git
|
152 |
+
- CodeFormer - https://github.com/sczhou/CodeFormer
|
153 |
+
- ESRGAN - https://github.com/xinntao/ESRGAN
|
154 |
+
- SwinIR - https://github.com/JingyunLiang/SwinIR
|
155 |
+
- Swin2SR - https://github.com/mv-lab/swin2sr
|
156 |
+
- LDSR - https://github.com/Hafiidz/latent-diffusion
|
157 |
+
- MiDaS - https://github.com/isl-org/MiDaS
|
158 |
+
- Ideas for optimizations - https://github.com/basujindal/stable-diffusion
|
159 |
+
- Cross Attention layer optimization - Doggettx - https://github.com/Doggettx/stable-diffusion, original idea for prompt editing.
|
160 |
+
- Cross Attention layer optimization - InvokeAI, lstein - https://github.com/invoke-ai/InvokeAI (originally http://github.com/lstein/stable-diffusion)
|
161 |
+
- Sub-quadratic Cross Attention layer optimization - Alex Birch (https://github.com/Birch-san/diffusers/pull/1), Amin Rezaei (https://github.com/AminRezaei0x443/memory-efficient-attention)
|
162 |
+
- Textual Inversion - Rinon Gal - https://github.com/rinongal/textual_inversion (we're not using his code, but we are using his ideas).
|
163 |
+
- Idea for SD upscale - https://github.com/jquesnelle/txt2imghd
|
164 |
+
- Noise generation for outpainting mk2 - https://github.com/parlance-zz/g-diffuser-bot
|
165 |
+
- CLIP interrogator idea and borrowing some code - https://github.com/pharmapsychotic/clip-interrogator
|
166 |
+
- Idea for Composable Diffusion - https://github.com/energy-based-model/Compositional-Visual-Generation-with-Composable-Diffusion-Models-PyTorch
|
167 |
+
- xformers - https://github.com/facebookresearch/xformers
|
168 |
+
- DeepDanbooru - interrogator for anime diffusers https://github.com/KichangKim/DeepDanbooru
|
169 |
+
- Sampling in float32 precision from a float16 UNet - marunine for the idea, Birch-san for the example Diffusers implementation (https://github.com/Birch-san/diffusers-play/tree/92feee6)
|
170 |
+
- Instruct pix2pix - Tim Brooks (star), Aleksander Holynski (star), Alexei A. Efros (no star) - https://github.com/timothybrooks/instruct-pix2pix
|
171 |
+
- Security advice - RyotaK
|
172 |
+
- UniPC sampler - Wenliang Zhao - https://github.com/wl-zhao/UniPC
|
173 |
+
- TAESD - Ollin Boer Bohan - https://github.com/madebyollin/taesd
|
174 |
+
- LyCORIS - KohakuBlueleaf
|
175 |
+
- Restart sampling - lambertae - https://github.com/Newbeeer/diffusion_restart_sampling
|
176 |
+
- Initial Gradio script - posted on 4chan by an Anonymous user. Thank you Anonymous user.
|
177 |
+
- (You)
|
stable-diffusion-webui/__pycache__/launch.cpython-310.pyc
ADDED
Binary file (1.09 kB). View file
|
|
stable-diffusion-webui/cache.json
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"hashes": {
|
3 |
+
"checkpoint/sd_xl_base_1.0.safetensors": {
|
4 |
+
"mtime": 1692256477.0,
|
5 |
+
"sha256": "31e35c80fc4829d14f90153f4c74cd59c90b779f6afe05a74cd6120b893f7e5b"
|
6 |
+
},
|
7 |
+
"checkpoint/pontileich_v1.ckpt": {
|
8 |
+
"mtime": 1692292451.0,
|
9 |
+
"sha256": "82b59ec01a9f59e82ea245164b98731c2c5d865bc7f014fefbfcc9d17c4ef1b9"
|
10 |
+
},
|
11 |
+
"checkpoint/Dimysik.ckpt": {
|
12 |
+
"mtime": 1692256478.0,
|
13 |
+
"sha256": "45b71fe98efe5f530b825dce6f5049d738e9c16869f10be4370ab81a9912d4a6"
|
14 |
+
},
|
15 |
+
"checkpoint/Dimysik.safetensors": {
|
16 |
+
"mtime": 1692301451.0,
|
17 |
+
"sha256": "45b71fe98efe5f530b825dce6f5049d738e9c16869f10be4370ab81a9912d4a6"
|
18 |
+
},
|
19 |
+
"lora/pontileich_v1": {
|
20 |
+
"mtime": 1692296660.0,
|
21 |
+
"sha256": "82b59ec01a9f59e82ea245164b98731c2c5d865bc7f014fefbfcc9d17c4ef1b9"
|
22 |
+
},
|
23 |
+
"hypernet/NakedUkrainian": {
|
24 |
+
"mtime": 1692303062.0,
|
25 |
+
"sha256": "0573700aecb643f31dce09d88c592a97b93567900a8181a2219a4fa22475c5ac"
|
26 |
+
}
|
27 |
+
},
|
28 |
+
"safetensors-metadata": {
|
29 |
+
"checkpoint/sd_xl_base_1.0.safetensors": {
|
30 |
+
"mtime": 1692256477.0,
|
31 |
+
"value": {
|
32 |
+
"modelspec.sai_model_spec": "1.0.0",
|
33 |
+
"modelspec.architecture": "stable-diffusion-xl-v1-base",
|
34 |
+
"modelspec.implementation": "https://github.com/Stability-AI/generative-models",
|
35 |
+
"modelspec.title": "Stable Diffusion XL 1.0 Base",
|
36 |
+
"modelspec.author": "StabilityAI",
|
37 |
+
"modelspec.description": "SDXL 1.0 Base Model, compositional expert. SDXL, the most advanced development in the Stable Diffusion text-to-image suite of models. SDXL produces massively improved image and composition detail over its predecessors. The ability to generate hyper-realistic creations for films, television, music, and instructional videos, as well as offering advancements for design and industrial use, places SDXL at the forefront of real world applications for AI imagery.",
|
38 |
+
"modelspec.date": "2023-07-26",
|
39 |
+
"modelspec.resolution": "1024x1024",
|
40 |
+
"modelspec.prediction_type": "epsilon",
|
41 |
+
"modelspec.license": "CreativeML Open RAIL++-M License",
|
42 |
+
"modelspec.hash_sha256": "0xd7a9105a900fd52748f20725fe52fe52b507fd36bee4fc107b1550a26e6ee1d7"
|
43 |
+
}
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"extensions-git": {
|
47 |
+
"sd-webui-controlnet": {
|
48 |
+
"mtime": 1693601182.0,
|
49 |
+
"value": {
|
50 |
+
"remote": "https://github.com/Mikubill/sd-webui-controlnet.git",
|
51 |
+
"commit_date": 1693473730,
|
52 |
+
"branch": "main",
|
53 |
+
"commit_hash": "c3b32f254368ffc96b6aae9eab0a8fe7450a359f",
|
54 |
+
"version": "c3b32f25"
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
stable-diffusion-webui/cache/version.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
1
|
stable-diffusion-webui/config.json
ADDED
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"samples_save": true,
|
3 |
+
"samples_format": "png",
|
4 |
+
"samples_filename_pattern": "",
|
5 |
+
"save_images_add_number": true,
|
6 |
+
"grid_save": true,
|
7 |
+
"grid_format": "png",
|
8 |
+
"grid_extended_filename": false,
|
9 |
+
"grid_only_if_multiple": true,
|
10 |
+
"grid_prevent_empty_spots": false,
|
11 |
+
"grid_zip_filename_pattern": "",
|
12 |
+
"n_rows": -1,
|
13 |
+
"font": "",
|
14 |
+
"grid_text_active_color": "#000000",
|
15 |
+
"grid_text_inactive_color": "#999999",
|
16 |
+
"grid_background_color": "#ffffff",
|
17 |
+
"enable_pnginfo": true,
|
18 |
+
"save_txt": false,
|
19 |
+
"save_images_before_face_restoration": false,
|
20 |
+
"save_images_before_highres_fix": false,
|
21 |
+
"save_images_before_color_correction": false,
|
22 |
+
"save_mask": false,
|
23 |
+
"save_mask_composite": false,
|
24 |
+
"jpeg_quality": 80,
|
25 |
+
"webp_lossless": false,
|
26 |
+
"export_for_4chan": true,
|
27 |
+
"img_downscale_threshold": 4.0,
|
28 |
+
"target_side_length": 4000,
|
29 |
+
"img_max_size_mp": 200,
|
30 |
+
"use_original_name_batch": true,
|
31 |
+
"use_upscaler_name_as_suffix": false,
|
32 |
+
"save_selected_only": true,
|
33 |
+
"save_init_img": false,
|
34 |
+
"temp_dir": "",
|
35 |
+
"clean_temp_dir_at_start": false,
|
36 |
+
"outdir_samples": "",
|
37 |
+
"outdir_txt2img_samples": "outputs/txt2img-images",
|
38 |
+
"outdir_img2img_samples": "outputs/img2img-images",
|
39 |
+
"outdir_extras_samples": "outputs/extras-images",
|
40 |
+
"outdir_grids": "",
|
41 |
+
"outdir_txt2img_grids": "outputs/txt2img-grids",
|
42 |
+
"outdir_img2img_grids": "outputs/img2img-grids",
|
43 |
+
"outdir_save": "log/images",
|
44 |
+
"outdir_init_images": "outputs/init-images",
|
45 |
+
"save_to_dirs": true,
|
46 |
+
"grid_save_to_dirs": true,
|
47 |
+
"use_save_to_dirs_for_ui": false,
|
48 |
+
"directories_filename_pattern": "[date]",
|
49 |
+
"directories_max_prompt_words": 8,
|
50 |
+
"ESRGAN_tile": 192,
|
51 |
+
"ESRGAN_tile_overlap": 8,
|
52 |
+
"realesrgan_enabled_models": [
|
53 |
+
"R-ESRGAN 4x+",
|
54 |
+
"R-ESRGAN 4x+ Anime6B"
|
55 |
+
],
|
56 |
+
"upscaler_for_img2img": null,
|
57 |
+
"face_restoration_model": "CodeFormer",
|
58 |
+
"code_former_weight": 0.5,
|
59 |
+
"face_restoration_unload": false,
|
60 |
+
"show_warnings": false,
|
61 |
+
"memmon_poll_rate": 8,
|
62 |
+
"samples_log_stdout": false,
|
63 |
+
"multiple_tqdm": true,
|
64 |
+
"print_hypernet_extra": false,
|
65 |
+
"list_hidden_files": true,
|
66 |
+
"disable_mmap_load_safetensors": false,
|
67 |
+
"unload_models_when_training": false,
|
68 |
+
"pin_memory": false,
|
69 |
+
"save_optimizer_state": false,
|
70 |
+
"save_training_settings_to_txt": true,
|
71 |
+
"dataset_filename_word_regex": "",
|
72 |
+
"dataset_filename_join_string": " ",
|
73 |
+
"training_image_repeats_per_epoch": 1,
|
74 |
+
"training_write_csv_every": 500,
|
75 |
+
"training_xattention_optimizations": false,
|
76 |
+
"training_enable_tensorboard": false,
|
77 |
+
"training_tensorboard_save_images": false,
|
78 |
+
"training_tensorboard_flush_every": 120,
|
79 |
+
"sd_model_checkpoint": "pontileich_v1.ckpt [82b59ec01a]",
|
80 |
+
"sd_checkpoint_cache": 0,
|
81 |
+
"sd_vae_checkpoint_cache": 0,
|
82 |
+
"sd_vae": "Automatic",
|
83 |
+
"sd_vae_as_default": true,
|
84 |
+
"sd_unet": "Automatic",
|
85 |
+
"inpainting_mask_weight": 1,
|
86 |
+
"initial_noise_multiplier": 0.85,
|
87 |
+
"img2img_color_correction": false,
|
88 |
+
"img2img_fix_steps": false,
|
89 |
+
"img2img_background_color": "#ffffff",
|
90 |
+
"enable_quantization": false,
|
91 |
+
"enable_emphasis": true,
|
92 |
+
"enable_batch_seeds": true,
|
93 |
+
"comma_padding_backtrack": 20,
|
94 |
+
"CLIP_stop_at_last_layers": 12,
|
95 |
+
"upcast_attn": false,
|
96 |
+
"auto_vae_precision": true,
|
97 |
+
"randn_source": "GPU",
|
98 |
+
"sdxl_crop_top": 0,
|
99 |
+
"sdxl_crop_left": 0,
|
100 |
+
"sdxl_refiner_low_aesthetic_score": 2.5,
|
101 |
+
"sdxl_refiner_high_aesthetic_score": 6.0,
|
102 |
+
"cross_attention_optimization": "Automatic",
|
103 |
+
"s_min_uncond": 0.0,
|
104 |
+
"token_merging_ratio": 0.0,
|
105 |
+
"token_merging_ratio_img2img": 0.0,
|
106 |
+
"token_merging_ratio_hr": 0.0,
|
107 |
+
"pad_cond_uncond": false,
|
108 |
+
"experimental_persistent_cond_cache": false,
|
109 |
+
"use_old_emphasis_implementation": false,
|
110 |
+
"use_old_karras_scheduler_sigmas": false,
|
111 |
+
"no_dpmpp_sde_batch_determinism": false,
|
112 |
+
"use_old_hires_fix_width_height": false,
|
113 |
+
"dont_fix_second_order_samplers_schedule": false,
|
114 |
+
"hires_fix_use_firstpass_conds": false,
|
115 |
+
"interrogate_keep_models_in_memory": false,
|
116 |
+
"interrogate_return_ranks": false,
|
117 |
+
"interrogate_clip_num_beams": 1,
|
118 |
+
"interrogate_clip_min_length": 24,
|
119 |
+
"interrogate_clip_max_length": 48,
|
120 |
+
"interrogate_clip_dict_limit": 1500,
|
121 |
+
"interrogate_clip_skip_categories": [],
|
122 |
+
"interrogate_deepbooru_score_threshold": 0.5,
|
123 |
+
"deepbooru_sort_alpha": true,
|
124 |
+
"deepbooru_use_spaces": true,
|
125 |
+
"deepbooru_escape": true,
|
126 |
+
"deepbooru_filter_tags": "",
|
127 |
+
"extra_networks_show_hidden_directories": true,
|
128 |
+
"extra_networks_hidden_models": "When searched",
|
129 |
+
"extra_networks_default_multiplier": 1.0,
|
130 |
+
"extra_networks_card_width": 0,
|
131 |
+
"extra_networks_card_height": 0,
|
132 |
+
"extra_networks_card_text_scale": 1.0,
|
133 |
+
"extra_networks_card_show_desc": true,
|
134 |
+
"extra_networks_add_text_separator": " ",
|
135 |
+
"ui_extra_networks_tab_reorder": "",
|
136 |
+
"textual_inversion_print_at_load": false,
|
137 |
+
"textual_inversion_add_hashes_to_infotext": true,
|
138 |
+
"sd_hypernetwork": "None",
|
139 |
+
"localization": "None",
|
140 |
+
"gradio_theme": "Default",
|
141 |
+
"img2img_editor_height": 720,
|
142 |
+
"return_grid": true,
|
143 |
+
"return_mask": false,
|
144 |
+
"return_mask_composite": false,
|
145 |
+
"do_not_show_images": false,
|
146 |
+
"send_seed": true,
|
147 |
+
"send_size": true,
|
148 |
+
"js_modal_lightbox": true,
|
149 |
+
"js_modal_lightbox_initially_zoomed": true,
|
150 |
+
"js_modal_lightbox_gamepad": false,
|
151 |
+
"js_modal_lightbox_gamepad_repeat": 250,
|
152 |
+
"show_progress_in_title": true,
|
153 |
+
"samplers_in_dropdown": true,
|
154 |
+
"dimensions_and_batch_together": true,
|
155 |
+
"keyedit_precision_attention": 0.1,
|
156 |
+
"keyedit_precision_extra": 0.05,
|
157 |
+
"keyedit_delimiters": ".,\\/!?%^*;:{}=`~()",
|
158 |
+
"keyedit_move": true,
|
159 |
+
"quicksettings_list": [
|
160 |
+
"sd_model_checkpoint",
|
161 |
+
"sd_vae",
|
162 |
+
"CLIP_stop_at_last_layers",
|
163 |
+
"inpainting_mask_weight",
|
164 |
+
"initial_noise_multiplier"
|
165 |
+
],
|
166 |
+
"ui_tab_order": [],
|
167 |
+
"hidden_tabs": [],
|
168 |
+
"ui_reorder_list": [],
|
169 |
+
"hires_fix_show_sampler": false,
|
170 |
+
"hires_fix_show_prompts": false,
|
171 |
+
"disable_token_counters": false,
|
172 |
+
"add_model_hash_to_info": true,
|
173 |
+
"add_model_name_to_info": true,
|
174 |
+
"add_user_name_to_info": false,
|
175 |
+
"add_version_to_infotext": true,
|
176 |
+
"disable_weights_auto_swap": true,
|
177 |
+
"infotext_styles": "Apply if any",
|
178 |
+
"show_progressbar": true,
|
179 |
+
"live_previews_enable": true,
|
180 |
+
"live_previews_image_format": "png",
|
181 |
+
"show_progress_grid": true,
|
182 |
+
"show_progress_every_n_steps": 10,
|
183 |
+
"show_progress_type": "Approx NN",
|
184 |
+
"live_preview_content": "Prompt",
|
185 |
+
"live_preview_refresh_period": 1000,
|
186 |
+
"hide_samplers": [],
|
187 |
+
"eta_ddim": 0.0,
|
188 |
+
"eta_ancestral": 1.0,
|
189 |
+
"ddim_discretize": "uniform",
|
190 |
+
"s_churn": 0.0,
|
191 |
+
"s_tmin": 0.0,
|
192 |
+
"s_noise": 1.0,
|
193 |
+
"k_sched_type": "Automatic",
|
194 |
+
"sigma_min": 0.0,
|
195 |
+
"sigma_max": 0.0,
|
196 |
+
"rho": 0.0,
|
197 |
+
"eta_noise_seed_delta": 0,
|
198 |
+
"always_discard_next_to_last_sigma": false,
|
199 |
+
"uni_pc_variant": "bh1",
|
200 |
+
"uni_pc_skip_type": "time_uniform",
|
201 |
+
"uni_pc_order": 3,
|
202 |
+
"uni_pc_lower_order_final": true,
|
203 |
+
"postprocessing_enable_in_main_ui": [],
|
204 |
+
"postprocessing_operation_order": [],
|
205 |
+
"upscaling_max_images_in_cache": 5,
|
206 |
+
"disabled_extensions": [],
|
207 |
+
"disable_all_extensions": "none",
|
208 |
+
"restore_config_state_file": "",
|
209 |
+
"sd_checkpoint_hash": "82b59ec01a9f59e82ea245164b98731c2c5d865bc7f014fefbfcc9d17c4ef1b9"
|
210 |
+
}
|
stable-diffusion-webui/configs/alt-diffusion-inference.yaml
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
base_learning_rate: 1.0e-04
|
3 |
+
target: ldm.models.diffusion.ddpm.LatentDiffusion
|
4 |
+
params:
|
5 |
+
linear_start: 0.00085
|
6 |
+
linear_end: 0.0120
|
7 |
+
num_timesteps_cond: 1
|
8 |
+
log_every_t: 200
|
9 |
+
timesteps: 1000
|
10 |
+
first_stage_key: "jpg"
|
11 |
+
cond_stage_key: "txt"
|
12 |
+
image_size: 64
|
13 |
+
channels: 4
|
14 |
+
cond_stage_trainable: false # Note: different from the one we trained before
|
15 |
+
conditioning_key: crossattn
|
16 |
+
monitor: val/loss_simple_ema
|
17 |
+
scale_factor: 0.18215
|
18 |
+
use_ema: False
|
19 |
+
|
20 |
+
scheduler_config: # 10000 warmup steps
|
21 |
+
target: ldm.lr_scheduler.LambdaLinearScheduler
|
22 |
+
params:
|
23 |
+
warm_up_steps: [ 10000 ]
|
24 |
+
cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
|
25 |
+
f_start: [ 1.e-6 ]
|
26 |
+
f_max: [ 1. ]
|
27 |
+
f_min: [ 1. ]
|
28 |
+
|
29 |
+
unet_config:
|
30 |
+
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
31 |
+
params:
|
32 |
+
image_size: 32 # unused
|
33 |
+
in_channels: 4
|
34 |
+
out_channels: 4
|
35 |
+
model_channels: 320
|
36 |
+
attention_resolutions: [ 4, 2, 1 ]
|
37 |
+
num_res_blocks: 2
|
38 |
+
channel_mult: [ 1, 2, 4, 4 ]
|
39 |
+
num_heads: 8
|
40 |
+
use_spatial_transformer: True
|
41 |
+
transformer_depth: 1
|
42 |
+
context_dim: 768
|
43 |
+
use_checkpoint: True
|
44 |
+
legacy: False
|
45 |
+
|
46 |
+
first_stage_config:
|
47 |
+
target: ldm.models.autoencoder.AutoencoderKL
|
48 |
+
params:
|
49 |
+
embed_dim: 4
|
50 |
+
monitor: val/rec_loss
|
51 |
+
ddconfig:
|
52 |
+
double_z: true
|
53 |
+
z_channels: 4
|
54 |
+
resolution: 256
|
55 |
+
in_channels: 3
|
56 |
+
out_ch: 3
|
57 |
+
ch: 128
|
58 |
+
ch_mult:
|
59 |
+
- 1
|
60 |
+
- 2
|
61 |
+
- 4
|
62 |
+
- 4
|
63 |
+
num_res_blocks: 2
|
64 |
+
attn_resolutions: []
|
65 |
+
dropout: 0.0
|
66 |
+
lossconfig:
|
67 |
+
target: torch.nn.Identity
|
68 |
+
|
69 |
+
cond_stage_config:
|
70 |
+
target: modules.xlmr.BertSeriesModelWithTransformation
|
71 |
+
params:
|
72 |
+
name: "XLMR-Large"
|
stable-diffusion-webui/configs/instruct-pix2pix.yaml
ADDED
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# File modified by authors of InstructPix2Pix from original (https://github.com/CompVis/stable-diffusion).
|
2 |
+
# See more details in LICENSE.
|
3 |
+
|
4 |
+
model:
|
5 |
+
base_learning_rate: 1.0e-04
|
6 |
+
target: modules.models.diffusion.ddpm_edit.LatentDiffusion
|
7 |
+
params:
|
8 |
+
linear_start: 0.00085
|
9 |
+
linear_end: 0.0120
|
10 |
+
num_timesteps_cond: 1
|
11 |
+
log_every_t: 200
|
12 |
+
timesteps: 1000
|
13 |
+
first_stage_key: edited
|
14 |
+
cond_stage_key: edit
|
15 |
+
# image_size: 64
|
16 |
+
# image_size: 32
|
17 |
+
image_size: 16
|
18 |
+
channels: 4
|
19 |
+
cond_stage_trainable: false # Note: different from the one we trained before
|
20 |
+
conditioning_key: hybrid
|
21 |
+
monitor: val/loss_simple_ema
|
22 |
+
scale_factor: 0.18215
|
23 |
+
use_ema: false
|
24 |
+
|
25 |
+
scheduler_config: # 10000 warmup steps
|
26 |
+
target: ldm.lr_scheduler.LambdaLinearScheduler
|
27 |
+
params:
|
28 |
+
warm_up_steps: [ 0 ]
|
29 |
+
cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
|
30 |
+
f_start: [ 1.e-6 ]
|
31 |
+
f_max: [ 1. ]
|
32 |
+
f_min: [ 1. ]
|
33 |
+
|
34 |
+
unet_config:
|
35 |
+
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
36 |
+
params:
|
37 |
+
image_size: 32 # unused
|
38 |
+
in_channels: 8
|
39 |
+
out_channels: 4
|
40 |
+
model_channels: 320
|
41 |
+
attention_resolutions: [ 4, 2, 1 ]
|
42 |
+
num_res_blocks: 2
|
43 |
+
channel_mult: [ 1, 2, 4, 4 ]
|
44 |
+
num_heads: 8
|
45 |
+
use_spatial_transformer: True
|
46 |
+
transformer_depth: 1
|
47 |
+
context_dim: 768
|
48 |
+
use_checkpoint: True
|
49 |
+
legacy: False
|
50 |
+
|
51 |
+
first_stage_config:
|
52 |
+
target: ldm.models.autoencoder.AutoencoderKL
|
53 |
+
params:
|
54 |
+
embed_dim: 4
|
55 |
+
monitor: val/rec_loss
|
56 |
+
ddconfig:
|
57 |
+
double_z: true
|
58 |
+
z_channels: 4
|
59 |
+
resolution: 256
|
60 |
+
in_channels: 3
|
61 |
+
out_ch: 3
|
62 |
+
ch: 128
|
63 |
+
ch_mult:
|
64 |
+
- 1
|
65 |
+
- 2
|
66 |
+
- 4
|
67 |
+
- 4
|
68 |
+
num_res_blocks: 2
|
69 |
+
attn_resolutions: []
|
70 |
+
dropout: 0.0
|
71 |
+
lossconfig:
|
72 |
+
target: torch.nn.Identity
|
73 |
+
|
74 |
+
cond_stage_config:
|
75 |
+
target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
|
76 |
+
|
77 |
+
data:
|
78 |
+
target: main.DataModuleFromConfig
|
79 |
+
params:
|
80 |
+
batch_size: 128
|
81 |
+
num_workers: 1
|
82 |
+
wrap: false
|
83 |
+
validation:
|
84 |
+
target: edit_dataset.EditDataset
|
85 |
+
params:
|
86 |
+
path: data/clip-filtered-dataset
|
87 |
+
cache_dir: data/
|
88 |
+
cache_name: data_10k
|
89 |
+
split: val
|
90 |
+
min_text_sim: 0.2
|
91 |
+
min_image_sim: 0.75
|
92 |
+
min_direction_sim: 0.2
|
93 |
+
max_samples_per_prompt: 1
|
94 |
+
min_resize_res: 512
|
95 |
+
max_resize_res: 512
|
96 |
+
crop_res: 512
|
97 |
+
output_as_edit: False
|
98 |
+
real_input: True
|
stable-diffusion-webui/configs/v1-inference.yaml
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
base_learning_rate: 1.0e-04
|
3 |
+
target: ldm.models.diffusion.ddpm.LatentDiffusion
|
4 |
+
params:
|
5 |
+
linear_start: 0.00085
|
6 |
+
linear_end: 0.0120
|
7 |
+
num_timesteps_cond: 1
|
8 |
+
log_every_t: 200
|
9 |
+
timesteps: 1000
|
10 |
+
first_stage_key: "jpg"
|
11 |
+
cond_stage_key: "txt"
|
12 |
+
image_size: 64
|
13 |
+
channels: 4
|
14 |
+
cond_stage_trainable: false # Note: different from the one we trained before
|
15 |
+
conditioning_key: crossattn
|
16 |
+
monitor: val/loss_simple_ema
|
17 |
+
scale_factor: 0.18215
|
18 |
+
use_ema: False
|
19 |
+
|
20 |
+
scheduler_config: # 10000 warmup steps
|
21 |
+
target: ldm.lr_scheduler.LambdaLinearScheduler
|
22 |
+
params:
|
23 |
+
warm_up_steps: [ 10000 ]
|
24 |
+
cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
|
25 |
+
f_start: [ 1.e-6 ]
|
26 |
+
f_max: [ 1. ]
|
27 |
+
f_min: [ 1. ]
|
28 |
+
|
29 |
+
unet_config:
|
30 |
+
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
31 |
+
params:
|
32 |
+
image_size: 32 # unused
|
33 |
+
in_channels: 4
|
34 |
+
out_channels: 4
|
35 |
+
model_channels: 320
|
36 |
+
attention_resolutions: [ 4, 2, 1 ]
|
37 |
+
num_res_blocks: 2
|
38 |
+
channel_mult: [ 1, 2, 4, 4 ]
|
39 |
+
num_heads: 8
|
40 |
+
use_spatial_transformer: True
|
41 |
+
transformer_depth: 1
|
42 |
+
context_dim: 768
|
43 |
+
use_checkpoint: True
|
44 |
+
legacy: False
|
45 |
+
|
46 |
+
first_stage_config:
|
47 |
+
target: ldm.models.autoencoder.AutoencoderKL
|
48 |
+
params:
|
49 |
+
embed_dim: 4
|
50 |
+
monitor: val/rec_loss
|
51 |
+
ddconfig:
|
52 |
+
double_z: true
|
53 |
+
z_channels: 4
|
54 |
+
resolution: 256
|
55 |
+
in_channels: 3
|
56 |
+
out_ch: 3
|
57 |
+
ch: 128
|
58 |
+
ch_mult:
|
59 |
+
- 1
|
60 |
+
- 2
|
61 |
+
- 4
|
62 |
+
- 4
|
63 |
+
num_res_blocks: 2
|
64 |
+
attn_resolutions: []
|
65 |
+
dropout: 0.0
|
66 |
+
lossconfig:
|
67 |
+
target: torch.nn.Identity
|
68 |
+
|
69 |
+
cond_stage_config:
|
70 |
+
target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
|
stable-diffusion-webui/configs/v1-inpainting-inference.yaml
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
model:
|
2 |
+
base_learning_rate: 7.5e-05
|
3 |
+
target: ldm.models.diffusion.ddpm.LatentInpaintDiffusion
|
4 |
+
params:
|
5 |
+
linear_start: 0.00085
|
6 |
+
linear_end: 0.0120
|
7 |
+
num_timesteps_cond: 1
|
8 |
+
log_every_t: 200
|
9 |
+
timesteps: 1000
|
10 |
+
first_stage_key: "jpg"
|
11 |
+
cond_stage_key: "txt"
|
12 |
+
image_size: 64
|
13 |
+
channels: 4
|
14 |
+
cond_stage_trainable: false # Note: different from the one we trained before
|
15 |
+
conditioning_key: hybrid # important
|
16 |
+
monitor: val/loss_simple_ema
|
17 |
+
scale_factor: 0.18215
|
18 |
+
finetune_keys: null
|
19 |
+
|
20 |
+
scheduler_config: # 10000 warmup steps
|
21 |
+
target: ldm.lr_scheduler.LambdaLinearScheduler
|
22 |
+
params:
|
23 |
+
warm_up_steps: [ 2500 ] # NOTE for resuming. use 10000 if starting from scratch
|
24 |
+
cycle_lengths: [ 10000000000000 ] # incredibly large number to prevent corner cases
|
25 |
+
f_start: [ 1.e-6 ]
|
26 |
+
f_max: [ 1. ]
|
27 |
+
f_min: [ 1. ]
|
28 |
+
|
29 |
+
unet_config:
|
30 |
+
target: ldm.modules.diffusionmodules.openaimodel.UNetModel
|
31 |
+
params:
|
32 |
+
image_size: 32 # unused
|
33 |
+
in_channels: 9 # 4 data + 4 downscaled image + 1 mask
|
34 |
+
out_channels: 4
|
35 |
+
model_channels: 320
|
36 |
+
attention_resolutions: [ 4, 2, 1 ]
|
37 |
+
num_res_blocks: 2
|
38 |
+
channel_mult: [ 1, 2, 4, 4 ]
|
39 |
+
num_heads: 8
|
40 |
+
use_spatial_transformer: True
|
41 |
+
transformer_depth: 1
|
42 |
+
context_dim: 768
|
43 |
+
use_checkpoint: True
|
44 |
+
legacy: False
|
45 |
+
|
46 |
+
first_stage_config:
|
47 |
+
target: ldm.models.autoencoder.AutoencoderKL
|
48 |
+
params:
|
49 |
+
embed_dim: 4
|
50 |
+
monitor: val/rec_loss
|
51 |
+
ddconfig:
|
52 |
+
double_z: true
|
53 |
+
z_channels: 4
|
54 |
+
resolution: 256
|
55 |
+
in_channels: 3
|
56 |
+
out_ch: 3
|
57 |
+
ch: 128
|
58 |
+
ch_mult:
|
59 |
+
- 1
|
60 |
+
- 2
|
61 |
+
- 4
|
62 |
+
- 4
|
63 |
+
num_res_blocks: 2
|
64 |
+
attn_resolutions: []
|
65 |
+
dropout: 0.0
|
66 |
+
lossconfig:
|
67 |
+
target: torch.nn.Identity
|
68 |
+
|
69 |
+
cond_stage_config:
|
70 |
+
target: ldm.modules.encoders.modules.FrozenCLIPEmbedder
|
stable-diffusion-webui/embeddings/Place Textual Inversion embeddings here.txt
ADDED
File without changes
|
stable-diffusion-webui/environment-wsl2.yaml
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: automatic
|
2 |
+
channels:
|
3 |
+
- pytorch
|
4 |
+
- defaults
|
5 |
+
dependencies:
|
6 |
+
- python=3.10
|
7 |
+
- pip=23.0
|
8 |
+
- cudatoolkit=11.8
|
9 |
+
- pytorch=2.0
|
10 |
+
- torchvision=0.15
|
11 |
+
- numpy=1.23
|
stable-diffusion-webui/extensions/put extensions here.txt
ADDED
File without changes
|
stable-diffusion-webui/html/card-no-preview.png
ADDED
![]() |
stable-diffusion-webui/html/extra-networks-card.html
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class='card' style={style} onclick={card_clicked} data-name="{name}" {sort_keys}>
|
2 |
+
{background_image}
|
3 |
+
<div class="button-row">
|
4 |
+
{metadata_button}
|
5 |
+
{edit_button}
|
6 |
+
</div>
|
7 |
+
<div class='actions'>
|
8 |
+
<div class='additional'>
|
9 |
+
<span style="display:none" class='search_term{search_only}'>{search_term}</span>
|
10 |
+
</div>
|
11 |
+
<span class='name'>{name}</span>
|
12 |
+
<span class='description'>{description}</span>
|
13 |
+
</div>
|
14 |
+
</div>
|
stable-diffusion-webui/html/extra-networks-no-cards.html
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class='nocards'>
|
2 |
+
<h1>Nothing here. Add some content to the following directories:</h1>
|
3 |
+
|
4 |
+
<ul>
|
5 |
+
{dirs}
|
6 |
+
</ul>
|
7 |
+
</div>
|
8 |
+
|
stable-diffusion-webui/html/footer.html
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div>
|
2 |
+
<a href="{api_docs}">API</a>
|
3 |
+
•
|
4 |
+
<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">Github</a>
|
5 |
+
•
|
6 |
+
<a href="https://gradio.app">Gradio</a>
|
7 |
+
•
|
8 |
+
<a href="#" onclick="showProfile('./internal/profile-startup'); return false;">Startup profile</a>
|
9 |
+
•
|
10 |
+
<a href="/" onclick="javascript:gradioApp().getElementById('settings_restart_gradio').click(); return false">Reload UI</a>
|
11 |
+
</div>
|
12 |
+
<br />
|
13 |
+
<div class="versions">
|
14 |
+
{versions}
|
15 |
+
</div>
|
stable-diffusion-webui/html/licenses.html
ADDED
@@ -0,0 +1,690 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
#licenses h2 {font-size: 1.2em; font-weight: bold; margin-bottom: 0.2em;}
|
3 |
+
#licenses small {font-size: 0.95em; opacity: 0.85;}
|
4 |
+
#licenses pre { margin: 1em 0 2em 0;}
|
5 |
+
</style>
|
6 |
+
|
7 |
+
<h2><a href="https://github.com/sczhou/CodeFormer/blob/master/LICENSE">CodeFormer</a></h2>
|
8 |
+
<small>Parts of CodeFormer code had to be copied to be compatible with GFPGAN.</small>
|
9 |
+
<pre>
|
10 |
+
S-Lab License 1.0
|
11 |
+
|
12 |
+
Copyright 2022 S-Lab
|
13 |
+
|
14 |
+
Redistribution and use for non-commercial purpose in source and
|
15 |
+
binary forms, with or without modification, are permitted provided
|
16 |
+
that the following conditions are met:
|
17 |
+
|
18 |
+
1. Redistributions of source code must retain the above copyright
|
19 |
+
notice, this list of conditions and the following disclaimer.
|
20 |
+
|
21 |
+
2. Redistributions in binary form must reproduce the above copyright
|
22 |
+
notice, this list of conditions and the following disclaimer in
|
23 |
+
the documentation and/or other materials provided with the
|
24 |
+
distribution.
|
25 |
+
|
26 |
+
3. Neither the name of the copyright holder nor the names of its
|
27 |
+
contributors may be used to endorse or promote products derived
|
28 |
+
from this software without specific prior written permission.
|
29 |
+
|
30 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
31 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
32 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
33 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
34 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
35 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
36 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
37 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
38 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
39 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
40 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
41 |
+
|
42 |
+
In the event that redistribution and/or use for commercial purpose in
|
43 |
+
source or binary forms, with or without modification is required,
|
44 |
+
please contact the contributor(s) of the work.
|
45 |
+
</pre>
|
46 |
+
|
47 |
+
|
48 |
+
<h2><a href="https://github.com/victorca25/iNNfer/blob/main/LICENSE">ESRGAN</a></h2>
|
49 |
+
<small>Code for architecture and reading models copied.</small>
|
50 |
+
<pre>
|
51 |
+
MIT License
|
52 |
+
|
53 |
+
Copyright (c) 2021 victorca25
|
54 |
+
|
55 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
56 |
+
of this software and associated documentation files (the "Software"), to deal
|
57 |
+
in the Software without restriction, including without limitation the rights
|
58 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
59 |
+
copies of the Software, and to permit persons to whom the Software is
|
60 |
+
furnished to do so, subject to the following conditions:
|
61 |
+
|
62 |
+
The above copyright notice and this permission notice shall be included in all
|
63 |
+
copies or substantial portions of the Software.
|
64 |
+
|
65 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
66 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
67 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
68 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
69 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
70 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
71 |
+
SOFTWARE.
|
72 |
+
</pre>
|
73 |
+
|
74 |
+
<h2><a href="https://github.com/xinntao/Real-ESRGAN/blob/master/LICENSE">Real-ESRGAN</a></h2>
|
75 |
+
<small>Some code is copied to support ESRGAN models.</small>
|
76 |
+
<pre>
|
77 |
+
BSD 3-Clause License
|
78 |
+
|
79 |
+
Copyright (c) 2021, Xintao Wang
|
80 |
+
All rights reserved.
|
81 |
+
|
82 |
+
Redistribution and use in source and binary forms, with or without
|
83 |
+
modification, are permitted provided that the following conditions are met:
|
84 |
+
|
85 |
+
1. Redistributions of source code must retain the above copyright notice, this
|
86 |
+
list of conditions and the following disclaimer.
|
87 |
+
|
88 |
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
89 |
+
this list of conditions and the following disclaimer in the documentation
|
90 |
+
and/or other materials provided with the distribution.
|
91 |
+
|
92 |
+
3. Neither the name of the copyright holder nor the names of its
|
93 |
+
contributors may be used to endorse or promote products derived from
|
94 |
+
this software without specific prior written permission.
|
95 |
+
|
96 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
97 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
98 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
99 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
100 |
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
101 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
102 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
103 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
104 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
105 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
106 |
+
</pre>
|
107 |
+
|
108 |
+
<h2><a href="https://github.com/invoke-ai/InvokeAI/blob/main/LICENSE">InvokeAI</a></h2>
|
109 |
+
<small>Some code for compatibility with OSX is taken from lstein's repository.</small>
|
110 |
+
<pre>
|
111 |
+
MIT License
|
112 |
+
|
113 |
+
Copyright (c) 2022 InvokeAI Team
|
114 |
+
|
115 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
116 |
+
of this software and associated documentation files (the "Software"), to deal
|
117 |
+
in the Software without restriction, including without limitation the rights
|
118 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
119 |
+
copies of the Software, and to permit persons to whom the Software is
|
120 |
+
furnished to do so, subject to the following conditions:
|
121 |
+
|
122 |
+
The above copyright notice and this permission notice shall be included in all
|
123 |
+
copies or substantial portions of the Software.
|
124 |
+
|
125 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
126 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
127 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
128 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
129 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
130 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
131 |
+
SOFTWARE.
|
132 |
+
</pre>
|
133 |
+
|
134 |
+
<h2><a href="https://github.com/Hafiidz/latent-diffusion/blob/main/LICENSE">LDSR</a></h2>
|
135 |
+
<small>Code added by contirubtors, most likely copied from this repository.</small>
|
136 |
+
<pre>
|
137 |
+
MIT License
|
138 |
+
|
139 |
+
Copyright (c) 2022 Machine Vision and Learning Group, LMU Munich
|
140 |
+
|
141 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
142 |
+
of this software and associated documentation files (the "Software"), to deal
|
143 |
+
in the Software without restriction, including without limitation the rights
|
144 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
145 |
+
copies of the Software, and to permit persons to whom the Software is
|
146 |
+
furnished to do so, subject to the following conditions:
|
147 |
+
|
148 |
+
The above copyright notice and this permission notice shall be included in all
|
149 |
+
copies or substantial portions of the Software.
|
150 |
+
|
151 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
152 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
153 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
154 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
155 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
156 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
157 |
+
SOFTWARE.
|
158 |
+
</pre>
|
159 |
+
|
160 |
+
<h2><a href="https://github.com/pharmapsychotic/clip-interrogator/blob/main/LICENSE">CLIP Interrogator</a></h2>
|
161 |
+
<small>Some small amounts of code borrowed and reworked.</small>
|
162 |
+
<pre>
|
163 |
+
MIT License
|
164 |
+
|
165 |
+
Copyright (c) 2022 pharmapsychotic
|
166 |
+
|
167 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
168 |
+
of this software and associated documentation files (the "Software"), to deal
|
169 |
+
in the Software without restriction, including without limitation the rights
|
170 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
171 |
+
copies of the Software, and to permit persons to whom the Software is
|
172 |
+
furnished to do so, subject to the following conditions:
|
173 |
+
|
174 |
+
The above copyright notice and this permission notice shall be included in all
|
175 |
+
copies or substantial portions of the Software.
|
176 |
+
|
177 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
178 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
179 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
180 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
181 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
182 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
183 |
+
SOFTWARE.
|
184 |
+
</pre>
|
185 |
+
|
186 |
+
<h2><a href="https://github.com/JingyunLiang/SwinIR/blob/main/LICENSE">SwinIR</a></h2>
|
187 |
+
<small>Code added by contributors, most likely copied from this repository.</small>
|
188 |
+
|
189 |
+
<pre>
|
190 |
+
Apache License
|
191 |
+
Version 2.0, January 2004
|
192 |
+
http://www.apache.org/licenses/
|
193 |
+
|
194 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
195 |
+
|
196 |
+
1. Definitions.
|
197 |
+
|
198 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
199 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
200 |
+
|
201 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
202 |
+
the copyright owner that is granting the License.
|
203 |
+
|
204 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
205 |
+
other entities that control, are controlled by, or are under common
|
206 |
+
control with that entity. For the purposes of this definition,
|
207 |
+
"control" means (i) the power, direct or indirect, to cause the
|
208 |
+
direction or management of such entity, whether by contract or
|
209 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
210 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
211 |
+
|
212 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
213 |
+
exercising permissions granted by this License.
|
214 |
+
|
215 |
+
"Source" form shall mean the preferred form for making modifications,
|
216 |
+
including but not limited to software source code, documentation
|
217 |
+
source, and configuration files.
|
218 |
+
|
219 |
+
"Object" form shall mean any form resulting from mechanical
|
220 |
+
transformation or translation of a Source form, including but
|
221 |
+
not limited to compiled object code, generated documentation,
|
222 |
+
and conversions to other media types.
|
223 |
+
|
224 |
+
"Work" shall mean the work of authorship, whether in Source or
|
225 |
+
Object form, made available under the License, as indicated by a
|
226 |
+
copyright notice that is included in or attached to the work
|
227 |
+
(an example is provided in the Appendix below).
|
228 |
+
|
229 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
230 |
+
form, that is based on (or derived from) the Work and for which the
|
231 |
+
editorial revisions, annotations, elaborations, or other modifications
|
232 |
+
represent, as a whole, an original work of authorship. For the purposes
|
233 |
+
of this License, Derivative Works shall not include works that remain
|
234 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
235 |
+
the Work and Derivative Works thereof.
|
236 |
+
|
237 |
+
"Contribution" shall mean any work of authorship, including
|
238 |
+
the original version of the Work and any modifications or additions
|
239 |
+
to that Work or Derivative Works thereof, that is intentionally
|
240 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
241 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
242 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
243 |
+
means any form of electronic, verbal, or written communication sent
|
244 |
+
to the Licensor or its representatives, including but not limited to
|
245 |
+
communication on electronic mailing lists, source code control systems,
|
246 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
247 |
+
Licensor for the purpose of discussing and improving the Work, but
|
248 |
+
excluding communication that is conspicuously marked or otherwise
|
249 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
250 |
+
|
251 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
252 |
+
on behalf of whom a Contribution has been received by Licensor and
|
253 |
+
subsequently incorporated within the Work.
|
254 |
+
|
255 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
256 |
+
this License, each Contributor hereby grants to You a perpetual,
|
257 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
258 |
+
copyright license to reproduce, prepare Derivative Works of,
|
259 |
+
publicly display, publicly perform, sublicense, and distribute the
|
260 |
+
Work and such Derivative Works in Source or Object form.
|
261 |
+
|
262 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
263 |
+
this License, each Contributor hereby grants to You a perpetual,
|
264 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
265 |
+
(except as stated in this section) patent license to make, have made,
|
266 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
267 |
+
where such license applies only to those patent claims licensable
|
268 |
+
by such Contributor that are necessarily infringed by their
|
269 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
270 |
+
with the Work to which such Contribution(s) was submitted. If You
|
271 |
+
institute patent litigation against any entity (including a
|
272 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
273 |
+
or a Contribution incorporated within the Work constitutes direct
|
274 |
+
or contributory patent infringement, then any patent licenses
|
275 |
+
granted to You under this License for that Work shall terminate
|
276 |
+
as of the date such litigation is filed.
|
277 |
+
|
278 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
279 |
+
Work or Derivative Works thereof in any medium, with or without
|
280 |
+
modifications, and in Source or Object form, provided that You
|
281 |
+
meet the following conditions:
|
282 |
+
|
283 |
+
(a) You must give any other recipients of the Work or
|
284 |
+
Derivative Works a copy of this License; and
|
285 |
+
|
286 |
+
(b) You must cause any modified files to carry prominent notices
|
287 |
+
stating that You changed the files; and
|
288 |
+
|
289 |
+
(c) You must retain, in the Source form of any Derivative Works
|
290 |
+
that You distribute, all copyright, patent, trademark, and
|
291 |
+
attribution notices from the Source form of the Work,
|
292 |
+
excluding those notices that do not pertain to any part of
|
293 |
+
the Derivative Works; and
|
294 |
+
|
295 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
296 |
+
distribution, then any Derivative Works that You distribute must
|
297 |
+
include a readable copy of the attribution notices contained
|
298 |
+
within such NOTICE file, excluding those notices that do not
|
299 |
+
pertain to any part of the Derivative Works, in at least one
|
300 |
+
of the following places: within a NOTICE text file distributed
|
301 |
+
as part of the Derivative Works; within the Source form or
|
302 |
+
documentation, if provided along with the Derivative Works; or,
|
303 |
+
within a display generated by the Derivative Works, if and
|
304 |
+
wherever such third-party notices normally appear. The contents
|
305 |
+
of the NOTICE file are for informational purposes only and
|
306 |
+
do not modify the License. You may add Your own attribution
|
307 |
+
notices within Derivative Works that You distribute, alongside
|
308 |
+
or as an addendum to the NOTICE text from the Work, provided
|
309 |
+
that such additional attribution notices cannot be construed
|
310 |
+
as modifying the License.
|
311 |
+
|
312 |
+
You may add Your own copyright statement to Your modifications and
|
313 |
+
may provide additional or different license terms and conditions
|
314 |
+
for use, reproduction, or distribution of Your modifications, or
|
315 |
+
for any such Derivative Works as a whole, provided Your use,
|
316 |
+
reproduction, and distribution of the Work otherwise complies with
|
317 |
+
the conditions stated in this License.
|
318 |
+
|
319 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
320 |
+
any Contribution intentionally submitted for inclusion in the Work
|
321 |
+
by You to the Licensor shall be under the terms and conditions of
|
322 |
+
this License, without any additional terms or conditions.
|
323 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
324 |
+
the terms of any separate license agreement you may have executed
|
325 |
+
with Licensor regarding such Contributions.
|
326 |
+
|
327 |
+
6. Trademarks. This License does not grant permission to use the trade
|
328 |
+
names, trademarks, service marks, or product names of the Licensor,
|
329 |
+
except as required for reasonable and customary use in describing the
|
330 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
331 |
+
|
332 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
333 |
+
agreed to in writing, Licensor provides the Work (and each
|
334 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
335 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
336 |
+
implied, including, without limitation, any warranties or conditions
|
337 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
338 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
339 |
+
appropriateness of using or redistributing the Work and assume any
|
340 |
+
risks associated with Your exercise of permissions under this License.
|
341 |
+
|
342 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
343 |
+
whether in tort (including negligence), contract, or otherwise,
|
344 |
+
unless required by applicable law (such as deliberate and grossly
|
345 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
346 |
+
liable to You for damages, including any direct, indirect, special,
|
347 |
+
incidental, or consequential damages of any character arising as a
|
348 |
+
result of this License or out of the use or inability to use the
|
349 |
+
Work (including but not limited to damages for loss of goodwill,
|
350 |
+
work stoppage, computer failure or malfunction, or any and all
|
351 |
+
other commercial damages or losses), even if such Contributor
|
352 |
+
has been advised of the possibility of such damages.
|
353 |
+
|
354 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
355 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
356 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
357 |
+
or other liability obligations and/or rights consistent with this
|
358 |
+
License. However, in accepting such obligations, You may act only
|
359 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
360 |
+
of any other Contributor, and only if You agree to indemnify,
|
361 |
+
defend, and hold each Contributor harmless for any liability
|
362 |
+
incurred by, or claims asserted against, such Contributor by reason
|
363 |
+
of your accepting any such warranty or additional liability.
|
364 |
+
|
365 |
+
END OF TERMS AND CONDITIONS
|
366 |
+
|
367 |
+
APPENDIX: How to apply the Apache License to your work.
|
368 |
+
|
369 |
+
To apply the Apache License to your work, attach the following
|
370 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
371 |
+
replaced with your own identifying information. (Don't include
|
372 |
+
the brackets!) The text should be enclosed in the appropriate
|
373 |
+
comment syntax for the file format. We also recommend that a
|
374 |
+
file or class name and description of purpose be included on the
|
375 |
+
same "printed page" as the copyright notice for easier
|
376 |
+
identification within third-party archives.
|
377 |
+
|
378 |
+
Copyright [2021] [SwinIR Authors]
|
379 |
+
|
380 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
381 |
+
you may not use this file except in compliance with the License.
|
382 |
+
You may obtain a copy of the License at
|
383 |
+
|
384 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
385 |
+
|
386 |
+
Unless required by applicable law or agreed to in writing, software
|
387 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
388 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
389 |
+
See the License for the specific language governing permissions and
|
390 |
+
limitations under the License.
|
391 |
+
</pre>
|
392 |
+
|
393 |
+
<h2><a href="https://github.com/AminRezaei0x443/memory-efficient-attention/blob/main/LICENSE">Memory Efficient Attention</a></h2>
|
394 |
+
<small>The sub-quadratic cross attention optimization uses modified code from the Memory Efficient Attention package that Alex Birch optimized for 3D tensors. This license is updated to reflect that.</small>
|
395 |
+
<pre>
|
396 |
+
MIT License
|
397 |
+
|
398 |
+
Copyright (c) 2023 Alex Birch
|
399 |
+
Copyright (c) 2023 Amin Rezaei
|
400 |
+
|
401 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
402 |
+
of this software and associated documentation files (the "Software"), to deal
|
403 |
+
in the Software without restriction, including without limitation the rights
|
404 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
405 |
+
copies of the Software, and to permit persons to whom the Software is
|
406 |
+
furnished to do so, subject to the following conditions:
|
407 |
+
|
408 |
+
The above copyright notice and this permission notice shall be included in all
|
409 |
+
copies or substantial portions of the Software.
|
410 |
+
|
411 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
412 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
413 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
414 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
415 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
416 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
417 |
+
SOFTWARE.
|
418 |
+
</pre>
|
419 |
+
|
420 |
+
<h2><a href="https://github.com/huggingface/diffusers/blob/c7da8fd23359a22d0df2741688b5b4f33c26df21/LICENSE">Scaled Dot Product Attention</a></h2>
|
421 |
+
<small>Some small amounts of code borrowed and reworked.</small>
|
422 |
+
<pre>
|
423 |
+
Copyright 2023 The HuggingFace Team. All rights reserved.
|
424 |
+
|
425 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
426 |
+
you may not use this file except in compliance with the License.
|
427 |
+
You may obtain a copy of the License at
|
428 |
+
|
429 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
430 |
+
|
431 |
+
Unless required by applicable law or agreed to in writing, software
|
432 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
433 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
434 |
+
See the License for the specific language governing permissions and
|
435 |
+
limitations under the License.
|
436 |
+
|
437 |
+
Apache License
|
438 |
+
Version 2.0, January 2004
|
439 |
+
http://www.apache.org/licenses/
|
440 |
+
|
441 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
442 |
+
|
443 |
+
1. Definitions.
|
444 |
+
|
445 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
446 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
447 |
+
|
448 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
449 |
+
the copyright owner that is granting the License.
|
450 |
+
|
451 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
452 |
+
other entities that control, are controlled by, or are under common
|
453 |
+
control with that entity. For the purposes of this definition,
|
454 |
+
"control" means (i) the power, direct or indirect, to cause the
|
455 |
+
direction or management of such entity, whether by contract or
|
456 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
457 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
458 |
+
|
459 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
460 |
+
exercising permissions granted by this License.
|
461 |
+
|
462 |
+
"Source" form shall mean the preferred form for making modifications,
|
463 |
+
including but not limited to software source code, documentation
|
464 |
+
source, and configuration files.
|
465 |
+
|
466 |
+
"Object" form shall mean any form resulting from mechanical
|
467 |
+
transformation or translation of a Source form, including but
|
468 |
+
not limited to compiled object code, generated documentation,
|
469 |
+
and conversions to other media types.
|
470 |
+
|
471 |
+
"Work" shall mean the work of authorship, whether in Source or
|
472 |
+
Object form, made available under the License, as indicated by a
|
473 |
+
copyright notice that is included in or attached to the work
|
474 |
+
(an example is provided in the Appendix below).
|
475 |
+
|
476 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
477 |
+
form, that is based on (or derived from) the Work and for which the
|
478 |
+
editorial revisions, annotations, elaborations, or other modifications
|
479 |
+
represent, as a whole, an original work of authorship. For the purposes
|
480 |
+
of this License, Derivative Works shall not include works that remain
|
481 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
482 |
+
the Work and Derivative Works thereof.
|
483 |
+
|
484 |
+
"Contribution" shall mean any work of authorship, including
|
485 |
+
the original version of the Work and any modifications or additions
|
486 |
+
to that Work or Derivative Works thereof, that is intentionally
|
487 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
488 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
489 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
490 |
+
means any form of electronic, verbal, or written communication sent
|
491 |
+
to the Licensor or its representatives, including but not limited to
|
492 |
+
communication on electronic mailing lists, source code control systems,
|
493 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
494 |
+
Licensor for the purpose of discussing and improving the Work, but
|
495 |
+
excluding communication that is conspicuously marked or otherwise
|
496 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
497 |
+
|
498 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
499 |
+
on behalf of whom a Contribution has been received by Licensor and
|
500 |
+
subsequently incorporated within the Work.
|
501 |
+
|
502 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
503 |
+
this License, each Contributor hereby grants to You a perpetual,
|
504 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
505 |
+
copyright license to reproduce, prepare Derivative Works of,
|
506 |
+
publicly display, publicly perform, sublicense, and distribute the
|
507 |
+
Work and such Derivative Works in Source or Object form.
|
508 |
+
|
509 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
510 |
+
this License, each Contributor hereby grants to You a perpetual,
|
511 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
512 |
+
(except as stated in this section) patent license to make, have made,
|
513 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
514 |
+
where such license applies only to those patent claims licensable
|
515 |
+
by such Contributor that are necessarily infringed by their
|
516 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
517 |
+
with the Work to which such Contribution(s) was submitted. If You
|
518 |
+
institute patent litigation against any entity (including a
|
519 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
520 |
+
or a Contribution incorporated within the Work constitutes direct
|
521 |
+
or contributory patent infringement, then any patent licenses
|
522 |
+
granted to You under this License for that Work shall terminate
|
523 |
+
as of the date such litigation is filed.
|
524 |
+
|
525 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
526 |
+
Work or Derivative Works thereof in any medium, with or without
|
527 |
+
modifications, and in Source or Object form, provided that You
|
528 |
+
meet the following conditions:
|
529 |
+
|
530 |
+
(a) You must give any other recipients of the Work or
|
531 |
+
Derivative Works a copy of this License; and
|
532 |
+
|
533 |
+
(b) You must cause any modified files to carry prominent notices
|
534 |
+
stating that You changed the files; and
|
535 |
+
|
536 |
+
(c) You must retain, in the Source form of any Derivative Works
|
537 |
+
that You distribute, all copyright, patent, trademark, and
|
538 |
+
attribution notices from the Source form of the Work,
|
539 |
+
excluding those notices that do not pertain to any part of
|
540 |
+
the Derivative Works; and
|
541 |
+
|
542 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
543 |
+
distribution, then any Derivative Works that You distribute must
|
544 |
+
include a readable copy of the attribution notices contained
|
545 |
+
within such NOTICE file, excluding those notices that do not
|
546 |
+
pertain to any part of the Derivative Works, in at least one
|
547 |
+
of the following places: within a NOTICE text file distributed
|
548 |
+
as part of the Derivative Works; within the Source form or
|
549 |
+
documentation, if provided along with the Derivative Works; or,
|
550 |
+
within a display generated by the Derivative Works, if and
|
551 |
+
wherever such third-party notices normally appear. The contents
|
552 |
+
of the NOTICE file are for informational purposes only and
|
553 |
+
do not modify the License. You may add Your own attribution
|
554 |
+
notices within Derivative Works that You distribute, alongside
|
555 |
+
or as an addendum to the NOTICE text from the Work, provided
|
556 |
+
that such additional attribution notices cannot be construed
|
557 |
+
as modifying the License.
|
558 |
+
|
559 |
+
You may add Your own copyright statement to Your modifications and
|
560 |
+
may provide additional or different license terms and conditions
|
561 |
+
for use, reproduction, or distribution of Your modifications, or
|
562 |
+
for any such Derivative Works as a whole, provided Your use,
|
563 |
+
reproduction, and distribution of the Work otherwise complies with
|
564 |
+
the conditions stated in this License.
|
565 |
+
|
566 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
567 |
+
any Contribution intentionally submitted for inclusion in the Work
|
568 |
+
by You to the Licensor shall be under the terms and conditions of
|
569 |
+
this License, without any additional terms or conditions.
|
570 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
571 |
+
the terms of any separate license agreement you may have executed
|
572 |
+
with Licensor regarding such Contributions.
|
573 |
+
|
574 |
+
6. Trademarks. This License does not grant permission to use the trade
|
575 |
+
names, trademarks, service marks, or product names of the Licensor,
|
576 |
+
except as required for reasonable and customary use in describing the
|
577 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
578 |
+
|
579 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
580 |
+
agreed to in writing, Licensor provides the Work (and each
|
581 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
582 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
583 |
+
implied, including, without limitation, any warranties or conditions
|
584 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
585 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
586 |
+
appropriateness of using or redistributing the Work and assume any
|
587 |
+
risks associated with Your exercise of permissions under this License.
|
588 |
+
|
589 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
590 |
+
whether in tort (including negligence), contract, or otherwise,
|
591 |
+
unless required by applicable law (such as deliberate and grossly
|
592 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
593 |
+
liable to You for damages, including any direct, indirect, special,
|
594 |
+
incidental, or consequential damages of any character arising as a
|
595 |
+
result of this License or out of the use or inability to use the
|
596 |
+
Work (including but not limited to damages for loss of goodwill,
|
597 |
+
work stoppage, computer failure or malfunction, or any and all
|
598 |
+
other commercial damages or losses), even if such Contributor
|
599 |
+
has been advised of the possibility of such damages.
|
600 |
+
|
601 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
602 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
603 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
604 |
+
or other liability obligations and/or rights consistent with this
|
605 |
+
License. However, in accepting such obligations, You may act only
|
606 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
607 |
+
of any other Contributor, and only if You agree to indemnify,
|
608 |
+
defend, and hold each Contributor harmless for any liability
|
609 |
+
incurred by, or claims asserted against, such Contributor by reason
|
610 |
+
of your accepting any such warranty or additional liability.
|
611 |
+
|
612 |
+
END OF TERMS AND CONDITIONS
|
613 |
+
|
614 |
+
APPENDIX: How to apply the Apache License to your work.
|
615 |
+
|
616 |
+
To apply the Apache License to your work, attach the following
|
617 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
618 |
+
replaced with your own identifying information. (Don't include
|
619 |
+
the brackets!) The text should be enclosed in the appropriate
|
620 |
+
comment syntax for the file format. We also recommend that a
|
621 |
+
file or class name and description of purpose be included on the
|
622 |
+
same "printed page" as the copyright notice for easier
|
623 |
+
identification within third-party archives.
|
624 |
+
|
625 |
+
Copyright [yyyy] [name of copyright owner]
|
626 |
+
|
627 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
628 |
+
you may not use this file except in compliance with the License.
|
629 |
+
You may obtain a copy of the License at
|
630 |
+
|
631 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
632 |
+
|
633 |
+
Unless required by applicable law or agreed to in writing, software
|
634 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
635 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
636 |
+
See the License for the specific language governing permissions and
|
637 |
+
limitations under the License.
|
638 |
+
</pre>
|
639 |
+
|
640 |
+
<h2><a href="https://github.com/explosion/curated-transformers/blob/main/LICENSE">Curated transformers</a></h2>
|
641 |
+
<small>The MPS workaround for nn.Linear on macOS 13.2.X is based on the MPS workaround for nn.Linear created by danieldk for Curated transformers</small>
|
642 |
+
<pre>
|
643 |
+
The MIT License (MIT)
|
644 |
+
|
645 |
+
Copyright (C) 2021 ExplosionAI GmbH
|
646 |
+
|
647 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
648 |
+
of this software and associated documentation files (the "Software"), to deal
|
649 |
+
in the Software without restriction, including without limitation the rights
|
650 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
651 |
+
copies of the Software, and to permit persons to whom the Software is
|
652 |
+
furnished to do so, subject to the following conditions:
|
653 |
+
|
654 |
+
The above copyright notice and this permission notice shall be included in
|
655 |
+
all copies or substantial portions of the Software.
|
656 |
+
|
657 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
658 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
659 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
660 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
661 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
662 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
663 |
+
THE SOFTWARE.
|
664 |
+
</pre>
|
665 |
+
|
666 |
+
<h2><a href="https://github.com/madebyollin/taesd/blob/main/LICENSE">TAESD</a></h2>
|
667 |
+
<small>Tiny AutoEncoder for Stable Diffusion option for live previews</small>
|
668 |
+
<pre>
|
669 |
+
MIT License
|
670 |
+
|
671 |
+
Copyright (c) 2023 Ollin Boer Bohan
|
672 |
+
|
673 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
674 |
+
of this software and associated documentation files (the "Software"), to deal
|
675 |
+
in the Software without restriction, including without limitation the rights
|
676 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
677 |
+
copies of the Software, and to permit persons to whom the Software is
|
678 |
+
furnished to do so, subject to the following conditions:
|
679 |
+
|
680 |
+
The above copyright notice and this permission notice shall be included in all
|
681 |
+
copies or substantial portions of the Software.
|
682 |
+
|
683 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
684 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
685 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
686 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
687 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
688 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
689 |
+
SOFTWARE.
|
690 |
+
</pre>
|
stable-diffusion-webui/javascript/dragdrop.js
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// allows drag-dropping files into gradio image elements, and also pasting images from clipboard
|
2 |
+
|
3 |
+
function isValidImageList(files) {
|
4 |
+
return files && files?.length === 1 && ['image/png', 'image/gif', 'image/jpeg'].includes(files[0].type);
|
5 |
+
}
|
6 |
+
|
7 |
+
function dropReplaceImage(imgWrap, files) {
|
8 |
+
if (!isValidImageList(files)) {
|
9 |
+
return;
|
10 |
+
}
|
11 |
+
|
12 |
+
const tmpFile = files[0];
|
13 |
+
|
14 |
+
imgWrap.querySelector('.modify-upload button + button, .touch-none + div button + button')?.click();
|
15 |
+
const callback = () => {
|
16 |
+
const fileInput = imgWrap.querySelector('input[type="file"]');
|
17 |
+
if (fileInput) {
|
18 |
+
if (files.length === 0) {
|
19 |
+
files = new DataTransfer();
|
20 |
+
files.items.add(tmpFile);
|
21 |
+
fileInput.files = files.files;
|
22 |
+
} else {
|
23 |
+
fileInput.files = files;
|
24 |
+
}
|
25 |
+
fileInput.dispatchEvent(new Event('change'));
|
26 |
+
}
|
27 |
+
};
|
28 |
+
|
29 |
+
if (imgWrap.closest('#pnginfo_image')) {
|
30 |
+
// special treatment for PNG Info tab, wait for fetch request to finish
|
31 |
+
const oldFetch = window.fetch;
|
32 |
+
window.fetch = async(input, options) => {
|
33 |
+
const response = await oldFetch(input, options);
|
34 |
+
if ('api/predict/' === input) {
|
35 |
+
const content = await response.text();
|
36 |
+
window.fetch = oldFetch;
|
37 |
+
window.requestAnimationFrame(() => callback());
|
38 |
+
return new Response(content, {
|
39 |
+
status: response.status,
|
40 |
+
statusText: response.statusText,
|
41 |
+
headers: response.headers
|
42 |
+
});
|
43 |
+
}
|
44 |
+
return response;
|
45 |
+
};
|
46 |
+
} else {
|
47 |
+
window.requestAnimationFrame(() => callback());
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
function eventHasFiles(e) {
|
52 |
+
if (!e.dataTransfer || !e.dataTransfer.files) return false;
|
53 |
+
if (e.dataTransfer.files.length > 0) return true;
|
54 |
+
if (e.dataTransfer.items.length > 0 && e.dataTransfer.items[0].kind == "file") return true;
|
55 |
+
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
|
59 |
+
function dragDropTargetIsPrompt(target) {
|
60 |
+
if (target?.placeholder && target?.placeholder.indexOf("Prompt") >= 0) return true;
|
61 |
+
if (target?.parentNode?.parentNode?.className?.indexOf("prompt") > 0) return true;
|
62 |
+
return false;
|
63 |
+
}
|
64 |
+
|
65 |
+
window.document.addEventListener('dragover', e => {
|
66 |
+
const target = e.composedPath()[0];
|
67 |
+
if (!eventHasFiles(e)) return;
|
68 |
+
|
69 |
+
var targetImage = target.closest('[data-testid="image"]');
|
70 |
+
if (!dragDropTargetIsPrompt(target) && !targetImage) return;
|
71 |
+
|
72 |
+
e.stopPropagation();
|
73 |
+
e.preventDefault();
|
74 |
+
e.dataTransfer.dropEffect = 'copy';
|
75 |
+
});
|
76 |
+
|
77 |
+
window.document.addEventListener('drop', e => {
|
78 |
+
const target = e.composedPath()[0];
|
79 |
+
if (!eventHasFiles(e)) return;
|
80 |
+
|
81 |
+
if (dragDropTargetIsPrompt(target)) {
|
82 |
+
e.stopPropagation();
|
83 |
+
e.preventDefault();
|
84 |
+
|
85 |
+
let prompt_target = get_tab_index('tabs') == 1 ? "img2img_prompt_image" : "txt2img_prompt_image";
|
86 |
+
|
87 |
+
const imgParent = gradioApp().getElementById(prompt_target);
|
88 |
+
const files = e.dataTransfer.files;
|
89 |
+
const fileInput = imgParent.querySelector('input[type="file"]');
|
90 |
+
if (fileInput) {
|
91 |
+
fileInput.files = files;
|
92 |
+
fileInput.dispatchEvent(new Event('change'));
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
var targetImage = target.closest('[data-testid="image"]');
|
97 |
+
if (targetImage) {
|
98 |
+
e.stopPropagation();
|
99 |
+
e.preventDefault();
|
100 |
+
const files = e.dataTransfer.files;
|
101 |
+
dropReplaceImage(targetImage, files);
|
102 |
+
return;
|
103 |
+
}
|
104 |
+
});
|
105 |
+
|
106 |
+
window.addEventListener('paste', e => {
|
107 |
+
const files = e.clipboardData.files;
|
108 |
+
if (!isValidImageList(files)) {
|
109 |
+
return;
|
110 |
+
}
|
111 |
+
|
112 |
+
const visibleImageFields = [...gradioApp().querySelectorAll('[data-testid="image"]')]
|
113 |
+
.filter(el => uiElementIsVisible(el))
|
114 |
+
.sort((a, b) => uiElementInSight(b) - uiElementInSight(a));
|
115 |
+
|
116 |
+
|
117 |
+
if (!visibleImageFields.length) {
|
118 |
+
return;
|
119 |
+
}
|
120 |
+
|
121 |
+
const firstFreeImageField = visibleImageFields
|
122 |
+
.filter(el => el.querySelector('input[type=file]'))?.[0];
|
123 |
+
|
124 |
+
dropReplaceImage(
|
125 |
+
firstFreeImageField ?
|
126 |
+
firstFreeImageField :
|
127 |
+
visibleImageFields[visibleImageFields.length - 1]
|
128 |
+
, files
|
129 |
+
);
|
130 |
+
});
|
stable-diffusion-webui/javascript/edit-order.js
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* alt+left/right moves text in prompt */
|
2 |
+
|
3 |
+
function keyupEditOrder(event) {
|
4 |
+
if (!opts.keyedit_move) return;
|
5 |
+
|
6 |
+
let target = event.originalTarget || event.composedPath()[0];
|
7 |
+
if (!target.matches("*:is([id*='_toprow'] [id*='_prompt'], .prompt) textarea")) return;
|
8 |
+
if (!event.altKey) return;
|
9 |
+
|
10 |
+
let isLeft = event.key == "ArrowLeft";
|
11 |
+
let isRight = event.key == "ArrowRight";
|
12 |
+
if (!isLeft && !isRight) return;
|
13 |
+
event.preventDefault();
|
14 |
+
|
15 |
+
let selectionStart = target.selectionStart;
|
16 |
+
let selectionEnd = target.selectionEnd;
|
17 |
+
let text = target.value;
|
18 |
+
let items = text.split(",");
|
19 |
+
let indexStart = (text.slice(0, selectionStart).match(/,/g) || []).length;
|
20 |
+
let indexEnd = (text.slice(0, selectionEnd).match(/,/g) || []).length;
|
21 |
+
let range = indexEnd - indexStart + 1;
|
22 |
+
|
23 |
+
if (isLeft && indexStart > 0) {
|
24 |
+
items.splice(indexStart - 1, 0, ...items.splice(indexStart, range));
|
25 |
+
target.value = items.join();
|
26 |
+
target.selectionStart = items.slice(0, indexStart - 1).join().length + (indexStart == 1 ? 0 : 1);
|
27 |
+
target.selectionEnd = items.slice(0, indexEnd).join().length;
|
28 |
+
} else if (isRight && indexEnd < items.length - 1) {
|
29 |
+
items.splice(indexStart + 1, 0, ...items.splice(indexStart, range));
|
30 |
+
target.value = items.join();
|
31 |
+
target.selectionStart = items.slice(0, indexStart + 1).join().length + 1;
|
32 |
+
target.selectionEnd = items.slice(0, indexEnd + 2).join().length;
|
33 |
+
}
|
34 |
+
|
35 |
+
event.preventDefault();
|
36 |
+
updateInput(target);
|
37 |
+
}
|
38 |
+
|
39 |
+
addEventListener('keydown', (event) => {
|
40 |
+
keyupEditOrder(event);
|
41 |
+
});
|
stable-diffusion-webui/javascript/extraNetworks.js
ADDED
@@ -0,0 +1,349 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function toggleCss(key, css, enable) {
|
2 |
+
var style = document.getElementById(key);
|
3 |
+
if (enable && !style) {
|
4 |
+
style = document.createElement('style');
|
5 |
+
style.id = key;
|
6 |
+
style.type = 'text/css';
|
7 |
+
document.head.appendChild(style);
|
8 |
+
}
|
9 |
+
if (style && !enable) {
|
10 |
+
document.head.removeChild(style);
|
11 |
+
}
|
12 |
+
if (style) {
|
13 |
+
style.innerHTML == '';
|
14 |
+
style.appendChild(document.createTextNode(css));
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
function setupExtraNetworksForTab(tabname) {
|
19 |
+
gradioApp().querySelector('#' + tabname + '_extra_tabs').classList.add('extra-networks');
|
20 |
+
|
21 |
+
var tabs = gradioApp().querySelector('#' + tabname + '_extra_tabs > div');
|
22 |
+
var searchDiv = gradioApp().getElementById(tabname + '_extra_search');
|
23 |
+
var search = searchDiv.querySelector('textarea');
|
24 |
+
var sort = gradioApp().getElementById(tabname + '_extra_sort');
|
25 |
+
var sortOrder = gradioApp().getElementById(tabname + '_extra_sortorder');
|
26 |
+
var refresh = gradioApp().getElementById(tabname + '_extra_refresh');
|
27 |
+
var showDirsDiv = gradioApp().getElementById(tabname + '_extra_show_dirs');
|
28 |
+
var showDirs = gradioApp().querySelector('#' + tabname + '_extra_show_dirs input');
|
29 |
+
|
30 |
+
sort.dataset.sortkey = 'sortDefault';
|
31 |
+
tabs.appendChild(searchDiv);
|
32 |
+
tabs.appendChild(sort);
|
33 |
+
tabs.appendChild(sortOrder);
|
34 |
+
tabs.appendChild(refresh);
|
35 |
+
tabs.appendChild(showDirsDiv);
|
36 |
+
|
37 |
+
var applyFilter = function() {
|
38 |
+
var searchTerm = search.value.toLowerCase();
|
39 |
+
|
40 |
+
gradioApp().querySelectorAll('#' + tabname + '_extra_tabs div.card').forEach(function(elem) {
|
41 |
+
var searchOnly = elem.querySelector('.search_only');
|
42 |
+
var text = elem.querySelector('.name').textContent.toLowerCase() + " " + elem.querySelector('.search_term').textContent.toLowerCase();
|
43 |
+
|
44 |
+
var visible = text.indexOf(searchTerm) != -1;
|
45 |
+
|
46 |
+
if (searchOnly && searchTerm.length < 4) {
|
47 |
+
visible = false;
|
48 |
+
}
|
49 |
+
|
50 |
+
elem.style.display = visible ? "" : "none";
|
51 |
+
});
|
52 |
+
};
|
53 |
+
|
54 |
+
var applySort = function() {
|
55 |
+
var reverse = sortOrder.classList.contains("sortReverse");
|
56 |
+
var sortKey = sort.querySelector("input").value.toLowerCase().replace("sort", "").replaceAll(" ", "_").replace(/_+$/, "").trim();
|
57 |
+
sortKey = sortKey ? "sort" + sortKey.charAt(0).toUpperCase() + sortKey.slice(1) : "";
|
58 |
+
var sortKeyStore = sortKey ? sortKey + (reverse ? "Reverse" : "") : "";
|
59 |
+
if (!sortKey || sortKeyStore == sort.dataset.sortkey) {
|
60 |
+
return;
|
61 |
+
}
|
62 |
+
|
63 |
+
sort.dataset.sortkey = sortKeyStore;
|
64 |
+
|
65 |
+
var cards = gradioApp().querySelectorAll('#' + tabname + '_extra_tabs div.card');
|
66 |
+
cards.forEach(function(card) {
|
67 |
+
card.originalParentElement = card.parentElement;
|
68 |
+
});
|
69 |
+
var sortedCards = Array.from(cards);
|
70 |
+
sortedCards.sort(function(cardA, cardB) {
|
71 |
+
var a = cardA.dataset[sortKey];
|
72 |
+
var b = cardB.dataset[sortKey];
|
73 |
+
if (!isNaN(a) && !isNaN(b)) {
|
74 |
+
return parseInt(a) - parseInt(b);
|
75 |
+
}
|
76 |
+
|
77 |
+
return (a < b ? -1 : (a > b ? 1 : 0));
|
78 |
+
});
|
79 |
+
if (reverse) {
|
80 |
+
sortedCards.reverse();
|
81 |
+
}
|
82 |
+
cards.forEach(function(card) {
|
83 |
+
card.remove();
|
84 |
+
});
|
85 |
+
sortedCards.forEach(function(card) {
|
86 |
+
card.originalParentElement.appendChild(card);
|
87 |
+
});
|
88 |
+
};
|
89 |
+
|
90 |
+
search.addEventListener("input", applyFilter);
|
91 |
+
applyFilter();
|
92 |
+
["change", "blur", "click"].forEach(function(evt) {
|
93 |
+
sort.querySelector("input").addEventListener(evt, applySort);
|
94 |
+
});
|
95 |
+
sortOrder.addEventListener("click", function() {
|
96 |
+
sortOrder.classList.toggle("sortReverse");
|
97 |
+
applySort();
|
98 |
+
});
|
99 |
+
|
100 |
+
extraNetworksApplyFilter[tabname] = applyFilter;
|
101 |
+
|
102 |
+
var showDirsUpdate = function() {
|
103 |
+
var css = '#' + tabname + '_extra_tabs .extra-network-subdirs { display: none; }';
|
104 |
+
toggleCss(tabname + '_extra_show_dirs_style', css, !showDirs.checked);
|
105 |
+
localSet('extra-networks-show-dirs', showDirs.checked ? 1 : 0);
|
106 |
+
};
|
107 |
+
showDirs.checked = localGet('extra-networks-show-dirs', 1) == 1;
|
108 |
+
showDirs.addEventListener("change", showDirsUpdate);
|
109 |
+
showDirsUpdate();
|
110 |
+
}
|
111 |
+
|
112 |
+
function applyExtraNetworkFilter(tabname) {
|
113 |
+
setTimeout(extraNetworksApplyFilter[tabname], 1);
|
114 |
+
}
|
115 |
+
|
116 |
+
var extraNetworksApplyFilter = {};
|
117 |
+
var activePromptTextarea = {};
|
118 |
+
|
119 |
+
function setupExtraNetworks() {
|
120 |
+
setupExtraNetworksForTab('txt2img');
|
121 |
+
setupExtraNetworksForTab('img2img');
|
122 |
+
|
123 |
+
function registerPrompt(tabname, id) {
|
124 |
+
var textarea = gradioApp().querySelector("#" + id + " > label > textarea");
|
125 |
+
|
126 |
+
if (!activePromptTextarea[tabname]) {
|
127 |
+
activePromptTextarea[tabname] = textarea;
|
128 |
+
}
|
129 |
+
|
130 |
+
textarea.addEventListener("focus", function() {
|
131 |
+
activePromptTextarea[tabname] = textarea;
|
132 |
+
});
|
133 |
+
}
|
134 |
+
|
135 |
+
registerPrompt('txt2img', 'txt2img_prompt');
|
136 |
+
registerPrompt('txt2img', 'txt2img_neg_prompt');
|
137 |
+
registerPrompt('img2img', 'img2img_prompt');
|
138 |
+
registerPrompt('img2img', 'img2img_neg_prompt');
|
139 |
+
}
|
140 |
+
|
141 |
+
onUiLoaded(setupExtraNetworks);
|
142 |
+
|
143 |
+
var re_extranet = /<([^:]+:[^:]+):[\d.]+>(.*)/;
|
144 |
+
var re_extranet_g = /\s+<([^:]+:[^:]+):[\d.]+>/g;
|
145 |
+
|
146 |
+
function tryToRemoveExtraNetworkFromPrompt(textarea, text) {
|
147 |
+
var m = text.match(re_extranet);
|
148 |
+
var replaced = false;
|
149 |
+
var newTextareaText;
|
150 |
+
if (m) {
|
151 |
+
var extraTextAfterNet = m[2];
|
152 |
+
var partToSearch = m[1];
|
153 |
+
var foundAtPosition = -1;
|
154 |
+
newTextareaText = textarea.value.replaceAll(re_extranet_g, function(found, net, pos) {
|
155 |
+
m = found.match(re_extranet);
|
156 |
+
if (m[1] == partToSearch) {
|
157 |
+
replaced = true;
|
158 |
+
foundAtPosition = pos;
|
159 |
+
return "";
|
160 |
+
}
|
161 |
+
return found;
|
162 |
+
});
|
163 |
+
|
164 |
+
if (foundAtPosition >= 0 && newTextareaText.substr(foundAtPosition, extraTextAfterNet.length) == extraTextAfterNet) {
|
165 |
+
newTextareaText = newTextareaText.substr(0, foundAtPosition) + newTextareaText.substr(foundAtPosition + extraTextAfterNet.length);
|
166 |
+
}
|
167 |
+
} else {
|
168 |
+
newTextareaText = textarea.value.replaceAll(new RegExp(text, "g"), function(found) {
|
169 |
+
if (found == text) {
|
170 |
+
replaced = true;
|
171 |
+
return "";
|
172 |
+
}
|
173 |
+
return found;
|
174 |
+
});
|
175 |
+
}
|
176 |
+
|
177 |
+
if (replaced) {
|
178 |
+
textarea.value = newTextareaText;
|
179 |
+
return true;
|
180 |
+
}
|
181 |
+
|
182 |
+
return false;
|
183 |
+
}
|
184 |
+
|
185 |
+
function cardClicked(tabname, textToAdd, allowNegativePrompt) {
|
186 |
+
var textarea = allowNegativePrompt ? activePromptTextarea[tabname] : gradioApp().querySelector("#" + tabname + "_prompt > label > textarea");
|
187 |
+
|
188 |
+
if (!tryToRemoveExtraNetworkFromPrompt(textarea, textToAdd)) {
|
189 |
+
textarea.value = textarea.value + opts.extra_networks_add_text_separator + textToAdd;
|
190 |
+
}
|
191 |
+
|
192 |
+
updateInput(textarea);
|
193 |
+
}
|
194 |
+
|
195 |
+
function saveCardPreview(event, tabname, filename) {
|
196 |
+
var textarea = gradioApp().querySelector("#" + tabname + '_preview_filename > label > textarea');
|
197 |
+
var button = gradioApp().getElementById(tabname + '_save_preview');
|
198 |
+
|
199 |
+
textarea.value = filename;
|
200 |
+
updateInput(textarea);
|
201 |
+
|
202 |
+
button.click();
|
203 |
+
|
204 |
+
event.stopPropagation();
|
205 |
+
event.preventDefault();
|
206 |
+
}
|
207 |
+
|
208 |
+
function extraNetworksSearchButton(tabs_id, event) {
|
209 |
+
var searchTextarea = gradioApp().querySelector("#" + tabs_id + ' > label > textarea');
|
210 |
+
var button = event.target;
|
211 |
+
var text = button.classList.contains("search-all") ? "" : button.textContent.trim();
|
212 |
+
|
213 |
+
searchTextarea.value = text;
|
214 |
+
updateInput(searchTextarea);
|
215 |
+
}
|
216 |
+
|
217 |
+
var globalPopup = null;
|
218 |
+
var globalPopupInner = null;
|
219 |
+
function closePopup() {
|
220 |
+
if (!globalPopup) return;
|
221 |
+
|
222 |
+
globalPopup.style.display = "none";
|
223 |
+
}
|
224 |
+
function popup(contents) {
|
225 |
+
if (!globalPopup) {
|
226 |
+
globalPopup = document.createElement('div');
|
227 |
+
globalPopup.onclick = closePopup;
|
228 |
+
globalPopup.classList.add('global-popup');
|
229 |
+
|
230 |
+
var close = document.createElement('div');
|
231 |
+
close.classList.add('global-popup-close');
|
232 |
+
close.onclick = closePopup;
|
233 |
+
close.title = "Close";
|
234 |
+
globalPopup.appendChild(close);
|
235 |
+
|
236 |
+
globalPopupInner = document.createElement('div');
|
237 |
+
globalPopupInner.onclick = function(event) {
|
238 |
+
event.stopPropagation(); return false;
|
239 |
+
};
|
240 |
+
globalPopupInner.classList.add('global-popup-inner');
|
241 |
+
globalPopup.appendChild(globalPopupInner);
|
242 |
+
|
243 |
+
gradioApp().querySelector('.main').appendChild(globalPopup);
|
244 |
+
}
|
245 |
+
|
246 |
+
globalPopupInner.innerHTML = '';
|
247 |
+
globalPopupInner.appendChild(contents);
|
248 |
+
|
249 |
+
globalPopup.style.display = "flex";
|
250 |
+
}
|
251 |
+
|
252 |
+
var storedPopupIds = {};
|
253 |
+
function popupId(id) {
|
254 |
+
if (!storedPopupIds[id]) {
|
255 |
+
storedPopupIds[id] = gradioApp().getElementById(id);
|
256 |
+
}
|
257 |
+
|
258 |
+
popup(storedPopupIds[id]);
|
259 |
+
}
|
260 |
+
|
261 |
+
function extraNetworksShowMetadata(text) {
|
262 |
+
var elem = document.createElement('pre');
|
263 |
+
elem.classList.add('popup-metadata');
|
264 |
+
elem.textContent = text;
|
265 |
+
|
266 |
+
popup(elem);
|
267 |
+
}
|
268 |
+
|
269 |
+
function requestGet(url, data, handler, errorHandler) {
|
270 |
+
var xhr = new XMLHttpRequest();
|
271 |
+
var args = Object.keys(data).map(function(k) {
|
272 |
+
return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]);
|
273 |
+
}).join('&');
|
274 |
+
xhr.open("GET", url + "?" + args, true);
|
275 |
+
|
276 |
+
xhr.onreadystatechange = function() {
|
277 |
+
if (xhr.readyState === 4) {
|
278 |
+
if (xhr.status === 200) {
|
279 |
+
try {
|
280 |
+
var js = JSON.parse(xhr.responseText);
|
281 |
+
handler(js);
|
282 |
+
} catch (error) {
|
283 |
+
console.error(error);
|
284 |
+
errorHandler();
|
285 |
+
}
|
286 |
+
} else {
|
287 |
+
errorHandler();
|
288 |
+
}
|
289 |
+
}
|
290 |
+
};
|
291 |
+
var js = JSON.stringify(data);
|
292 |
+
xhr.send(js);
|
293 |
+
}
|
294 |
+
|
295 |
+
function extraNetworksRequestMetadata(event, extraPage, cardName) {
|
296 |
+
var showError = function() {
|
297 |
+
extraNetworksShowMetadata("there was an error getting metadata");
|
298 |
+
};
|
299 |
+
|
300 |
+
requestGet("./sd_extra_networks/metadata", {page: extraPage, item: cardName}, function(data) {
|
301 |
+
if (data && data.metadata) {
|
302 |
+
extraNetworksShowMetadata(data.metadata);
|
303 |
+
} else {
|
304 |
+
showError();
|
305 |
+
}
|
306 |
+
}, showError);
|
307 |
+
|
308 |
+
event.stopPropagation();
|
309 |
+
}
|
310 |
+
|
311 |
+
var extraPageUserMetadataEditors = {};
|
312 |
+
|
313 |
+
function extraNetworksEditUserMetadata(event, tabname, extraPage, cardName) {
|
314 |
+
var id = tabname + '_' + extraPage + '_edit_user_metadata';
|
315 |
+
|
316 |
+
var editor = extraPageUserMetadataEditors[id];
|
317 |
+
if (!editor) {
|
318 |
+
editor = {};
|
319 |
+
editor.page = gradioApp().getElementById(id);
|
320 |
+
editor.nameTextarea = gradioApp().querySelector("#" + id + "_name" + ' textarea');
|
321 |
+
editor.button = gradioApp().querySelector("#" + id + "_button");
|
322 |
+
extraPageUserMetadataEditors[id] = editor;
|
323 |
+
}
|
324 |
+
|
325 |
+
editor.nameTextarea.value = cardName;
|
326 |
+
updateInput(editor.nameTextarea);
|
327 |
+
|
328 |
+
editor.button.click();
|
329 |
+
|
330 |
+
popup(editor.page);
|
331 |
+
|
332 |
+
event.stopPropagation();
|
333 |
+
}
|
334 |
+
|
335 |
+
function extraNetworksRefreshSingleCard(page, tabname, name) {
|
336 |
+
requestGet("./sd_extra_networks/get-single-card", {page: page, tabname: tabname, name: name}, function(data) {
|
337 |
+
if (data && data.html) {
|
338 |
+
var card = gradioApp().querySelector('.card[data-name=' + JSON.stringify(name) + ']'); // likely using the wrong stringify function
|
339 |
+
|
340 |
+
var newDiv = document.createElement('DIV');
|
341 |
+
newDiv.innerHTML = data.html;
|
342 |
+
var newCard = newDiv.firstElementChild;
|
343 |
+
|
344 |
+
newCard.style.display = '';
|
345 |
+
card.parentElement.insertBefore(newCard, card);
|
346 |
+
card.parentElement.removeChild(card);
|
347 |
+
}
|
348 |
+
});
|
349 |
+
}
|
stable-diffusion-webui/javascript/hints.js
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// mouseover tooltips for various UI elements
|
2 |
+
|
3 |
+
var titles = {
|
4 |
+
"Sampling steps": "How many times to improve the generated image iteratively; higher values take longer; very low values can produce bad results",
|
5 |
+
"Sampling method": "Which algorithm to use to produce the image",
|
6 |
+
"GFPGAN": "Restore low quality faces using GFPGAN neural network",
|
7 |
+
"Euler a": "Euler Ancestral - very creative, each can get a completely different picture depending on step count, setting steps higher than 30-40 does not help",
|
8 |
+
"DDIM": "Denoising Diffusion Implicit Models - best at inpainting",
|
9 |
+
"UniPC": "Unified Predictor-Corrector Framework for Fast Sampling of Diffusion Models",
|
10 |
+
"DPM adaptive": "Ignores step count - uses a number of steps determined by the CFG and resolution",
|
11 |
+
|
12 |
+
"\u{1F4D0}": "Auto detect size from img2img",
|
13 |
+
"Batch count": "How many batches of images to create (has no impact on generation performance or VRAM usage)",
|
14 |
+
"Batch size": "How many image to create in a single batch (increases generation performance at cost of higher VRAM usage)",
|
15 |
+
"CFG Scale": "Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results",
|
16 |
+
"Seed": "A value that determines the output of random number generator - if you create an image with same parameters and seed as another image, you'll get the same result",
|
17 |
+
"\u{1f3b2}\ufe0f": "Set seed to -1, which will cause a new random number to be used every time",
|
18 |
+
"\u267b\ufe0f": "Reuse seed from last generation, mostly useful if it was randomized",
|
19 |
+
"\u2199\ufe0f": "Read generation parameters from prompt or last generation if prompt is empty into user interface.",
|
20 |
+
"\u{1f4c2}": "Open images output directory",
|
21 |
+
"\u{1f4be}": "Save style",
|
22 |
+
"\u{1f5d1}\ufe0f": "Clear prompt",
|
23 |
+
"\u{1f4cb}": "Apply selected styles to current prompt",
|
24 |
+
"\u{1f4d2}": "Paste available values into the field",
|
25 |
+
"\u{1f3b4}": "Show/hide extra networks",
|
26 |
+
"\u{1f300}": "Restore progress",
|
27 |
+
|
28 |
+
"Inpaint a part of image": "Draw a mask over an image, and the script will regenerate the masked area with content according to prompt",
|
29 |
+
"SD upscale": "Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back",
|
30 |
+
|
31 |
+
"Just resize": "Resize image to target resolution. Unless height and width match, you will get incorrect aspect ratio.",
|
32 |
+
"Crop and resize": "Resize the image so that entirety of target resolution is filled with the image. Crop parts that stick out.",
|
33 |
+
"Resize and fill": "Resize the image so that entirety of image is inside target resolution. Fill empty space with image's colors.",
|
34 |
+
|
35 |
+
"Mask blur": "How much to blur the mask before processing, in pixels.",
|
36 |
+
"Masked content": "What to put inside the masked area before processing it with Stable Diffusion.",
|
37 |
+
"fill": "fill it with colors of the image",
|
38 |
+
"original": "keep whatever was there originally",
|
39 |
+
"latent noise": "fill it with latent space noise",
|
40 |
+
"latent nothing": "fill it with latent space zeroes",
|
41 |
+
"Inpaint at full resolution": "Upscale masked region to target resolution, do inpainting, downscale back and paste into original image",
|
42 |
+
|
43 |
+
"Denoising strength": "Determines how little respect the algorithm should have for image's content. At 0, nothing will change, and at 1 you'll get an unrelated image. With values below 1.0, processing will take less steps than the Sampling Steps slider specifies.",
|
44 |
+
|
45 |
+
"Skip": "Stop processing current image and continue processing.",
|
46 |
+
"Interrupt": "Stop processing images and return any results accumulated so far.",
|
47 |
+
"Save": "Write image to a directory (default - log/images) and generation parameters into csv file.",
|
48 |
+
|
49 |
+
"X values": "Separate values for X axis using commas.",
|
50 |
+
"Y values": "Separate values for Y axis using commas.",
|
51 |
+
|
52 |
+
"None": "Do not do anything special",
|
53 |
+
"Prompt matrix": "Separate prompts into parts using vertical pipe character (|) and the script will create a picture for every combination of them (except for the first part, which will be present in all combinations)",
|
54 |
+
"X/Y/Z plot": "Create grid(s) where images will have different parameters. Use inputs below to specify which parameters will be shared by columns and rows",
|
55 |
+
"Custom code": "Run Python code. Advanced user only. Must run program with --allow-code for this to work",
|
56 |
+
|
57 |
+
"Prompt S/R": "Separate a list of words with commas, and the first word will be used as a keyword: script will search for this word in the prompt, and replace it with others",
|
58 |
+
"Prompt order": "Separate a list of words with commas, and the script will make a variation of prompt with those words for their every possible order",
|
59 |
+
|
60 |
+
"Tiling": "Produce an image that can be tiled.",
|
61 |
+
"Tile overlap": "For SD upscale, how much overlap in pixels should there be between tiles. Tiles overlap so that when they are merged back into one picture, there is no clearly visible seam.",
|
62 |
+
|
63 |
+
"Variation seed": "Seed of a different picture to be mixed into the generation.",
|
64 |
+
"Variation strength": "How strong of a variation to produce. At 0, there will be no effect. At 1, you will get the complete picture with variation seed (except for ancestral samplers, where you will just get something).",
|
65 |
+
"Resize seed from height": "Make an attempt to produce a picture similar to what would have been produced with same seed at specified resolution",
|
66 |
+
"Resize seed from width": "Make an attempt to produce a picture similar to what would have been produced with same seed at specified resolution",
|
67 |
+
|
68 |
+
"Interrogate": "Reconstruct prompt from existing image and put it into the prompt field.",
|
69 |
+
|
70 |
+
"Images filename pattern": "Use tags like [seed] and [date] to define how filenames for images are chosen. Leave empty for default.",
|
71 |
+
"Directory name pattern": "Use tags like [seed] and [date] to define how subdirectories for images and grids are chosen. Leave empty for default.",
|
72 |
+
"Max prompt words": "Set the maximum number of words to be used in the [prompt_words] option; ATTENTION: If the words are too long, they may exceed the maximum length of the file path that the system can handle",
|
73 |
+
|
74 |
+
"Loopback": "Performs img2img processing multiple times. Output images are used as input for the next loop.",
|
75 |
+
"Loops": "How many times to process an image. Each output is used as the input of the next loop. If set to 1, behavior will be as if this script were not used.",
|
76 |
+
"Final denoising strength": "The denoising strength for the final loop of each image in the batch.",
|
77 |
+
"Denoising strength curve": "The denoising curve controls the rate of denoising strength change each loop. Aggressive: Most of the change will happen towards the start of the loops. Linear: Change will be constant through all loops. Lazy: Most of the change will happen towards the end of the loops.",
|
78 |
+
|
79 |
+
"Style 1": "Style to apply; styles have components for both positive and negative prompts and apply to both",
|
80 |
+
"Style 2": "Style to apply; styles have components for both positive and negative prompts and apply to both",
|
81 |
+
"Apply style": "Insert selected styles into prompt fields",
|
82 |
+
"Create style": "Save current prompts as a style. If you add the token {prompt} to the text, the style uses that as a placeholder for your prompt when you use the style in the future.",
|
83 |
+
|
84 |
+
"Checkpoint name": "Loads weights from checkpoint before making images. You can either use hash or a part of filename (as seen in settings) for checkpoint name. Recommended to use with Y axis for less switching.",
|
85 |
+
"Inpainting conditioning mask strength": "Only applies to inpainting models. Determines how strongly to mask off the original image for inpainting and img2img. 1.0 means fully masked, which is the default behaviour. 0.0 means a fully unmasked conditioning. Lower values will help preserve the overall composition of the image, but will struggle with large changes.",
|
86 |
+
|
87 |
+
"Eta noise seed delta": "If this values is non-zero, it will be added to seed and used to initialize RNG for noises when using samplers with Eta. You can use this to produce even more variation of images, or you can use this to match images of other software if you know what you are doing.",
|
88 |
+
|
89 |
+
"Filename word regex": "This regular expression will be used extract words from filename, and they will be joined using the option below into label text used for training. Leave empty to keep filename text as it is.",
|
90 |
+
"Filename join string": "This string will be used to join split words into a single line if the option above is enabled.",
|
91 |
+
|
92 |
+
"Quicksettings list": "List of setting names, separated by commas, for settings that should go to the quick access bar at the top, rather than the usual setting tab. See modules/shared.py for setting names. Requires restarting to apply.",
|
93 |
+
|
94 |
+
"Weighted sum": "Result = A * (1 - M) + B * M",
|
95 |
+
"Add difference": "Result = A + (B - C) * M",
|
96 |
+
"No interpolation": "Result = A",
|
97 |
+
|
98 |
+
"Initialization text": "If the number of tokens is more than the number of vectors, some may be skipped.\nLeave the textbox empty to start with zeroed out vectors",
|
99 |
+
"Learning rate": "How fast should training go. Low values will take longer to train, high values may fail to converge (not generate accurate results) and/or may break the embedding (This has happened if you see Loss: nan in the training info textbox. If this happens, you need to manually restore your embedding from an older not-broken backup).\n\nYou can set a single numeric value, or multiple learning rates using the syntax:\n\n rate_1:max_steps_1, rate_2:max_steps_2, ...\n\nEG: 0.005:100, 1e-3:1000, 1e-5\n\nWill train with rate of 0.005 for first 100 steps, then 1e-3 until 1000 steps, then 1e-5 for all remaining steps.",
|
100 |
+
|
101 |
+
"Clip skip": "Early stopping parameter for CLIP model; 1 is stop at last layer as usual, 2 is stop at penultimate layer, etc.",
|
102 |
+
|
103 |
+
"Approx NN": "Cheap neural network approximation. Very fast compared to VAE, but produces pictures with 4 times smaller horizontal/vertical resolution and lower quality.",
|
104 |
+
"Approx cheap": "Very cheap approximation. Very fast compared to VAE, but produces pictures with 8 times smaller horizontal/vertical resolution and extremely low quality.",
|
105 |
+
|
106 |
+
"Hires. fix": "Use a two step process to partially create an image at smaller resolution, upscale, and then improve details in it without changing composition",
|
107 |
+
"Hires steps": "Number of sampling steps for upscaled picture. If 0, uses same as for original.",
|
108 |
+
"Upscale by": "Adjusts the size of the image by multiplying the original width and height by the selected value. Ignored if either Resize width to or Resize height to are non-zero.",
|
109 |
+
"Resize width to": "Resizes image to this width. If 0, width is inferred from either of two nearby sliders.",
|
110 |
+
"Resize height to": "Resizes image to this height. If 0, height is inferred from either of two nearby sliders.",
|
111 |
+
"Discard weights with matching name": "Regular expression; if weights's name matches it, the weights is not written to the resulting checkpoint. Use ^model_ema to discard EMA weights.",
|
112 |
+
"Extra networks tab order": "Comma-separated list of tab names; tabs listed here will appear in the extra networks UI first and in order listed.",
|
113 |
+
"Negative Guidance minimum sigma": "Skip negative prompt for steps where image is already mostly denoised; the higher this value, the more skips there will be; provides increased performance in exchange for minor quality reduction."
|
114 |
+
};
|
115 |
+
|
116 |
+
function updateTooltip(element) {
|
117 |
+
if (element.title) return; // already has a title
|
118 |
+
|
119 |
+
let text = element.textContent;
|
120 |
+
let tooltip = localization[titles[text]] || titles[text];
|
121 |
+
|
122 |
+
if (!tooltip) {
|
123 |
+
let value = element.value;
|
124 |
+
if (value) tooltip = localization[titles[value]] || titles[value];
|
125 |
+
}
|
126 |
+
|
127 |
+
if (!tooltip) {
|
128 |
+
// Gradio dropdown options have `data-value`.
|
129 |
+
let dataValue = element.dataset.value;
|
130 |
+
if (dataValue) tooltip = localization[titles[dataValue]] || titles[dataValue];
|
131 |
+
}
|
132 |
+
|
133 |
+
if (!tooltip) {
|
134 |
+
for (const c of element.classList) {
|
135 |
+
if (c in titles) {
|
136 |
+
tooltip = localization[titles[c]] || titles[c];
|
137 |
+
break;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
if (tooltip) {
|
143 |
+
element.title = tooltip;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
// Nodes to check for adding tooltips.
|
148 |
+
const tooltipCheckNodes = new Set();
|
149 |
+
// Timer for debouncing tooltip check.
|
150 |
+
let tooltipCheckTimer = null;
|
151 |
+
|
152 |
+
function processTooltipCheckNodes() {
|
153 |
+
for (const node of tooltipCheckNodes) {
|
154 |
+
updateTooltip(node);
|
155 |
+
}
|
156 |
+
tooltipCheckNodes.clear();
|
157 |
+
}
|
158 |
+
|
159 |
+
onUiUpdate(function(mutationRecords) {
|
160 |
+
for (const record of mutationRecords) {
|
161 |
+
if (record.type === "childList" && record.target.classList.contains("options")) {
|
162 |
+
// This smells like a Gradio dropdown menu having changed,
|
163 |
+
// so let's enqueue an update for the input element that shows the current value.
|
164 |
+
let wrap = record.target.parentNode;
|
165 |
+
let input = wrap?.querySelector("input");
|
166 |
+
if (input) {
|
167 |
+
input.title = ""; // So we'll even have a chance to update it.
|
168 |
+
tooltipCheckNodes.add(input);
|
169 |
+
}
|
170 |
+
}
|
171 |
+
for (const node of record.addedNodes) {
|
172 |
+
if (node.nodeType === Node.ELEMENT_NODE && !node.classList.contains("hide")) {
|
173 |
+
if (!node.title) {
|
174 |
+
if (
|
175 |
+
node.tagName === "SPAN" ||
|
176 |
+
node.tagName === "BUTTON" ||
|
177 |
+
node.tagName === "P" ||
|
178 |
+
node.tagName === "INPUT" ||
|
179 |
+
(node.tagName === "LI" && node.classList.contains("item")) // Gradio dropdown item
|
180 |
+
) {
|
181 |
+
tooltipCheckNodes.add(node);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
node.querySelectorAll('span, button, p').forEach(n => tooltipCheckNodes.add(n));
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
if (tooltipCheckNodes.size) {
|
189 |
+
clearTimeout(tooltipCheckTimer);
|
190 |
+
tooltipCheckTimer = setTimeout(processTooltipCheckNodes, 1000);
|
191 |
+
}
|
192 |
+
});
|
193 |
+
|
194 |
+
onUiLoaded(function() {
|
195 |
+
for (var comp of window.gradio_config.components) {
|
196 |
+
if (comp.props.webui_tooltip && comp.props.elem_id) {
|
197 |
+
var elem = gradioApp().getElementById(comp.props.elem_id);
|
198 |
+
if (elem) {
|
199 |
+
elem.title = comp.props.webui_tooltip;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
});
|
stable-diffusion-webui/javascript/hires_fix.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
function onCalcResolutionHires(enable, width, height, hr_scale, hr_resize_x, hr_resize_y) {
|
3 |
+
function setInactive(elem, inactive) {
|
4 |
+
elem.classList.toggle('inactive', !!inactive);
|
5 |
+
}
|
6 |
+
|
7 |
+
var hrUpscaleBy = gradioApp().getElementById('txt2img_hr_scale');
|
8 |
+
var hrResizeX = gradioApp().getElementById('txt2img_hr_resize_x');
|
9 |
+
var hrResizeY = gradioApp().getElementById('txt2img_hr_resize_y');
|
10 |
+
|
11 |
+
gradioApp().getElementById('txt2img_hires_fix_row2').style.display = opts.use_old_hires_fix_width_height ? "none" : "";
|
12 |
+
|
13 |
+
setInactive(hrUpscaleBy, opts.use_old_hires_fix_width_height || hr_resize_x > 0 || hr_resize_y > 0);
|
14 |
+
setInactive(hrResizeX, opts.use_old_hires_fix_width_height || hr_resize_x == 0);
|
15 |
+
setInactive(hrResizeY, opts.use_old_hires_fix_width_height || hr_resize_y == 0);
|
16 |
+
|
17 |
+
return [enable, width, height, hr_scale, hr_resize_x, hr_resize_y];
|
18 |
+
}
|
stable-diffusion-webui/javascript/imageMaskFix.js
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* temporary fix for https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/668
|
3 |
+
* @see https://github.com/gradio-app/gradio/issues/1721
|
4 |
+
*/
|
5 |
+
function imageMaskResize() {
|
6 |
+
const canvases = gradioApp().querySelectorAll('#img2maskimg .touch-none canvas');
|
7 |
+
if (!canvases.length) {
|
8 |
+
window.removeEventListener('resize', imageMaskResize);
|
9 |
+
return;
|
10 |
+
}
|
11 |
+
|
12 |
+
const wrapper = canvases[0].closest('.touch-none');
|
13 |
+
const previewImage = wrapper.previousElementSibling;
|
14 |
+
|
15 |
+
if (!previewImage.complete) {
|
16 |
+
previewImage.addEventListener('load', imageMaskResize);
|
17 |
+
return;
|
18 |
+
}
|
19 |
+
|
20 |
+
const w = previewImage.width;
|
21 |
+
const h = previewImage.height;
|
22 |
+
const nw = previewImage.naturalWidth;
|
23 |
+
const nh = previewImage.naturalHeight;
|
24 |
+
const portrait = nh > nw;
|
25 |
+
|
26 |
+
const wW = Math.min(w, portrait ? h / nh * nw : w / nw * nw);
|
27 |
+
const wH = Math.min(h, portrait ? h / nh * nh : w / nw * nh);
|
28 |
+
|
29 |
+
wrapper.style.width = `${wW}px`;
|
30 |
+
wrapper.style.height = `${wH}px`;
|
31 |
+
wrapper.style.left = `0px`;
|
32 |
+
wrapper.style.top = `0px`;
|
33 |
+
|
34 |
+
canvases.forEach(c => {
|
35 |
+
c.style.width = c.style.height = '';
|
36 |
+
c.style.maxWidth = '100%';
|
37 |
+
c.style.maxHeight = '100%';
|
38 |
+
c.style.objectFit = 'contain';
|
39 |
+
});
|
40 |
+
}
|
41 |
+
|
42 |
+
onAfterUiUpdate(imageMaskResize);
|
43 |
+
window.addEventListener('resize', imageMaskResize);
|
stable-diffusion-webui/javascript/imageviewerGamepad.js
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let gamepads = [];
|
2 |
+
|
3 |
+
window.addEventListener('gamepadconnected', (e) => {
|
4 |
+
const index = e.gamepad.index;
|
5 |
+
let isWaiting = false;
|
6 |
+
gamepads[index] = setInterval(async() => {
|
7 |
+
if (!opts.js_modal_lightbox_gamepad || isWaiting) return;
|
8 |
+
const gamepad = navigator.getGamepads()[index];
|
9 |
+
const xValue = gamepad.axes[0];
|
10 |
+
if (xValue <= -0.3) {
|
11 |
+
modalPrevImage(e);
|
12 |
+
isWaiting = true;
|
13 |
+
} else if (xValue >= 0.3) {
|
14 |
+
modalNextImage(e);
|
15 |
+
isWaiting = true;
|
16 |
+
}
|
17 |
+
if (isWaiting) {
|
18 |
+
await sleepUntil(() => {
|
19 |
+
const xValue = navigator.getGamepads()[index].axes[0];
|
20 |
+
if (xValue < 0.3 && xValue > -0.3) {
|
21 |
+
return true;
|
22 |
+
}
|
23 |
+
}, opts.js_modal_lightbox_gamepad_repeat);
|
24 |
+
isWaiting = false;
|
25 |
+
}
|
26 |
+
}, 10);
|
27 |
+
});
|
28 |
+
|
29 |
+
window.addEventListener('gamepaddisconnected', (e) => {
|
30 |
+
clearInterval(gamepads[e.gamepad.index]);
|
31 |
+
});
|
32 |
+
|
33 |
+
/*
|
34 |
+
Primarily for vr controller type pointer devices.
|
35 |
+
I use the wheel event because there's currently no way to do it properly with web xr.
|
36 |
+
*/
|
37 |
+
let isScrolling = false;
|
38 |
+
window.addEventListener('wheel', (e) => {
|
39 |
+
if (!opts.js_modal_lightbox_gamepad || isScrolling) return;
|
40 |
+
isScrolling = true;
|
41 |
+
|
42 |
+
if (e.deltaX <= -0.6) {
|
43 |
+
modalPrevImage(e);
|
44 |
+
} else if (e.deltaX >= 0.6) {
|
45 |
+
modalNextImage(e);
|
46 |
+
}
|
47 |
+
|
48 |
+
setTimeout(() => {
|
49 |
+
isScrolling = false;
|
50 |
+
}, opts.js_modal_lightbox_gamepad_repeat);
|
51 |
+
});
|
52 |
+
|
53 |
+
function sleepUntil(f, timeout) {
|
54 |
+
return new Promise((resolve) => {
|
55 |
+
const timeStart = new Date();
|
56 |
+
const wait = setInterval(function() {
|
57 |
+
if (f() || new Date() - timeStart > timeout) {
|
58 |
+
clearInterval(wait);
|
59 |
+
resolve();
|
60 |
+
}
|
61 |
+
}, 20);
|
62 |
+
});
|
63 |
+
}
|
stable-diffusion-webui/javascript/inputAccordion.js
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var observerAccordionOpen = new MutationObserver(function(mutations) {
|
2 |
+
mutations.forEach(function(mutationRecord) {
|
3 |
+
var elem = mutationRecord.target;
|
4 |
+
var open = elem.classList.contains('open');
|
5 |
+
|
6 |
+
var accordion = elem.parentNode;
|
7 |
+
accordion.classList.toggle('input-accordion-open', open);
|
8 |
+
|
9 |
+
var checkbox = gradioApp().querySelector('#' + accordion.id + "-checkbox input");
|
10 |
+
checkbox.checked = open;
|
11 |
+
updateInput(checkbox);
|
12 |
+
|
13 |
+
var extra = gradioApp().querySelector('#' + accordion.id + "-extra");
|
14 |
+
if (extra) {
|
15 |
+
extra.style.display = open ? "" : "none";
|
16 |
+
}
|
17 |
+
});
|
18 |
+
});
|
19 |
+
|
20 |
+
function inputAccordionChecked(id, checked) {
|
21 |
+
var label = gradioApp().querySelector('#' + id + " .label-wrap");
|
22 |
+
if (label.classList.contains('open') != checked) {
|
23 |
+
label.click();
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
onUiLoaded(function() {
|
28 |
+
for (var accordion of gradioApp().querySelectorAll('.input-accordion')) {
|
29 |
+
var labelWrap = accordion.querySelector('.label-wrap');
|
30 |
+
observerAccordionOpen.observe(labelWrap, {attributes: true, attributeFilter: ['class']});
|
31 |
+
|
32 |
+
var extra = gradioApp().querySelector('#' + accordion.id + "-extra");
|
33 |
+
if (extra) {
|
34 |
+
labelWrap.insertBefore(extra, labelWrap.lastElementChild);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
});
|
stable-diffusion-webui/javascript/localStorage.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
function localSet(k, v) {
|
3 |
+
try {
|
4 |
+
localStorage.setItem(k, v);
|
5 |
+
} catch (e) {
|
6 |
+
console.warn(`Failed to save ${k} to localStorage: ${e}`);
|
7 |
+
}
|
8 |
+
}
|
9 |
+
|
10 |
+
function localGet(k, def) {
|
11 |
+
try {
|
12 |
+
return localStorage.getItem(k);
|
13 |
+
} catch (e) {
|
14 |
+
console.warn(`Failed to load ${k} from localStorage: ${e}`);
|
15 |
+
}
|
16 |
+
|
17 |
+
return def;
|
18 |
+
}
|
19 |
+
|
20 |
+
function localRemove(k) {
|
21 |
+
try {
|
22 |
+
return localStorage.removeItem(k);
|
23 |
+
} catch (e) {
|
24 |
+
console.warn(`Failed to remove ${k} from localStorage: ${e}`);
|
25 |
+
}
|
26 |
+
}
|
stable-diffusion-webui/javascript/localization.js
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
// localization = {} -- the dict with translations is created by the backend
|
3 |
+
|
4 |
+
var ignore_ids_for_localization = {
|
5 |
+
setting_sd_hypernetwork: 'OPTION',
|
6 |
+
setting_sd_model_checkpoint: 'OPTION',
|
7 |
+
modelmerger_primary_model_name: 'OPTION',
|
8 |
+
modelmerger_secondary_model_name: 'OPTION',
|
9 |
+
modelmerger_tertiary_model_name: 'OPTION',
|
10 |
+
train_embedding: 'OPTION',
|
11 |
+
train_hypernetwork: 'OPTION',
|
12 |
+
txt2img_styles: 'OPTION',
|
13 |
+
img2img_styles: 'OPTION',
|
14 |
+
setting_random_artist_categories: 'OPTION',
|
15 |
+
setting_face_restoration_model: 'OPTION',
|
16 |
+
setting_realesrgan_enabled_models: 'OPTION',
|
17 |
+
extras_upscaler_1: 'OPTION',
|
18 |
+
extras_upscaler_2: 'OPTION',
|
19 |
+
};
|
20 |
+
|
21 |
+
var re_num = /^[.\d]+$/;
|
22 |
+
var re_emoji = /[\p{Extended_Pictographic}\u{1F3FB}-\u{1F3FF}\u{1F9B0}-\u{1F9B3}]/u;
|
23 |
+
|
24 |
+
var original_lines = {};
|
25 |
+
var translated_lines = {};
|
26 |
+
|
27 |
+
function hasLocalization() {
|
28 |
+
return window.localization && Object.keys(window.localization).length > 0;
|
29 |
+
}
|
30 |
+
|
31 |
+
function textNodesUnder(el) {
|
32 |
+
var n, a = [], walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false);
|
33 |
+
while ((n = walk.nextNode())) a.push(n);
|
34 |
+
return a;
|
35 |
+
}
|
36 |
+
|
37 |
+
function canBeTranslated(node, text) {
|
38 |
+
if (!text) return false;
|
39 |
+
if (!node.parentElement) return false;
|
40 |
+
|
41 |
+
var parentType = node.parentElement.nodeName;
|
42 |
+
if (parentType == 'SCRIPT' || parentType == 'STYLE' || parentType == 'TEXTAREA') return false;
|
43 |
+
|
44 |
+
if (parentType == 'OPTION' || parentType == 'SPAN') {
|
45 |
+
var pnode = node;
|
46 |
+
for (var level = 0; level < 4; level++) {
|
47 |
+
pnode = pnode.parentElement;
|
48 |
+
if (!pnode) break;
|
49 |
+
|
50 |
+
if (ignore_ids_for_localization[pnode.id] == parentType) return false;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
if (re_num.test(text)) return false;
|
55 |
+
if (re_emoji.test(text)) return false;
|
56 |
+
return true;
|
57 |
+
}
|
58 |
+
|
59 |
+
function getTranslation(text) {
|
60 |
+
if (!text) return undefined;
|
61 |
+
|
62 |
+
if (translated_lines[text] === undefined) {
|
63 |
+
original_lines[text] = 1;
|
64 |
+
}
|
65 |
+
|
66 |
+
var tl = localization[text];
|
67 |
+
if (tl !== undefined) {
|
68 |
+
translated_lines[tl] = 1;
|
69 |
+
}
|
70 |
+
|
71 |
+
return tl;
|
72 |
+
}
|
73 |
+
|
74 |
+
function processTextNode(node) {
|
75 |
+
var text = node.textContent.trim();
|
76 |
+
|
77 |
+
if (!canBeTranslated(node, text)) return;
|
78 |
+
|
79 |
+
var tl = getTranslation(text);
|
80 |
+
if (tl !== undefined) {
|
81 |
+
node.textContent = tl;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
|
85 |
+
function processNode(node) {
|
86 |
+
if (node.nodeType == 3) {
|
87 |
+
processTextNode(node);
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
if (node.title) {
|
92 |
+
let tl = getTranslation(node.title);
|
93 |
+
if (tl !== undefined) {
|
94 |
+
node.title = tl;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
if (node.placeholder) {
|
99 |
+
let tl = getTranslation(node.placeholder);
|
100 |
+
if (tl !== undefined) {
|
101 |
+
node.placeholder = tl;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
textNodesUnder(node).forEach(function(node) {
|
106 |
+
processTextNode(node);
|
107 |
+
});
|
108 |
+
}
|
109 |
+
|
110 |
+
function localizeWholePage() {
|
111 |
+
processNode(gradioApp());
|
112 |
+
|
113 |
+
function elem(comp) {
|
114 |
+
var elem_id = comp.props.elem_id ? comp.props.elem_id : "component-" + comp.id;
|
115 |
+
return gradioApp().getElementById(elem_id);
|
116 |
+
}
|
117 |
+
|
118 |
+
for (var comp of window.gradio_config.components) {
|
119 |
+
if (comp.props.webui_tooltip) {
|
120 |
+
let e = elem(comp);
|
121 |
+
|
122 |
+
let tl = e ? getTranslation(e.title) : undefined;
|
123 |
+
if (tl !== undefined) {
|
124 |
+
e.title = tl;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
if (comp.props.placeholder) {
|
128 |
+
let e = elem(comp);
|
129 |
+
let textbox = e ? e.querySelector('[placeholder]') : null;
|
130 |
+
|
131 |
+
let tl = textbox ? getTranslation(textbox.placeholder) : undefined;
|
132 |
+
if (tl !== undefined) {
|
133 |
+
textbox.placeholder = tl;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
function dumpTranslations() {
|
140 |
+
if (!hasLocalization()) {
|
141 |
+
// If we don't have any localization,
|
142 |
+
// we will not have traversed the app to find
|
143 |
+
// original_lines, so do that now.
|
144 |
+
localizeWholePage();
|
145 |
+
}
|
146 |
+
var dumped = {};
|
147 |
+
if (localization.rtl) {
|
148 |
+
dumped.rtl = true;
|
149 |
+
}
|
150 |
+
|
151 |
+
for (const text in original_lines) {
|
152 |
+
if (dumped[text] !== undefined) continue;
|
153 |
+
dumped[text] = localization[text] || text;
|
154 |
+
}
|
155 |
+
|
156 |
+
return dumped;
|
157 |
+
}
|
158 |
+
|
159 |
+
function download_localization() {
|
160 |
+
var text = JSON.stringify(dumpTranslations(), null, 4);
|
161 |
+
|
162 |
+
var element = document.createElement('a');
|
163 |
+
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
|
164 |
+
element.setAttribute('download', "localization.json");
|
165 |
+
element.style.display = 'none';
|
166 |
+
document.body.appendChild(element);
|
167 |
+
|
168 |
+
element.click();
|
169 |
+
|
170 |
+
document.body.removeChild(element);
|
171 |
+
}
|
172 |
+
|
173 |
+
document.addEventListener("DOMContentLoaded", function() {
|
174 |
+
if (!hasLocalization()) {
|
175 |
+
return;
|
176 |
+
}
|
177 |
+
|
178 |
+
onUiUpdate(function(m) {
|
179 |
+
m.forEach(function(mutation) {
|
180 |
+
mutation.addedNodes.forEach(function(node) {
|
181 |
+
processNode(node);
|
182 |
+
});
|
183 |
+
});
|
184 |
+
});
|
185 |
+
|
186 |
+
localizeWholePage();
|
187 |
+
|
188 |
+
if (localization.rtl) { // if the language is from right to left,
|
189 |
+
(new MutationObserver((mutations, observer) => { // wait for the style to load
|
190 |
+
mutations.forEach(mutation => {
|
191 |
+
mutation.addedNodes.forEach(node => {
|
192 |
+
if (node.tagName === 'STYLE') {
|
193 |
+
observer.disconnect();
|
194 |
+
|
195 |
+
for (const x of node.sheet.rules) { // find all rtl media rules
|
196 |
+
if (Array.from(x.media || []).includes('rtl')) {
|
197 |
+
x.media.appendMedium('all'); // enable them
|
198 |
+
}
|
199 |
+
}
|
200 |
+
}
|
201 |
+
});
|
202 |
+
});
|
203 |
+
})).observe(gradioApp(), {childList: true});
|
204 |
+
}
|
205 |
+
});
|
stable-diffusion-webui/javascript/notification.js
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Monitors the gallery and sends a browser notification when the leading image is new.
|
2 |
+
|
3 |
+
let lastHeadImg = null;
|
4 |
+
|
5 |
+
let notificationButton = null;
|
6 |
+
|
7 |
+
onAfterUiUpdate(function() {
|
8 |
+
if (notificationButton == null) {
|
9 |
+
notificationButton = gradioApp().getElementById('request_notifications');
|
10 |
+
|
11 |
+
if (notificationButton != null) {
|
12 |
+
notificationButton.addEventListener('click', () => {
|
13 |
+
void Notification.requestPermission();
|
14 |
+
}, true);
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
const galleryPreviews = gradioApp().querySelectorAll('div[id^="tab_"] div[id$="_results"] .thumbnail-item > img');
|
19 |
+
|
20 |
+
if (galleryPreviews == null) return;
|
21 |
+
|
22 |
+
const headImg = galleryPreviews[0]?.src;
|
23 |
+
|
24 |
+
if (headImg == null || headImg == lastHeadImg) return;
|
25 |
+
|
26 |
+
lastHeadImg = headImg;
|
27 |
+
|
28 |
+
// play notification sound if available
|
29 |
+
gradioApp().querySelector('#audio_notification audio')?.play();
|
30 |
+
|
31 |
+
if (document.hasFocus()) return;
|
32 |
+
|
33 |
+
// Multiple copies of the images are in the DOM when one is selected. Dedup with a Set to get the real number generated.
|
34 |
+
const imgs = new Set(Array.from(galleryPreviews).map(img => img.src));
|
35 |
+
|
36 |
+
const notification = new Notification(
|
37 |
+
'Stable Diffusion',
|
38 |
+
{
|
39 |
+
body: `Generated ${imgs.size > 1 ? imgs.size - opts.return_grid : 1} image${imgs.size > 1 ? 's' : ''}`,
|
40 |
+
icon: headImg,
|
41 |
+
image: headImg,
|
42 |
+
}
|
43 |
+
);
|
44 |
+
|
45 |
+
notification.onclick = function(_) {
|
46 |
+
parent.focus();
|
47 |
+
this.close();
|
48 |
+
};
|
49 |
+
});
|
stable-diffusion-webui/javascript/resizeHandle.js
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function() {
|
2 |
+
const GRADIO_MIN_WIDTH = 320;
|
3 |
+
const GRID_TEMPLATE_COLUMNS = '1fr 16px 1fr';
|
4 |
+
const PAD = 16;
|
5 |
+
const DEBOUNCE_TIME = 100;
|
6 |
+
|
7 |
+
const R = {
|
8 |
+
tracking: false,
|
9 |
+
parent: null,
|
10 |
+
parentWidth: null,
|
11 |
+
leftCol: null,
|
12 |
+
leftColStartWidth: null,
|
13 |
+
screenX: null,
|
14 |
+
};
|
15 |
+
|
16 |
+
let resizeTimer;
|
17 |
+
let parents = [];
|
18 |
+
|
19 |
+
function setLeftColGridTemplate(el, width) {
|
20 |
+
el.style.gridTemplateColumns = `${width}px 16px 1fr`;
|
21 |
+
}
|
22 |
+
|
23 |
+
function displayResizeHandle(parent) {
|
24 |
+
if (window.innerWidth < GRADIO_MIN_WIDTH * 2 + PAD * 4) {
|
25 |
+
parent.style.display = 'flex';
|
26 |
+
if (R.handle != null) {
|
27 |
+
R.handle.style.opacity = '0';
|
28 |
+
}
|
29 |
+
return false;
|
30 |
+
} else {
|
31 |
+
parent.style.display = 'grid';
|
32 |
+
if (R.handle != null) {
|
33 |
+
R.handle.style.opacity = '100';
|
34 |
+
}
|
35 |
+
return true;
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
function afterResize(parent) {
|
40 |
+
if (displayResizeHandle(parent) && parent.style.gridTemplateColumns != GRID_TEMPLATE_COLUMNS) {
|
41 |
+
const oldParentWidth = R.parentWidth;
|
42 |
+
const newParentWidth = parent.offsetWidth;
|
43 |
+
const widthL = parseInt(parent.style.gridTemplateColumns.split(' ')[0]);
|
44 |
+
|
45 |
+
const ratio = newParentWidth / oldParentWidth;
|
46 |
+
|
47 |
+
const newWidthL = Math.max(Math.floor(ratio * widthL), GRADIO_MIN_WIDTH);
|
48 |
+
setLeftColGridTemplate(parent, newWidthL);
|
49 |
+
|
50 |
+
R.parentWidth = newParentWidth;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
function setup(parent) {
|
55 |
+
const leftCol = parent.firstElementChild;
|
56 |
+
const rightCol = parent.lastElementChild;
|
57 |
+
|
58 |
+
parents.push(parent);
|
59 |
+
|
60 |
+
parent.style.display = 'grid';
|
61 |
+
parent.style.gap = '0';
|
62 |
+
parent.style.gridTemplateColumns = GRID_TEMPLATE_COLUMNS;
|
63 |
+
|
64 |
+
const resizeHandle = document.createElement('div');
|
65 |
+
resizeHandle.classList.add('resize-handle');
|
66 |
+
parent.insertBefore(resizeHandle, rightCol);
|
67 |
+
|
68 |
+
resizeHandle.addEventListener('mousedown', (evt) => {
|
69 |
+
if (evt.button !== 0) return;
|
70 |
+
|
71 |
+
evt.preventDefault();
|
72 |
+
evt.stopPropagation();
|
73 |
+
|
74 |
+
document.body.classList.add('resizing');
|
75 |
+
|
76 |
+
R.tracking = true;
|
77 |
+
R.parent = parent;
|
78 |
+
R.parentWidth = parent.offsetWidth;
|
79 |
+
R.handle = resizeHandle;
|
80 |
+
R.leftCol = leftCol;
|
81 |
+
R.leftColStartWidth = leftCol.offsetWidth;
|
82 |
+
R.screenX = evt.screenX;
|
83 |
+
});
|
84 |
+
|
85 |
+
resizeHandle.addEventListener('dblclick', (evt) => {
|
86 |
+
evt.preventDefault();
|
87 |
+
evt.stopPropagation();
|
88 |
+
|
89 |
+
parent.style.gridTemplateColumns = GRID_TEMPLATE_COLUMNS;
|
90 |
+
});
|
91 |
+
|
92 |
+
afterResize(parent);
|
93 |
+
}
|
94 |
+
|
95 |
+
window.addEventListener('mousemove', (evt) => {
|
96 |
+
if (evt.button !== 0) return;
|
97 |
+
|
98 |
+
if (R.tracking) {
|
99 |
+
evt.preventDefault();
|
100 |
+
evt.stopPropagation();
|
101 |
+
|
102 |
+
const delta = R.screenX - evt.screenX;
|
103 |
+
const leftColWidth = Math.max(Math.min(R.leftColStartWidth - delta, R.parent.offsetWidth - GRADIO_MIN_WIDTH - PAD), GRADIO_MIN_WIDTH);
|
104 |
+
setLeftColGridTemplate(R.parent, leftColWidth);
|
105 |
+
}
|
106 |
+
});
|
107 |
+
|
108 |
+
window.addEventListener('mouseup', (evt) => {
|
109 |
+
if (evt.button !== 0) return;
|
110 |
+
|
111 |
+
if (R.tracking) {
|
112 |
+
evt.preventDefault();
|
113 |
+
evt.stopPropagation();
|
114 |
+
|
115 |
+
R.tracking = false;
|
116 |
+
|
117 |
+
document.body.classList.remove('resizing');
|
118 |
+
}
|
119 |
+
});
|
120 |
+
|
121 |
+
|
122 |
+
window.addEventListener('resize', () => {
|
123 |
+
clearTimeout(resizeTimer);
|
124 |
+
|
125 |
+
resizeTimer = setTimeout(function() {
|
126 |
+
for (const parent of parents) {
|
127 |
+
afterResize(parent);
|
128 |
+
}
|
129 |
+
}, DEBOUNCE_TIME);
|
130 |
+
});
|
131 |
+
|
132 |
+
setupResizeHandle = setup;
|
133 |
+
})();
|
134 |
+
|
135 |
+
onUiLoaded(function() {
|
136 |
+
for (var elem of gradioApp().querySelectorAll('.resize-handle-row')) {
|
137 |
+
if (!elem.querySelector('.resize-handle')) {
|
138 |
+
setupResizeHandle(elem);
|
139 |
+
}
|
140 |
+
}
|
141 |
+
});
|
stable-diffusion-webui/javascript/token-counters.js
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
let promptTokenCountDebounceTime = 800;
|
2 |
+
let promptTokenCountTimeouts = {};
|
3 |
+
var promptTokenCountUpdateFunctions = {};
|
4 |
+
|
5 |
+
function update_txt2img_tokens(...args) {
|
6 |
+
// Called from Gradio
|
7 |
+
update_token_counter("txt2img_token_button");
|
8 |
+
if (args.length == 2) {
|
9 |
+
return args[0];
|
10 |
+
}
|
11 |
+
return args;
|
12 |
+
}
|
13 |
+
|
14 |
+
function update_img2img_tokens(...args) {
|
15 |
+
// Called from Gradio
|
16 |
+
update_token_counter("img2img_token_button");
|
17 |
+
if (args.length == 2) {
|
18 |
+
return args[0];
|
19 |
+
}
|
20 |
+
return args;
|
21 |
+
}
|
22 |
+
|
23 |
+
function update_token_counter(button_id) {
|
24 |
+
if (opts.disable_token_counters) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
if (promptTokenCountTimeouts[button_id]) {
|
28 |
+
clearTimeout(promptTokenCountTimeouts[button_id]);
|
29 |
+
}
|
30 |
+
promptTokenCountTimeouts[button_id] = setTimeout(
|
31 |
+
() => gradioApp().getElementById(button_id)?.click(),
|
32 |
+
promptTokenCountDebounceTime,
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
function recalculatePromptTokens(name) {
|
38 |
+
promptTokenCountUpdateFunctions[name]?.();
|
39 |
+
}
|
40 |
+
|
41 |
+
function recalculate_prompts_txt2img() {
|
42 |
+
// Called from Gradio
|
43 |
+
recalculatePromptTokens('txt2img_prompt');
|
44 |
+
recalculatePromptTokens('txt2img_neg_prompt');
|
45 |
+
return Array.from(arguments);
|
46 |
+
}
|
47 |
+
|
48 |
+
function recalculate_prompts_img2img() {
|
49 |
+
// Called from Gradio
|
50 |
+
recalculatePromptTokens('img2img_prompt');
|
51 |
+
recalculatePromptTokens('img2img_neg_prompt');
|
52 |
+
return Array.from(arguments);
|
53 |
+
}
|
54 |
+
|
55 |
+
function setupTokenCounting(id, id_counter, id_button) {
|
56 |
+
var prompt = gradioApp().getElementById(id);
|
57 |
+
var counter = gradioApp().getElementById(id_counter);
|
58 |
+
var textarea = gradioApp().querySelector(`#${id} > label > textarea`);
|
59 |
+
|
60 |
+
if (opts.disable_token_counters) {
|
61 |
+
counter.style.display = "none";
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
if (counter.parentElement == prompt.parentElement) {
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
prompt.parentElement.insertBefore(counter, prompt);
|
70 |
+
prompt.parentElement.style.position = "relative";
|
71 |
+
|
72 |
+
promptTokenCountUpdateFunctions[id] = function() {
|
73 |
+
update_token_counter(id_button);
|
74 |
+
};
|
75 |
+
textarea.addEventListener("input", promptTokenCountUpdateFunctions[id]);
|
76 |
+
}
|
77 |
+
|
78 |
+
function setupTokenCounters() {
|
79 |
+
setupTokenCounting('txt2img_prompt', 'txt2img_token_counter', 'txt2img_token_button');
|
80 |
+
setupTokenCounting('txt2img_neg_prompt', 'txt2img_negative_token_counter', 'txt2img_negative_token_button');
|
81 |
+
setupTokenCounting('img2img_prompt', 'img2img_token_counter', 'img2img_token_button');
|
82 |
+
setupTokenCounting('img2img_neg_prompt', 'img2img_negative_token_counter', 'img2img_negative_token_button');
|
83 |
+
}
|
stable-diffusion-webui/javascript/ui.js
ADDED
@@ -0,0 +1,368 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// various functions for interaction with ui.py not large enough to warrant putting them in separate files
|
2 |
+
|
3 |
+
function set_theme(theme) {
|
4 |
+
var gradioURL = window.location.href;
|
5 |
+
if (!gradioURL.includes('?__theme=')) {
|
6 |
+
window.location.replace(gradioURL + '?__theme=' + theme);
|
7 |
+
}
|
8 |
+
}
|
9 |
+
|
10 |
+
function all_gallery_buttons() {
|
11 |
+
var allGalleryButtons = gradioApp().querySelectorAll('[style="display: block;"].tabitem div[id$=_gallery].gradio-gallery .thumbnails > .thumbnail-item.thumbnail-small');
|
12 |
+
var visibleGalleryButtons = [];
|
13 |
+
allGalleryButtons.forEach(function(elem) {
|
14 |
+
if (elem.parentElement.offsetParent) {
|
15 |
+
visibleGalleryButtons.push(elem);
|
16 |
+
}
|
17 |
+
});
|
18 |
+
return visibleGalleryButtons;
|
19 |
+
}
|
20 |
+
|
21 |
+
function selected_gallery_button() {
|
22 |
+
return all_gallery_buttons().find(elem => elem.classList.contains('selected')) ?? null;
|
23 |
+
}
|
24 |
+
|
25 |
+
function selected_gallery_index() {
|
26 |
+
return all_gallery_buttons().findIndex(elem => elem.classList.contains('selected'));
|
27 |
+
}
|
28 |
+
|
29 |
+
function extract_image_from_gallery(gallery) {
|
30 |
+
if (gallery.length == 0) {
|
31 |
+
return [null];
|
32 |
+
}
|
33 |
+
if (gallery.length == 1) {
|
34 |
+
return [gallery[0]];
|
35 |
+
}
|
36 |
+
|
37 |
+
var index = selected_gallery_index();
|
38 |
+
|
39 |
+
if (index < 0 || index >= gallery.length) {
|
40 |
+
// Use the first image in the gallery as the default
|
41 |
+
index = 0;
|
42 |
+
}
|
43 |
+
|
44 |
+
return [gallery[index]];
|
45 |
+
}
|
46 |
+
|
47 |
+
window.args_to_array = Array.from; // Compatibility with e.g. extensions that may expect this to be around
|
48 |
+
|
49 |
+
function switch_to_txt2img() {
|
50 |
+
gradioApp().querySelector('#tabs').querySelectorAll('button')[0].click();
|
51 |
+
|
52 |
+
return Array.from(arguments);
|
53 |
+
}
|
54 |
+
|
55 |
+
function switch_to_img2img_tab(no) {
|
56 |
+
gradioApp().querySelector('#tabs').querySelectorAll('button')[1].click();
|
57 |
+
gradioApp().getElementById('mode_img2img').querySelectorAll('button')[no].click();
|
58 |
+
}
|
59 |
+
function switch_to_img2img() {
|
60 |
+
switch_to_img2img_tab(0);
|
61 |
+
return Array.from(arguments);
|
62 |
+
}
|
63 |
+
|
64 |
+
function switch_to_sketch() {
|
65 |
+
switch_to_img2img_tab(1);
|
66 |
+
return Array.from(arguments);
|
67 |
+
}
|
68 |
+
|
69 |
+
function switch_to_inpaint() {
|
70 |
+
switch_to_img2img_tab(2);
|
71 |
+
return Array.from(arguments);
|
72 |
+
}
|
73 |
+
|
74 |
+
function switch_to_inpaint_sketch() {
|
75 |
+
switch_to_img2img_tab(3);
|
76 |
+
return Array.from(arguments);
|
77 |
+
}
|
78 |
+
|
79 |
+
function switch_to_extras() {
|
80 |
+
gradioApp().querySelector('#tabs').querySelectorAll('button')[2].click();
|
81 |
+
|
82 |
+
return Array.from(arguments);
|
83 |
+
}
|
84 |
+
|
85 |
+
function get_tab_index(tabId) {
|
86 |
+
let buttons = gradioApp().getElementById(tabId).querySelector('div').querySelectorAll('button');
|
87 |
+
for (let i = 0; i < buttons.length; i++) {
|
88 |
+
if (buttons[i].classList.contains('selected')) {
|
89 |
+
return i;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
return 0;
|
93 |
+
}
|
94 |
+
|
95 |
+
function create_tab_index_args(tabId, args) {
|
96 |
+
var res = Array.from(args);
|
97 |
+
res[0] = get_tab_index(tabId);
|
98 |
+
return res;
|
99 |
+
}
|
100 |
+
|
101 |
+
function get_img2img_tab_index() {
|
102 |
+
let res = Array.from(arguments);
|
103 |
+
res.splice(-2);
|
104 |
+
res[0] = get_tab_index('mode_img2img');
|
105 |
+
return res;
|
106 |
+
}
|
107 |
+
|
108 |
+
function create_submit_args(args) {
|
109 |
+
var res = Array.from(args);
|
110 |
+
|
111 |
+
// As it is currently, txt2img and img2img send back the previous output args (txt2img_gallery, generation_info, html_info) whenever you generate a new image.
|
112 |
+
// This can lead to uploading a huge gallery of previously generated images, which leads to an unnecessary delay between submitting and beginning to generate.
|
113 |
+
// I don't know why gradio is sending outputs along with inputs, but we can prevent sending the image gallery here, which seems to be an issue for some.
|
114 |
+
// If gradio at some point stops sending outputs, this may break something
|
115 |
+
if (Array.isArray(res[res.length - 3])) {
|
116 |
+
res[res.length - 3] = null;
|
117 |
+
}
|
118 |
+
|
119 |
+
return res;
|
120 |
+
}
|
121 |
+
|
122 |
+
function showSubmitButtons(tabname, show) {
|
123 |
+
gradioApp().getElementById(tabname + '_interrupt').style.display = show ? "none" : "block";
|
124 |
+
gradioApp().getElementById(tabname + '_skip').style.display = show ? "none" : "block";
|
125 |
+
}
|
126 |
+
|
127 |
+
function showRestoreProgressButton(tabname, show) {
|
128 |
+
var button = gradioApp().getElementById(tabname + "_restore_progress");
|
129 |
+
if (!button) return;
|
130 |
+
|
131 |
+
button.style.display = show ? "flex" : "none";
|
132 |
+
}
|
133 |
+
|
134 |
+
function submit() {
|
135 |
+
showSubmitButtons('txt2img', false);
|
136 |
+
|
137 |
+
var id = randomId();
|
138 |
+
localSet("txt2img_task_id", id);
|
139 |
+
|
140 |
+
requestProgress(id, gradioApp().getElementById('txt2img_gallery_container'), gradioApp().getElementById('txt2img_gallery'), function() {
|
141 |
+
showSubmitButtons('txt2img', true);
|
142 |
+
localRemove("txt2img_task_id");
|
143 |
+
showRestoreProgressButton('txt2img', false);
|
144 |
+
});
|
145 |
+
|
146 |
+
var res = create_submit_args(arguments);
|
147 |
+
|
148 |
+
res[0] = id;
|
149 |
+
|
150 |
+
return res;
|
151 |
+
}
|
152 |
+
|
153 |
+
function submit_img2img() {
|
154 |
+
showSubmitButtons('img2img', false);
|
155 |
+
|
156 |
+
var id = randomId();
|
157 |
+
localSet("img2img_task_id", id);
|
158 |
+
|
159 |
+
requestProgress(id, gradioApp().getElementById('img2img_gallery_container'), gradioApp().getElementById('img2img_gallery'), function() {
|
160 |
+
showSubmitButtons('img2img', true);
|
161 |
+
localRemove("img2img_task_id");
|
162 |
+
showRestoreProgressButton('img2img', false);
|
163 |
+
});
|
164 |
+
|
165 |
+
var res = create_submit_args(arguments);
|
166 |
+
|
167 |
+
res[0] = id;
|
168 |
+
res[1] = get_tab_index('mode_img2img');
|
169 |
+
|
170 |
+
return res;
|
171 |
+
}
|
172 |
+
|
173 |
+
function restoreProgressTxt2img() {
|
174 |
+
showRestoreProgressButton("txt2img", false);
|
175 |
+
var id = localGet("txt2img_task_id");
|
176 |
+
|
177 |
+
if (id) {
|
178 |
+
requestProgress(id, gradioApp().getElementById('txt2img_gallery_container'), gradioApp().getElementById('txt2img_gallery'), function() {
|
179 |
+
showSubmitButtons('txt2img', true);
|
180 |
+
}, null, 0);
|
181 |
+
}
|
182 |
+
|
183 |
+
return id;
|
184 |
+
}
|
185 |
+
|
186 |
+
function restoreProgressImg2img() {
|
187 |
+
showRestoreProgressButton("img2img", false);
|
188 |
+
|
189 |
+
var id = localGet("img2img_task_id");
|
190 |
+
|
191 |
+
if (id) {
|
192 |
+
requestProgress(id, gradioApp().getElementById('img2img_gallery_container'), gradioApp().getElementById('img2img_gallery'), function() {
|
193 |
+
showSubmitButtons('img2img', true);
|
194 |
+
}, null, 0);
|
195 |
+
}
|
196 |
+
|
197 |
+
return id;
|
198 |
+
}
|
199 |
+
|
200 |
+
|
201 |
+
onUiLoaded(function() {
|
202 |
+
showRestoreProgressButton('txt2img', localGet("txt2img_task_id"));
|
203 |
+
showRestoreProgressButton('img2img', localGet("img2img_task_id"));
|
204 |
+
});
|
205 |
+
|
206 |
+
|
207 |
+
function modelmerger() {
|
208 |
+
var id = randomId();
|
209 |
+
requestProgress(id, gradioApp().getElementById('modelmerger_results_panel'), null, function() {});
|
210 |
+
|
211 |
+
var res = create_submit_args(arguments);
|
212 |
+
res[0] = id;
|
213 |
+
return res;
|
214 |
+
}
|
215 |
+
|
216 |
+
|
217 |
+
function ask_for_style_name(_, prompt_text, negative_prompt_text) {
|
218 |
+
var name_ = prompt('Style name:');
|
219 |
+
return [name_, prompt_text, negative_prompt_text];
|
220 |
+
}
|
221 |
+
|
222 |
+
function confirm_clear_prompt(prompt, negative_prompt) {
|
223 |
+
if (confirm("Delete prompt?")) {
|
224 |
+
prompt = "";
|
225 |
+
negative_prompt = "";
|
226 |
+
}
|
227 |
+
|
228 |
+
return [prompt, negative_prompt];
|
229 |
+
}
|
230 |
+
|
231 |
+
|
232 |
+
var opts = {};
|
233 |
+
onAfterUiUpdate(function() {
|
234 |
+
if (Object.keys(opts).length != 0) return;
|
235 |
+
|
236 |
+
var json_elem = gradioApp().getElementById('settings_json');
|
237 |
+
if (json_elem == null) return;
|
238 |
+
|
239 |
+
var textarea = json_elem.querySelector('textarea');
|
240 |
+
var jsdata = textarea.value;
|
241 |
+
opts = JSON.parse(jsdata);
|
242 |
+
|
243 |
+
executeCallbacks(optionsChangedCallbacks); /*global optionsChangedCallbacks*/
|
244 |
+
|
245 |
+
Object.defineProperty(textarea, 'value', {
|
246 |
+
set: function(newValue) {
|
247 |
+
var valueProp = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
248 |
+
var oldValue = valueProp.get.call(textarea);
|
249 |
+
valueProp.set.call(textarea, newValue);
|
250 |
+
|
251 |
+
if (oldValue != newValue) {
|
252 |
+
opts = JSON.parse(textarea.value);
|
253 |
+
}
|
254 |
+
|
255 |
+
executeCallbacks(optionsChangedCallbacks);
|
256 |
+
},
|
257 |
+
get: function() {
|
258 |
+
var valueProp = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
259 |
+
return valueProp.get.call(textarea);
|
260 |
+
}
|
261 |
+
});
|
262 |
+
|
263 |
+
json_elem.parentElement.style.display = "none";
|
264 |
+
|
265 |
+
setupTokenCounters();
|
266 |
+
|
267 |
+
var show_all_pages = gradioApp().getElementById('settings_show_all_pages');
|
268 |
+
var settings_tabs = gradioApp().querySelector('#settings div');
|
269 |
+
if (show_all_pages && settings_tabs) {
|
270 |
+
settings_tabs.appendChild(show_all_pages);
|
271 |
+
show_all_pages.onclick = function() {
|
272 |
+
gradioApp().querySelectorAll('#settings > div').forEach(function(elem) {
|
273 |
+
if (elem.id == "settings_tab_licenses") {
|
274 |
+
return;
|
275 |
+
}
|
276 |
+
|
277 |
+
elem.style.display = "block";
|
278 |
+
});
|
279 |
+
};
|
280 |
+
}
|
281 |
+
});
|
282 |
+
|
283 |
+
onOptionsChanged(function() {
|
284 |
+
var elem = gradioApp().getElementById('sd_checkpoint_hash');
|
285 |
+
var sd_checkpoint_hash = opts.sd_checkpoint_hash || "";
|
286 |
+
var shorthash = sd_checkpoint_hash.substring(0, 10);
|
287 |
+
|
288 |
+
if (elem && elem.textContent != shorthash) {
|
289 |
+
elem.textContent = shorthash;
|
290 |
+
elem.title = sd_checkpoint_hash;
|
291 |
+
elem.href = "https://google.com/search?q=" + sd_checkpoint_hash;
|
292 |
+
}
|
293 |
+
});
|
294 |
+
|
295 |
+
let txt2img_textarea, img2img_textarea = undefined;
|
296 |
+
|
297 |
+
function restart_reload() {
|
298 |
+
document.body.innerHTML = '<h1 style="font-family:monospace;margin-top:20%;color:lightgray;text-align:center;">Reloading...</h1>';
|
299 |
+
|
300 |
+
var requestPing = function() {
|
301 |
+
requestGet("./internal/ping", {}, function(data) {
|
302 |
+
location.reload();
|
303 |
+
}, function() {
|
304 |
+
setTimeout(requestPing, 500);
|
305 |
+
});
|
306 |
+
};
|
307 |
+
|
308 |
+
setTimeout(requestPing, 2000);
|
309 |
+
|
310 |
+
return [];
|
311 |
+
}
|
312 |
+
|
313 |
+
// Simulate an `input` DOM event for Gradio Textbox component. Needed after you edit its contents in javascript, otherwise your edits
|
314 |
+
// will only visible on web page and not sent to python.
|
315 |
+
function updateInput(target) {
|
316 |
+
let e = new Event("input", {bubbles: true});
|
317 |
+
Object.defineProperty(e, "target", {value: target});
|
318 |
+
target.dispatchEvent(e);
|
319 |
+
}
|
320 |
+
|
321 |
+
|
322 |
+
var desiredCheckpointName = null;
|
323 |
+
function selectCheckpoint(name) {
|
324 |
+
desiredCheckpointName = name;
|
325 |
+
gradioApp().getElementById('change_checkpoint').click();
|
326 |
+
}
|
327 |
+
|
328 |
+
function currentImg2imgSourceResolution(w, h, scaleBy) {
|
329 |
+
var img = gradioApp().querySelector('#mode_img2img > div[style="display: block;"] img');
|
330 |
+
return img ? [img.naturalWidth, img.naturalHeight, scaleBy] : [0, 0, scaleBy];
|
331 |
+
}
|
332 |
+
|
333 |
+
function updateImg2imgResizeToTextAfterChangingImage() {
|
334 |
+
// At the time this is called from gradio, the image has no yet been replaced.
|
335 |
+
// There may be a better solution, but this is simple and straightforward so I'm going with it.
|
336 |
+
|
337 |
+
setTimeout(function() {
|
338 |
+
gradioApp().getElementById('img2img_update_resize_to').click();
|
339 |
+
}, 500);
|
340 |
+
|
341 |
+
return [];
|
342 |
+
|
343 |
+
}
|
344 |
+
|
345 |
+
|
346 |
+
|
347 |
+
function setRandomSeed(elem_id) {
|
348 |
+
var input = gradioApp().querySelector("#" + elem_id + " input");
|
349 |
+
if (!input) return [];
|
350 |
+
|
351 |
+
input.value = "-1";
|
352 |
+
updateInput(input);
|
353 |
+
return [];
|
354 |
+
}
|
355 |
+
|
356 |
+
function switchWidthHeight(tabname) {
|
357 |
+
var width = gradioApp().querySelector("#" + tabname + "_width input[type=number]");
|
358 |
+
var height = gradioApp().querySelector("#" + tabname + "_height input[type=number]");
|
359 |
+
if (!width || !height) return [];
|
360 |
+
|
361 |
+
var tmp = width.value;
|
362 |
+
width.value = height.value;
|
363 |
+
height.value = tmp;
|
364 |
+
|
365 |
+
updateInput(width);
|
366 |
+
updateInput(height);
|
367 |
+
return [];
|
368 |
+
}
|
stable-diffusion-webui/javascript/ui_settings_hints.js
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// various hints and extra info for the settings tab
|
2 |
+
|
3 |
+
var settingsHintsSetup = false;
|
4 |
+
|
5 |
+
onOptionsChanged(function() {
|
6 |
+
if (settingsHintsSetup) return;
|
7 |
+
settingsHintsSetup = true;
|
8 |
+
|
9 |
+
gradioApp().querySelectorAll('#settings [id^=setting_]').forEach(function(div) {
|
10 |
+
var name = div.id.substr(8);
|
11 |
+
var commentBefore = opts._comments_before[name];
|
12 |
+
var commentAfter = opts._comments_after[name];
|
13 |
+
|
14 |
+
if (!commentBefore && !commentAfter) return;
|
15 |
+
|
16 |
+
var span = null;
|
17 |
+
if (div.classList.contains('gradio-checkbox')) span = div.querySelector('label span');
|
18 |
+
else if (div.classList.contains('gradio-checkboxgroup')) span = div.querySelector('span').firstChild;
|
19 |
+
else if (div.classList.contains('gradio-radio')) span = div.querySelector('span').firstChild;
|
20 |
+
else span = div.querySelector('label span').firstChild;
|
21 |
+
|
22 |
+
if (!span) return;
|
23 |
+
|
24 |
+
if (commentBefore) {
|
25 |
+
var comment = document.createElement('DIV');
|
26 |
+
comment.className = 'settings-comment';
|
27 |
+
comment.innerHTML = commentBefore;
|
28 |
+
span.parentElement.insertBefore(document.createTextNode('\xa0'), span);
|
29 |
+
span.parentElement.insertBefore(comment, span);
|
30 |
+
span.parentElement.insertBefore(document.createTextNode('\xa0'), span);
|
31 |
+
}
|
32 |
+
if (commentAfter) {
|
33 |
+
comment = document.createElement('DIV');
|
34 |
+
comment.className = 'settings-comment';
|
35 |
+
comment.innerHTML = commentAfter;
|
36 |
+
span.parentElement.insertBefore(comment, span.nextSibling);
|
37 |
+
span.parentElement.insertBefore(document.createTextNode('\xa0'), span.nextSibling);
|
38 |
+
}
|
39 |
+
});
|
40 |
+
});
|
41 |
+
|
42 |
+
function settingsHintsShowQuicksettings() {
|
43 |
+
requestGet("./internal/quicksettings-hint", {}, function(data) {
|
44 |
+
var table = document.createElement('table');
|
45 |
+
table.className = 'popup-table';
|
46 |
+
|
47 |
+
data.forEach(function(obj) {
|
48 |
+
var tr = document.createElement('tr');
|
49 |
+
var td = document.createElement('td');
|
50 |
+
td.textContent = obj.name;
|
51 |
+
tr.appendChild(td);
|
52 |
+
|
53 |
+
td = document.createElement('td');
|
54 |
+
td.textContent = obj.label;
|
55 |
+
tr.appendChild(td);
|
56 |
+
|
57 |
+
table.appendChild(tr);
|
58 |
+
});
|
59 |
+
|
60 |
+
popup(table);
|
61 |
+
});
|
62 |
+
}
|
stable-diffusion-webui/launch.py
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from modules import launch_utils
|
2 |
+
|
3 |
+
args = launch_utils.args
|
4 |
+
python = launch_utils.python
|
5 |
+
git = launch_utils.git
|
6 |
+
index_url = launch_utils.index_url
|
7 |
+
dir_repos = launch_utils.dir_repos
|
8 |
+
|
9 |
+
commit_hash = launch_utils.commit_hash
|
10 |
+
git_tag = launch_utils.git_tag
|
11 |
+
|
12 |
+
run = launch_utils.run
|
13 |
+
is_installed = launch_utils.is_installed
|
14 |
+
repo_dir = launch_utils.repo_dir
|
15 |
+
|
16 |
+
run_pip = launch_utils.run_pip
|
17 |
+
check_run_python = launch_utils.check_run_python
|
18 |
+
git_clone = launch_utils.git_clone
|
19 |
+
git_pull_recursive = launch_utils.git_pull_recursive
|
20 |
+
list_extensions = launch_utils.list_extensions
|
21 |
+
run_extension_installer = launch_utils.run_extension_installer
|
22 |
+
prepare_environment = launch_utils.prepare_environment
|
23 |
+
configure_for_tests = launch_utils.configure_for_tests
|
24 |
+
start = launch_utils.start
|
25 |
+
|
26 |
+
|
27 |
+
def main():
|
28 |
+
if args.dump_sysinfo:
|
29 |
+
filename = launch_utils.dump_sysinfo()
|
30 |
+
|
31 |
+
print(f"Sysinfo saved as {filename}. Exiting...")
|
32 |
+
|
33 |
+
exit(0)
|
34 |
+
|
35 |
+
launch_utils.startup_timer.record("initial startup")
|
36 |
+
|
37 |
+
with launch_utils.startup_timer.subcategory("prepare environment"):
|
38 |
+
if not args.skip_prepare_environment:
|
39 |
+
prepare_environment()
|
40 |
+
|
41 |
+
if args.test_server:
|
42 |
+
configure_for_tests()
|
43 |
+
|
44 |
+
start()
|
45 |
+
|
46 |
+
|
47 |
+
if __name__ == "__main__":
|
48 |
+
main()
|
stable-diffusion-webui/localizations/Put localization files here.txt
ADDED
File without changes
|
stable-diffusion-webui/package.json
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "stable-diffusion-webui",
|
3 |
+
"version": "0.0.0",
|
4 |
+
"devDependencies": {
|
5 |
+
"eslint": "^8.40.0"
|
6 |
+
},
|
7 |
+
"scripts": {
|
8 |
+
"lint": "eslint .",
|
9 |
+
"fix": "eslint --fix ."
|
10 |
+
}
|
11 |
+
}
|
stable-diffusion-webui/params.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
pontileich
|
2 |
+
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 270957085, Size: 512x512, Model hash: 31e35c80fc, Model: sd_xl_base_1.0, Denoising strength: 0.7, Clip skip: 12, Hires upscale: 2, Hires upscaler: Latent, Version: v1.6.0
|
stable-diffusion-webui/pyproject.toml
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool.ruff]
|
2 |
+
|
3 |
+
target-version = "py39"
|
4 |
+
|
5 |
+
extend-select = [
|
6 |
+
"B",
|
7 |
+
"C",
|
8 |
+
"I",
|
9 |
+
"W",
|
10 |
+
]
|
11 |
+
|
12 |
+
exclude = [
|
13 |
+
"extensions",
|
14 |
+
"extensions-disabled",
|
15 |
+
]
|
16 |
+
|
17 |
+
ignore = [
|
18 |
+
"E501", # Line too long
|
19 |
+
"E731", # Do not assign a `lambda` expression, use a `def`
|
20 |
+
|
21 |
+
"I001", # Import block is un-sorted or un-formatted
|
22 |
+
"C901", # Function is too complex
|
23 |
+
"C408", # Rewrite as a literal
|
24 |
+
"W605", # invalid escape sequence, messes with some docstrings
|
25 |
+
]
|
26 |
+
|
27 |
+
[tool.ruff.per-file-ignores]
|
28 |
+
"webui.py" = ["E402"] # Module level import not at top of file
|
29 |
+
|
30 |
+
[tool.ruff.flake8-bugbear]
|
31 |
+
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
|
32 |
+
extend-immutable-calls = ["fastapi.Depends", "fastapi.security.HTTPBasic"]
|
33 |
+
|
34 |
+
[tool.pytest.ini_options]
|
35 |
+
base_url = "http://127.0.0.1:7860"
|
stable-diffusion-webui/requirements-test.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
pytest-base-url~=2.0
|
2 |
+
pytest-cov~=4.0
|
3 |
+
pytest~=7.3
|
stable-diffusion-webui/requirements.txt
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GitPython
|
2 |
+
Pillow
|
3 |
+
accelerate
|
4 |
+
|
5 |
+
basicsr
|
6 |
+
blendmodes
|
7 |
+
clean-fid
|
8 |
+
einops
|
9 |
+
fastapi>=0.90.1
|
10 |
+
gfpgan
|
11 |
+
gradio==3.41.2
|
12 |
+
inflection
|
13 |
+
jsonmerge
|
14 |
+
kornia
|
15 |
+
lark
|
16 |
+
numpy
|
17 |
+
omegaconf
|
18 |
+
open-clip-torch
|
19 |
+
|
20 |
+
piexif
|
21 |
+
psutil
|
22 |
+
pytorch_lightning
|
23 |
+
realesrgan
|
24 |
+
requests
|
25 |
+
resize-right
|
26 |
+
|
27 |
+
safetensors
|
28 |
+
scikit-image>=0.19
|
29 |
+
timm
|
30 |
+
tomesd
|
31 |
+
torch
|
32 |
+
torchdiffeq
|
33 |
+
torchsde
|
34 |
+
transformers==4.30.2
|