Skip to content

Commit

Permalink
Sync (#1)
Browse files Browse the repository at this point in the history
* Autofix Ruff W (not W605) (mostly whitespace)

* Make live previews use JPEG only when the image is lorge enough

* Bump versions to avoid downgrading them

* fix --data-dir for COMMANDLINE_ARGS

move reading of COMMANDLINE_ARGS into paths_internal.py so --data-dir can be properly read

* Set PyTorch version to 2.0.1 for macOS

* launch.py: make git_tag() and commit_hash() work even when WEBUI_LAUNCH_LIVE_OUTPUT

* Get rid of check_run + run_python

* Redirect Gradio phone home request

This request is sent regardless of Gradio analytics being
enabled or not via the env var.
Idea from text-generation-webui.

* Define default fonts for Gradio theme

Allows web UI to (almost) be ran fully offline.
The web UI will hang on load if offline when
these fonts are not manually defined, as it will attempt (and fail)
to pull from Google Fonts.

* update changelog for release

* fix broken prompts from file

* update changelog for release

* Wait for DOMContentLoaded until checking whether localization should be disabled

Refs AUTOMATIC1111#9955 (comment)

* Requested changes

* minor fix

* remove command line option

* Allow bf16 in safe unpickler

* heavily simplify

* move to stable-diffusion tab

* fix for img2img

* Move localization to its own script block and load it first

* Make dump translations work again

* add an option to always refer to lora by filenames
never refer to lora by an alias if multiple loras have same alias or the alias is called none

* fix upscalers disappearing after the user reloads UI

* Merge pull request AUTOMATIC1111#10339 from catboxanon/bf16

Allow bf16 in safe unpickler

* Merge pull request AUTOMATIC1111#10324 from catboxanon/offline

Allow web UI to be ran fully offline

* update readme

* Merge pull request AUTOMATIC1111#10335 from akx/l10n-dis-take-2

Localization fixes

* update readme

* Add/modify CFG callbacks

Required by self-attn guidance extension
https://github.com/ashen-sensored/sd_webui_SAG

* Update script_callbacks.py

* remove output_altered flag from AfterCFGCallbackParams

* updates for AUTOMATIC1111#9256

* Add Tiny AE live preview

* Add live preview mode check

* set up a system to provide extra info for settings elements in python rather than js
add a bit of spacing/styling to settings elements
add link info for token merging

* allow jpeg for extra network preview

* add a bunch of descriptions and reword a lot of settings (sorry, localizers)

* remove auto live previews format option, fix slow PNG generation

* fix model loading twice in some situations

* add a possible fix for 'LatentDiffusion' object has no attribute 'lora_layer_mapping'

* update readme for release

* Add GPU device

Add GPU option to troubleshoot.

* Downgrade Gradio

* Modify pytorch command

* Update bug_report.yml

* fix xyz checkpoint

* launch.py: Don't involve shell for running Python or Git for output

Fixes Linux regression in 451d255

* Revert Gradio version

* Change to extra-index-url

* Minor changes

* Fix extra networks save preview image geninfo

* Add Python version

Many users still use unverified versions of Python and file version-specific issues, often without mentioning version information, making troubleshooting difficult.

* xyz token merging

* Show "Loading..." for extra networks when displaying for the first time

* load extensions' git metadata in parallel to loading the main program to save a ton of time during startup

* update extensions table: show branch, show date in separate column, and show version from tags if available

* add visual progress for extension installation from URL

* suppress ENSD infotext for samplers that don't use it

* add second_order field to sampler config

* restore nqsp in footer that was lost during linting

* add info link for Negative Guidance minimum sigma

* Minor change

* Use ngrok-py library

* Remove max width for model dropdown
Removing the max width for the model dropdown allows the user to see the full name of a model especially when it is long.
Model names are getting more complex and longer and the current width almost always cuts off model names.
If a user leverages folders than it pretty much always cuts off the name...

* Fix remove `textual inversion` prompt

* not clear checkpoints cache when config changes

* add credits

* return live preview defaults to how they were
only download TAESD model when it's needed
return calculations in single_sample_to_image to just if/elif/elif blocks
keep taesd model in its own directory

* Replace state.need_restart with state.server_command + replace poll loop with signal

* Add option for /_stop route (for graceful shutdown)

* Copy s_min_uncond to Processed

Should fix AUTOMATIC1111#10416

* Bump pytorch for AMD Users

So apparently it works now? Before you would get "Pytorch cant use the GPU" but not anymore.

* Fixing webui.sh

If only i proofread what i wrote

* TAESD fix

* simplify single_sample_to_image

* Add basic ESLint configuration for formatting

This doesn't enable any of ESLint's actual possible-issue linting,
but just style normalization based on the Prettier configuration (but without line length limits).

* Add ESLint to CI

* Run `eslint --fix` (and normalize tabs to spaces)

* fix inability to run with --freeze-settings

* Fixed: AUTOMATIC1111#10460

* use a local variable instead of dictionary entry for sd_merge_models in merge model metadata code

* when adding tooltips, do not scan whole document and instead only scan added elements

* Fix typo in syntax

* move some settings to the new Optimization page
add slider for token merging for img2img
rework StableDiffusionProcessing to have the token_merging_ratio field
fix a bug with applying png optimizations for live previews when they shouldn't be applied

* isn't there something you forgot, AUTOMATIC1111#10483?

* use a single function for saving images with metadata both in extra networks and main mode for AUTOMATIC1111#10395

* add options to show/hide hidden files and dirs, and to not list models/files in hidden directories

* add /sdapi/v1/script-info api

* alternative solution to fix styles load when edited by human AUTOMATIC1111#9765 as suggested by akx

* simplify name pattern setting tooltips

* add option to reorder tabs
fix Reload UI not working

* remove some code duplication from AUTOMATIC1111#9348

* option to specify editor height for img2img

* rework AUTOMATIC1111#8863 to work with all img2img tabs

* Error Improvement for install torch

* extend eslint config

* eslint related file edits

* eslint the merged code

* keep old option for ngrok

* python linter fixes

* add --gradio-allowed-path commandline option

* Modify xformers instead of pytorch

* if sd_model is None, do not always try to load it

* add messages about Loras that failed to load to UI

* .change -> .release for hires input

Improves overall UI responsiveness.

* rework hires prompts/sampler code to among other things support different extra networks in first/second pass
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)
add some locals from processing function into the Processing class as fields

