Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: IndexError while applying cross attention optimization at startup (dev branch) #10605

Closed
1 task done
MMP0 opened this issue May 21, 2023 · 10 comments
Closed
1 task done
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@MMP0
Copy link
Contributor

MMP0 commented May 21, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

I always get an IndexError while applying cross attention optimization at startup regardless of the cross_attention_optimization value. And this causes CUDA out of memory as no optimizations are applied.

After changing Settings > Optimizations > Cross attention optimization and clicking the [Apply settings] button, the optimizer is applied as expected. It only fails at startup.

Steps to reproduce the problem

  1. Clone the project
  2. Launch

What should have happened?

IndexError should not be raised.

It should be

applying cross attention optimization: sdp-no-mem

or something.

Commit where the problem happens

05e6fc9

What platforms do you use to access the UI ?

No response

What browsers do you use to access the UI ?

No response

Command Line Arguments

./webui.sh --opt-sdp-attention --opt-sdp-no-mem-attention --opt-split-attention

List of extensions

Extension URL Version Update
sd-extension-system-info https://github.com/vladmandic/sd-extension-system-info.git 79243697 (Thu May 18 11:01:58 2023) unknown
LDSR built-in    
Lora built-in    
ScuNET built-in    
SwinIR built-in    
prompt-bracket-checker built-in    

Console logs

applying cross attention optimization: IndexError
Traceback (most recent call last):
  File "/content/stable-diffusion-webui/modules/sd_hijack.py", line 172, in hijack
    self.optimization_method = apply_optimizations()
  File "/content/stable-diffusion-webui/modules/sd_hijack.py", line 67, in apply_optimizations
    matching_optimizer = optimizers[0]
IndexError: list index out of range

Additional information

OS: Linux

@MMP0 MMP0 added the bug-report Report of a bug, yet to be confirmed label May 21, 2023
@racinmat
Copy link
Contributor

I have this error when I don't specify any optimization, because the default value is "Automatic" and I also get this error.

@wzgrx
Copy link
Contributor

wzgrx commented May 23, 2023

mark

@evanjs
Copy link

evanjs commented May 23, 2023

Re out of memory errors:
I was expierencing these as well, until I noticed cross attention optimization was set to Automatic, which then selected Scaled Dot Product (SDP)

From my experience playing with SDP before, it is quite a bit more intensive than Doggettx
For example: Using SDP, my card cannot handle Hires Fix @ 512x768 x 1.5

Setting the optimization back to Doggettx manually and applying/saving changes allowed me to continue using Hires as I was before without running out of memory.

Though, it seems like you're setting SDP on launch, here, so I'm curious if your setup can handle SDP in general.

If anything, my issue seems to match what @racinmat is experiencing.


TL;DR—try setting Cross attention optimization to Doggettx if you're running out of memory with SDP (which is currently selected by the Automatic option, at least for me)

@KohakuBlueleaf
Copy link
Collaborator

I also have this error, and no matter which optimization I choose. it will give me this error when startup. And I need to choose different optimization after startup to ensure it apply the optimization.

@KohakuBlueleaf
Copy link
Collaborator

I have traced this a bit.
it looks like for now, webui will not load the optimization method before the first model loading.
So when model loaded at startup, it has no optimization to use(so index error, there is no optimization in the list)

@AUTOMATIC1111
Copy link
Owner

List with optimizations is filled here:

modules.sd_hijack.list_optimizers()

Model is created here:

Thread(target=lambda: shared.sd_model).start()

The way for the list to be empty is if some extension accesses model early, before list_optimizers is called, which is actually pretty easy. If that really is the case (and it also explains why I'm not getting this problem), the soultion should be to allow the list to be empty without any errors and later check if applied optimization is none and if it is, apply it one more time.

@AUTOMATIC1111
Copy link
Owner

The branch with a possible fix: https://github.com/AUTOMATIC1111/stable-diffusion-webui/tree/fix-empty-optimizations-10605

@MMP0
Copy link
Contributor Author

MMP0 commented May 23, 2023

Sorry, I forgot to mention extensions.
I think sd-extension-system-info which accesses sd_hijack on startup causes this error.

@AUTOMATIC1111
Copy link
Owner

See if the problem goes away if you checkout the branch with the fix.

@MMP0
Copy link
Contributor Author

MMP0 commented May 23, 2023

Yes, I don’t get the error on the branch, thanks.

@MMP0 MMP0 closed this as completed May 23, 2023
@MMP0 MMP0 reopened this May 23, 2023
Antonytm added a commit to Antonytm/stable-diffusion-webui-automatic1111 that referenced this issue Jun 4, 2023
* 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]>
@MMP0 MMP0 closed this as completed Jun 8, 2023
@w-e-w w-e-w mentioned this issue Jun 10, 2023
theBlaufuss added a commit to theBlaufuss/stable-diffusion-webui that referenced this issue Jun 30, 2023
* repair file paste for Firefox from AUTOMATIC1111#10615
remove animation when pasting files into prompt
rework two dragdrop js files into one