* bump gradio

* Reorder variable assignment

* Revert "Merge pull request AUTOMATIC1111#10440 from grimatoma/increaseModelPickerWidth"

This reverts commit 4b07f2f, reversing
changes made to 4071fa4.

* Fix blinking text of hr and scale res

goodbye

* make it possible for scripts to add cross attention optimizations
add UI selection for cross attention optimization

* rework AUTOMATIC1111#10519

* Use name instead of hash in xyz_grid

X/Y/Z grid was still using the old hash, prone to collisions. This changes it to use the name instead.

Should fix AUTOMATIC1111#10521.

* set Navigate image viewer with gamepad option to false by default, by request

* update CHANGELOG

* fix linter issues

* Added the refresh-loras post request

* rewrite uiElementIsVisible

rewrite visibility checking to be more generic/cleaner as well as add functionality to check if the element is scrolled on screen for more intuitive paste-target selection

* Spel chek changelog some

* make links to http://<...>.git git extensions work in the extension tab

* change upscalers to download models into user-specified directory (from commandline args) rather than the default models/<...>

* Apply suggestions from code review

Co-authored-by: Aarni Koskela <[email protected]>

* split visibility method and sort instead

split out the visibility method for pasting and use a sort inside the paste handler to prioritize on-screen fields rather than targeting ONLY on screen fields

* linter fixes

* make it actually work after suggestions

* Add .git-blame-ignore-revs

* Fix ruff lint

* eslintrc: Sort eslint rules

* eslintrc: Use a file-local `global` comment for module

* eslintrc: mark most globals read-only

* eslintrc: enable no-redeclare but with builtinGlobals: false

* Replace args_to_array (and facsimiles) with Array.from

* get_tab_index(): use a for loop with early-exit for performance

* Fix typo "intialize"

* Deduplicate default extra network registration

* Simplify CORS middleware configuration

* Make load_scripts create new runners (removes reload_scripts)

* Refactor validate_tls_options out, fix typo (keyfile was there twice)

* Refactor configure_sigint_handler out

* Refactor configure opts_onchange out

* Note pending PR for app_kwargs

* Refactor gradio auth

* Deduplicate webui.py initial-load/reload code

* Overhaul tests to use py.test

* simplify PR page

* change width/heights slider steps to 64 from 8

* allow hiding buttons in ui-config.json

* calculate hashes for Lora
add lora hashes to infotext
when pasting infotext, use infotext's lora hashes to find local loras for <lora:xxx:1> entries whose hashes match loras the user has

* Use Optional[] to preserve Python 3.9 compatability

* preserve declarations

* extensions clone depth 1

* Update keyboard shortcut instructions for MacOS users in text selection guidance

* Support edit attn shortcut in hires fix prompts

* hiresfix prompt: add classes, update css sel

* Add a couple `from __future__ import annotations`es for Py3.9 compat

* add DPM-Solver++(2M) SDE from new k-diffusion

* Discard penultimate sigma for dpmpp_2m_sde

* --filter=blob:none

Co-Authored-By: Aarni Koskela <[email protected]>
Co-Authored-By: catboxanon <[email protected]>

* revert git describe --always --tags for extensions because it seems to be causing issues

* reworking launch.py: rename

* reworking launch.py: add references to renamed file

* Revert "change width/heights slider steps to 64 from 8"

This reverts commit 9a86932.

* update readme

* fix bad styling for thumbs view in extra networks AUTOMATIC1111#10639

* possible fix for empty list of optimizations AUTOMATIC1111#10605

* update the changelog to mention 1.3.0 version

* fix serving images that have already been saved without temp files function that broke after updating gradio

* fix linter issue for 1.3.0

* add quoting for infotext values that have a colon in them

* Merge pull request AUTOMATIC1111#10785 from nyqui/fix-hires.fix

fix "hires. fix" prompt sharing same labels with txt2img_prompt

* Merge pull request AUTOMATIC1111#10804 from AUTOMATIC1111/fix-xyz-clip

Fix get_conds_with_caching()

* Merge pull request AUTOMATIC1111#10808 from AUTOMATIC1111/fix-disable-png-info

fix disable png info

* fix [Bug]: LoRA don't apply on dropdown list sd_lora AUTOMATIC1111#10880

* add changelog

* assign devices.dtype early because it's needed before the model is loaded

* update readme

* revert default cross attention optimization to Doggettx
make --disable-opt-split-attention command line option work again

* update readme

---------

Co-authored-by: Aarni Koskela <[email protected]>
Co-authored-by: AUTOMATIC1111 <[email protected]>
Co-authored-by: papuSpartan <[email protected]>
Co-authored-by: w-e-w <[email protected]>
Co-authored-by: brkirch <[email protected]>
Co-authored-by: catboxanon <[email protected]>
Co-authored-by: Sakura-Luna <[email protected]>
Co-authored-by: Keith <[email protected]>
Co-authored-by: bobzilladev <[email protected]>
Co-authored-by: grimatoma <[email protected]>
Co-authored-by: Weiming <[email protected]>
Co-authored-by: dennissheng <[email protected]>
Co-authored-by: Baptiste Rajaut <[email protected]>
Co-authored-by: Iheuzio <[email protected]>
Co-authored-by: Kamil Krzyżanowski <[email protected]>
Co-authored-by: ryankashi <[email protected]>
Co-authored-by: Thottyottyotty <[email protected]>
Co-authored-by: anonCantCode <[email protected]>
Co-authored-by: shinshin86 <[email protected]>
  • Loading branch information