* Upgrade Gradio, remove docs URL hack

* fix error in dragdrop logic

* Add custom karras scheduler

* remove debug print

* `modules/api/api.py`: disable `timeout_keep_alive`

* Add dropdown for scheduler type

* Change karras to kdiffusion

* Replace karras by k_diffusion, fix gen info

* only add metadata when k_sched is actually been used

* remove not related code

* Avoid loop import

* Minor naming fixes

* Add error information for recursion error

* use sigma_max/min in model if sigma_max/min is 0

* Revert AUTOMATIC1111#10586

* Fix for AUTOMATIC1111#10643 (pixel noise in webui inpainting canvas breaking inpainting, so that it behaves like plain img2img)

* Better hint for user

Co-authored-by: catboxanon <[email protected]>

* Add hint for custom k_diffusion scheduler

* Use settings instead of main interface

* Use better way to impl

* Fix xyz

* Subject:.
Improvements to handle VAE filenames in generated image filenames

Body:.
1) Added new line 24 to import sd_vae module.
2) Added new method get_vae_filename at lines 340-349 to obtain the VAE filename to be used for image generation and further process it to extract only the filename by splitting it with a dot symbol.
3) Added a new lambda function 'vae_filename' at line 373 to handle VAE filenames.

Reason:.
A function was needed to get the VAE filename and handle it in the program.

Test:.
We tested whether we could use this new functionality to get the expected file names.
The correct behaviour was confirmed for the following commonly distributed VAE files.
vae-ft-mse-840000-ema-pruned.safetensors -> vae-ft-mse-840000-ema-pruned
anything-v4.0.vae.pt -> anything-v4.0

ruff response:.
There were no problems with the code I added.

There was a minor configuration error in a line I did not modify, but I did not modify it as it was not relevant to this modification.
Logged.
images.py:426:56: F841 [*] Local variable `_` is assigned to but never used
images.py:432:43: F841 [*] Local variable `_` is assigned to but never used

Impact:.
This change makes it easier to retrieve the VAE filename used for image generation and use it in the programme.

* Use type to determine if it is enable

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

* possible fix for empty list of optimizations AUTOMATIC1111#10605

* Fix ruff error

* Use automatic instead of None/default

* improvements

See:
AUTOMATIC1111#10649 (comment)

* use Schedule instead of Sched

* Changed 'images.zip' to generation by pattern

* Optimize tooltip checks

* Instead of traversing tens of thousands of text nodes, only look at elements and their children
* Debounce the checks to happen only every one second

* Restore support for dropdown tooltips

* Add support for tooltips on dropdown options

* Cleaner image metadata read

* Just use console.error, it's in all browsers

* Merge executeCallbacks and runCallback, simplify + optimize