1 parent 8149078 commit e18398f
Show file tree
Hide file tree
Showing 199 changed files with 19,048 additions and 9,670 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extensions
extensions-disabled
repositories
venv
88 changes: 88 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/* global module */
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: "latest",
},
rules: {
"arrow-spacing": "error",
"block-spacing": "error",
"brace-style": "error",
"comma-dangle": ["error", "only-multiline"],
"comma-spacing": "error",
"comma-style": ["error", "last"],
"curly": ["error", "multi-line", "consistent"],
"eol-last": "error",
"func-call-spacing": "error",
"function-call-argument-newline": ["error", "consistent"],
"function-paren-newline": ["error", "consistent"],
"indent": ["error", 4],
"key-spacing": "error",
"keyword-spacing": "error",
"linebreak-style": ["error", "unix"],
"no-extra-semi": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
"no-redeclare": ["error", {builtinGlobals: false}],
"no-trailing-spaces": "error",
"no-unused-vars": "off",
"no-whitespace-before-property": "error",
"object-curly-newline": ["error", {consistent: true, multiline: true}],
"object-curly-spacing": ["error", "never"],
"operator-linebreak": ["error", "after"],
"quote-props": ["error", "consistent-as-needed"],
"semi": ["error", "always"],
"semi-spacing": "error",
"semi-style": ["error", "last"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": "error",
"switch-colon-spacing": "error",
"template-curly-spacing": ["error", "never"],
"unicode-bom": "error",
},
globals: {
//script.js
gradioApp: "readonly",
onUiLoaded: "readonly",
onUiUpdate: "readonly",
onOptionsChanged: "readonly",
uiCurrentTab: "writable",
uiElementIsVisible: "readonly",
uiElementInSight: "readonly",
executeCallbacks: "readonly",
//ui.js
opts: "writable",
all_gallery_buttons: "readonly",
selected_gallery_button: "readonly",
selected_gallery_index: "readonly",
switch_to_txt2img: "readonly",
switch_to_img2img_tab: "readonly",
switch_to_img2img: "readonly",
switch_to_sketch: "readonly",
switch_to_inpaint: "readonly",
switch_to_inpaint_sketch: "readonly",
switch_to_extras: "readonly",
get_tab_index: "readonly",
create_submit_args: "readonly",
restart_reload: "readonly",
updateInput: "readonly",
//extraNetworks.js
requestGet: "readonly",
popup: "readonly",
// from python
localization: "readonly",
// progrssbar.js
randomId: "readonly",
requestProgress: "readonly",
// imageviewer.js
modalPrevImage: "readonly",
modalNextImage: "readonly",
}
};
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Apply ESlint
9c54b78d9dde5601e916f308d9a9d6953ec39430
50 changes: 44 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,29 @@ body:
id: what-should
attributes:
label: What should have happened?
description: tell what you think the normal behavior should be
description: Tell what you think the normal behavior should be
validations:
required: true
- type: input
id: commit
attributes:
label: Commit where the problem happens
description: Which commit are you running ? (Do not write *Latest version/repo/commit*, as this means nothing and will have changed by the time we read your issue. Rather, copy the **Commit hash** shown in the cmd/terminal when you launch the UI)
description: Which commit are you running ? (Do not write *Latest version/repo/commit*, as this means nothing and will have changed by the time we read your issue. Rather, copy the **Commit** link at the bottom of the UI, or from the cmd/terminal if you can't launch it.)
validations:
required: true
- type: dropdown
id: py-version
attributes:
label: What Python version are you running on ?
multiple: false
options:
- Python 3.10.x
- Python 3.11.x (above, no supported yet)
- Python 3.9.x (below, no recommended)
- type: dropdown
id: platforms
attributes:
label: What platforms do you use to access UI ?
label: What platforms do you use to access the UI ?
multiple: true
options:
- Windows
Expand All @@ -59,6 +68,18 @@ body:
- iOS
- Android
- Other/Cloud
- type: dropdown
id: device
attributes:
label: What device are you running WebUI on?
multiple: true
options:
- Nvidia GPUs (RTX 20 above)
- Nvidia GPUs (GTX 16 below)
- AMD GPUs (RX 6000 above)
- AMD GPUs (RX 5000 below)
- CPU
- Other GPUs
- type: dropdown
id: browsers
attributes:
Expand All @@ -74,10 +95,27 @@ body:
id: cmdargs
attributes:
label: Command Line Arguments
description: Are you using any launching parameters/command line arguments (modified webui-user.py) ? If yes, please write them below
description: Are you using any launching parameters/command line arguments (modified webui-user .bat/.sh) ? If yes, please write them below. Write "No" otherwise.
render: Shell
validations:
required: true
- type: textarea
id: extensions
attributes:
label: List of extensions
description: Are you using any extensions other than built-ins? If yes, provide a list, you can copy it at "Extensions" tab. Write "No" otherwise.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Console logs
description: Please provide **full** cmd/terminal logs from the moment you started UI to the end of it, after your bug happened. If it's very long, provide a link to pastebin or similar service.
render: Shell
validations:
required: true
- type: textarea
id: misc
attributes:
label: Additional information, context and logs
description: Please provide us with any relevant additional info, context or log output.
label: Additional information
description: Please provide us with any relevant additional info or context.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature request
description: Suggest an idea for this project
title: "[Feature Request]: "
labels: ["suggestion"]
labels: ["enhancement"]

body:
- type: checkboxes
Expand Down
28 changes: 0 additions & 28 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md

This file was deleted.

15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Description

* a simple description of what you're trying to accomplish
* a summary of changes in code
* which issues it fixes, if any

## Screenshots/videos:


## Checklist:

- [ ] I have read [contributing wiki page](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing)
- [ ] I have performed a self-review of my own code
- [ ] My code follows the [style guidelines](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing#code-style)
- [ ] My code passes [tests](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Tests)
50 changes: 21 additions & 29 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,34 @@
# See https://github.com/actions/starter-workflows/blob/1067f16ad8a1eac328834e4b0ae24f7d206f810d/ci/pylint.yml for original reference file
name: Run Linting/Formatting on Pull Requests

on:
- push
- pull_request
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore for syntax docs
# if you want to filter out branches, delete the `- pull_request` and uncomment these lines :
# pull_request:
# branches:
# - master
# branches-ignore:
# - development

jobs:
lint:
lint-python:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: 3.10.6
- uses: actions/cache@v2
python-version: 3.11
# NB: there's no cache: pip here since we're not installing anything
# from the requirements.txt file(s) in the repository; it's faster
# not to have GHA download an (at the time of writing) 4 GB cache
# of PyTorch and other dependencies.
- name: Install Ruff
run: pip install ruff==0.0.265
- name: Run Ruff
run: ruff .
lint-js:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install PyLint
run: |
python -m pip install --upgrade pip
pip install pylint
# This lets PyLint check to see if it can resolve imports
- name: Install dependencies
run : |
export COMMANDLINE_ARGS="--skip-torch-cuda-test --exit"
python launch.py
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
node-version: 18
- run: npm i --ci
- run: npm run lint
61 changes: 50 additions & 11 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,57 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.10.6
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
cache: pip
cache-dependency-path: |
**/requirements*txt
launch.py
- name: Install test dependencies
run: pip install wait-for-it -r requirements-test.txt
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
- name: Setup environment
run: python launch.py --skip-torch-cuda-test --exit
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
TORCH_INDEX_URL: https://download.pytorch.org/whl/cpu
WEBUI_LAUNCH_LIVE_OUTPUT: "1"
PYTHONUNBUFFERED: "1"
- name: Start test server
run: >
python -m coverage run
--data-file=.coverage.server
launch.py
--skip-prepare-environment
--skip-torch-cuda-test
--test-server
--no-half
--disable-opt-split-attention
--use-cpu all
--add-stop-route
2>&1 | tee output.txt &
- name: Run tests
run: python launch.py --tests basic_features --no-half --disable-opt-split-attention --use-cpu all --skip-torch-cuda-test
- name: Upload main app stdout-stderr
run: |
wait-for-it --service 127.0.0.1:7860 -t 600
python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
- name: Kill test server
if: always()
run: curl -vv -XPOST http://127.0.0.1:7860/_stop && sleep 10
- name: Show coverage
run: |
python -m coverage combine .coverage*
python -m coverage report -i
python -m coverage html -i
- name: Upload main app output
uses: actions/upload-artifact@v3
if: always()
with:
name: output
path: output.txt
- name: Upload coverage HTML
uses: actions/upload-artifact@v3
if: always()
with:
name: stdout-stderr
path: |
test/stdout.txt
test/stderr.txt
name: htmlcov
path: htmlcov
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ notification.mp3
/extensions
/test/stdout.txt
/test/stderr.txt
/cache.json*
/config_states/
/node_modules
/package-lock.json
/.coverage*
Loading

0 comments on commit e18398f

Please sign in to comment.