* Document on* handlers (for extension authors' sake)

* Add onAfterUiUpdate callback

* Use onAfterUiUpdate where possible

* Remove try/except in img metadata read

* Small fixes to prepare_tcmalloc for Debian/Ubuntu compatibility

- /usr/sbin (where ldconfig is usually located) is not typically on users' PATHs by default, so we set that variable before trying to run ldconfig.
- The libtcmalloc library is called libtcmalloc_minimal on Debian/Ubuntu systems. We now check whether libtcmalloc_minimal exists when running prepare_tcmalloc.

* change to AMD only if NVIDIA is not presented

* Update webui.sh

* Remove exit() from select_checkpoint()

Raising a FileNotFoundError instead.

* Show full traceback in get_sd_model()

to reveal if an error is caused by an extension

* custom unet support

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

* updates for the noise schedule settings

* Ability to zoom and move the canvas

* Formatted Prettier added fullscreen mode canvas expansion function

* Improve reset zoom when toggle tabs

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

* Mark caption_image_overlay's textfont as deprecated; fix AUTOMATIC1111#10778

* Sort requirements files

* Upgrade xformers

* Synchronize requirements/requirements_versions

* Remove deps not listed in _versions from requirements

* Omit versions when they don't match _versions

* fix "hires. fix" prompt/neg sharing same labels as txt2img_prompt/negative_prompt

* typo

vidocard -> videocard

* Corrected the code according to Code style

* changed the document to gradioApp()

* Round down scale destination dimensions to nearest multiple of 8

* Refactor EmbeddingDatabase.register_embedding() to allow unregistering

* fix xyz clip

* Upgrade transformers

Refs AUTOMATIC1111#9035 (comment)

* fix disable png info

* clarify issue template

* Only poll gamepads while connected

* Update imageviewerGamepad.js

* Patch GitPython to not use leaky persistent processes

* Add & use modules.errors.print_error where currently printing exception info by hand

* Revert "fix xyz clip"

This reverts commit edd766e.

* fix get_conds_with_caching()

* improve filename matching for mask

we should not rely that mask filename will be of the same extension
as the image filename so better pattern matching is added

* add scale_by to batch processing

* ruffed

* Moved the script to the extension build-in

* Added VAE listing to web API.

* Fix s_min_uncond default type int

* Move gamepaddisconnected listener

* Vendor in the single module used from taming_transformers; remove taming_transformers dependency

(and fix the two ruff complaints)

* a small fix for very wide images, because of the scroll bar was the wrong zoom

* Frontend: only look at top-level tabs, not nested tabs

Refs adieyal/sd-dynamic-prompts#459 (comment)

* Fix typo in `--update-check` help message

Change `chck` to `check`

* rename print_error to report, use it with together with package name

* change UI reorder setting to multiselect

* add an option to show selected setting in main txt2img/img2img UI
split some code from ui.py into ui_settings.py ui_gradio_edxtensions.py
add before_process callback for scripts
add ability for alwayson scripts to specify section and let user reorder those sections

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

* Fixed the problem with sticking to the mouse, created a tooltip

* use ui_reorder_list rather than ui_reorder for UI reorder option to make the program not break when reverting to old version

* fix 10896 pnginfo parameters

* remove redundant

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

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

* add hiding and a colspans to startup profile table

* add subdir support for images, masks and output; search mask only in subdir

* fallback to original file retrieving; skip img if mask not found

usage of `shared.walk_files` breaks controlnet extension
images are processed in different order 
which leads to unmatched img file used for img2img and img file used for controlnet 
(if no folder is specified for control net
or the same as img2img input dir used for it)

* revert the erroneous change for model setting added in df02498

* Added the ability to configure hotkeys via webui

Now you can configure the hotkeys directly through the settings

JS and Python scripts are tested and code style compliant

* Added a hotkey repeat check to avoid bugs

* Support dynamic sort of extra networks

* lint fixes

* Cross attention optimization

Cross attention optimization

cross attention optimization

* remove redundant call list_optimizers()

* remove redundant

* Simplify a bunch of `len(x) > 0`/`len(x) == 0` style expressions

* fallback version info form CHANGELOG.md

* Made tooltip optional.

You can disable it in the settings.
Enabled by default

* Added support for workarounds on external GPU.

lspci detects VGA for main/integrated videocards and Display
for external videocards.

This commit should apply workarounds on computers with more than
one GPU. Useful for most laptops using weak iGPU and good dGPU.

Signed-off-by: Pablo Cholaky <[email protected]>

* Apply suggestions from code review

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

* Added the ability to swap the zoom hotkeys and resize the brush

* small ui fix

In the error the user will see R instead of KeyR

* Update modules/launch_utils.py

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

* fallback version info form CHANGELOG.md

* a yet another method to restart webui

* Added sysinfo tab to settings

* lint

* Round upscaled dimensions only when not divisible by 8

* Use a more concise calculation for dest dims

* Fix missing ext_filter kwarg

* Made the applyZoomAndPan function global for other extensions

* torch.cuda.is_available() check for SdOptimizationXformers

* fix conds caching with extra network

* simplify self.extra_network_data

* remove redone compare

* Fixed the redmask bug

* Made a function applyZoomAndPan isolated each instance

Isolated each instance of applyZoomAndPan, now if you add another element to the page, they will work correctly

* Fixed visual bugs

* Correct definition zoom level

I changed the regular expression and now I always have to select scale from style.transfo

* Update ui_tempdir.py

Make override function have the same input parameters with original function

* infer styles from prompts, and an option to control the behavior

* add whitelist for environment in the report
add extra link to view the report instead of downloading it

* fix the broken line for AUTOMATIC1111#10990

* fix for conds of second hires fox pass being calculated using first pass's networks, and add an option to revert to old behavior

* prevent calculating cons for second pass of hires fix when they are the same as for the first pass

* Add endpoint to get latent_upscale_modes for hires fix

* Zoom and Pan: move helpers into its namespace to avoid littering global scope

* Zoom and Pan: use elementIDs from closure scope

* Zoom and Pan: simplify getElements (it's not actually async)

* Zoom and Pan: use for instead of forEach

* Zoom and Pan: simplify waitForOpts

* revert the message to how it was

* rework-disable-autolaunch

* Restart: only do restart if running via the wrapper script

* restore old disable --autolaunch

* SD_WEBUI_RESTARTING

* print error and continue

print error and continue

* Forcing Torch Version to 1.13.1 for Navi and Renoir GPUs

* Fix error in webui.sh

* Force python1 for Navi1 only, use python_cmd for python

* Check python version for Navi 1 only

* Write "RX 5000 Series" instead of "Navi" in err

* link footer API to Wiki when API is not active

* Skip force pyton and pytorch ver if TORCH_COMMAND already set

* Fix upcast attention dtype error.

Without this fix, enabling the "Upcast cross attention layer to float32" option while also using `--opt-sdp-attention` breaks generation with an error:

```
  File "/ext3/automatic1111/stable-diffusion-webui/modules/sd_hijack_optimizations.py", line 612, in sdp_attnblock_forward
    out = torch.nn.functional.scaled_dot_product_attention(q, k, v, dropout_p=0.0, is_causal=False)
RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: float key.dtype: float and value.dtype: c10::Half instead.
```

The fix is to make sure to upcast the value tensor too.

* persistent conds cache

Update shared.py

* Generate Forever during generation

Generate Forever during generation

* Split mask blur into X and Y components

Prequisite to fixing Outpainting MK2 mask blur bug.

* Split Outpainting MK2 mask blur into X and Y components

Fixes unexpected noise in non-outpainted borders when using MK2 script.

* Don't die when a LoRA is a broken symlink

Fixes AUTOMATIC1111#11098

* linter

* add changelog for 1.4.0

* fixed typos

* Improved error output, improved settings menu

* remove console.log

* Use os.makedirs(..., exist_ok=True)

* Reworked the disabling of functions, refactored part of the code

* Formatting code with Prettier

* Fix Typo of hints.js

* Strip whitespaces from URL and dirname prior to extension installation

This avoid some cryptic errors brought by accidental spaces around urls

* add missing infotext entry for the pad cond/uncond option

---------

Signed-off-by: Pablo Cholaky <[email protected]>
Co-authored-by: AUTOMATIC1111 <[email protected]>
Co-authored-by: Aarni Koskela <[email protected]>
Co-authored-by: Kohaku-Blueleaf <[email protected]>
Co-authored-by: Monty Anderson <[email protected]>
Co-authored-by: catboxanon <[email protected]>
Co-authored-by: ArthurHeitmann <[email protected]>
Co-authored-by: fumitaka.yano <[email protected]>
Co-authored-by: strelokhalfer <[email protected]>
Co-authored-by: kernelmethod <[email protected]>
Co-authored-by: Roman Beltiukov <[email protected]>
Co-authored-by: linkoid <[email protected]>
Co-authored-by: Danil Boldyrev <[email protected]>
Co-authored-by: Sakura-Luna <[email protected]>
Co-authored-by: nyqui <[email protected]>
Co-authored-by: yoinked <[email protected]>
Co-authored-by: ramyma <[email protected]>
Co-authored-by: klimaleksus <[email protected]>
Co-authored-by: w-e-w <[email protected]>
Co-authored-by: missionfloyd <[email protected]>
Co-authored-by: Artem Kotov <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: David Chuang <[email protected]>
Co-authored-by: Will Frey <[email protected]>
Co-authored-by: Pablo Cholaky <[email protected]>
Co-authored-by: Chanchana Sornsoontorn <[email protected]>
Co-authored-by: Vivek K. Vasishtha <[email protected]>
Co-authored-by: Vesnica <[email protected]>
Co-authored-by: DGdev91 <[email protected]>
Co-authored-by: Alexander Ljungberg <[email protected]>
Co-authored-by: Splendide Imaginarius <[email protected]>
Co-authored-by: arch-fan <[email protected]>
Co-authored-by: zhtttylz <[email protected]>
Co-authored-by: Jabasukuriputo Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

6 participants