AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.91k stars 26.94k forks source link

[Bug]: Gradio slider overlay color or CSS gets nuked by some extensions (for Safari) #14729

Closed raffetazarius closed 9 months ago

raffetazarius commented 9 months ago

Checklist

What happened?

Similar to the following issues

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/8910 https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9053 https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/9135

it seems that the A1111 slider overlay CSS can get nuked by poorly coded Extensions, and the problem persists after those extensions are disabled and deleted.

This has happened me multiple times, on multiple FRESH installs of the a1111 UI, using the default Gradio theme, and enabling a specific Extension.

I'm left without the usual blue overlay on sliders, which is kinda critical to seeing where sliders are.

Screenshot 2024-01-22 at 08 51 27

instead of the usual blue slider background that can be seen here: https://gyazo.com/12372e999dd4af603065076160b600a7

I've narrowed it down to the following extensions causing it:

sd-webui-ar - definitely sd-webui-aspect-ratio-helper - possibly also


SUGGESTED FIX

Better protecting Gradio CSS against hacking/modification by Extensions.

STEPS TAKEN TO TRY FIX

I've deleted my /venv/ folder and rebuilt it. The issue persists.


NOTE: This is not caused by any of the other currently active Extensions on my install - I've verified this by fresh installing A1111 and enabling only these extensions multiple times.

Steps to reproduce the problem

  1. Install A1111 web-ui
  2. Note how the UI looks
  3. Install the sd-webui-ar Extension
  4. Note how the UI CSS changes, and sliders no longer have the blue background.

What should have happened?

The A1111 Gradio CSS for slider controls should not change.

What browsers do you use to access the UI ?

Google Chrome, Apple Safari

Sysinfo

sysinfo-2024-01-22-17-01.json

Console logs

privateuser@Mac-Pro stable-diffusion-webui % PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on privateuser user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.13 (main, Jan  6 2024, 09:01:35) [Clang 15.0.0 (clang-1500.1.0.2.5)]
Version: v1.7.0
Commit hash: cf2772fab0af5573da775e7437e6acdca424f26e
Installing torch and torchvision
Looking in indexes: https://download.pytorch.org/whl/nightly/cpu
Collecting torch
  Downloading https://download.pytorch.org/whl/nightly/cpu/torch-2.3.0.dev20240122-cp310-none-macosx_10_9_x86_64.whl (152.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 152.3/152.3 MB 15.3 MB/s eta 0:00:00
Collecting torchvision
  Downloading https://download.pytorch.org/whl/nightly/cpu/torchvision-0.18.0.dev20240122-cp310-cp310-macosx_10_13_x86_64.whl (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 17.4 MB/s eta 0:00:00
Collecting torchaudio
  Downloading https://download.pytorch.org/whl/nightly/cpu/torchaudio-2.2.0.dev20240122-cp310-cp310-macosx_10_13_x86_64.whl (3.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 32.5 MB/s eta 0:00:00
Collecting sympy
  Using cached https://download.pytorch.org/whl/nightly/sympy-1.11.1-py3-none-any.whl (6.5 MB)
Collecting typing-extensions>=4.8.0
  Using cached https://download.pytorch.org/whl/nightly/typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Collecting networkx
  Using cached https://download.pytorch.org/whl/nightly/networkx-3.0rc1-py3-none-any.whl (2.0 MB)
Collecting jinja2
  Using cached https://download.pytorch.org/whl/nightly/Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting filelock
  Using cached https://download.pytorch.org/whl/nightly/filelock-3.9.0-py3-none-any.whl (9.7 kB)
Collecting fsspec
  Using cached https://download.pytorch.org/whl/nightly/fsspec-2023.4.0-py3-none-any.whl (153 kB)
Collecting pillow!=8.3.*,>=5.3.0
  Using cached https://download.pytorch.org/whl/nightly/Pillow-9.3.0-cp310-cp310-macosx_10_10_x86_64.whl (3.3 MB)
Collecting requests
  Using cached https://download.pytorch.org/whl/nightly/requests-2.28.1-py3-none-any.whl (62 kB)
Collecting numpy
  Using cached https://download.pytorch.org/whl/nightly/numpy-1.24.1-cp310-cp310-macosx_10_9_x86_64.whl (19.8 MB)
Collecting MarkupSafe>=2.0
  Using cached https://download.pytorch.org/whl/nightly/MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl (13 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached https://download.pytorch.org/whl/nightly/urllib3-1.26.13-py2.py3-none-any.whl (140 kB)
Collecting certifi>=2017.4.17
  Using cached https://download.pytorch.org/whl/nightly/certifi-2022.12.7-py3-none-any.whl (155 kB)
Collecting idna<4,>=2.5
  Using cached https://download.pytorch.org/whl/nightly/idna-3.4-py3-none-any.whl (61 kB)
Collecting charset-normalizer<3,>=2
  Using cached https://download.pytorch.org/whl/nightly/charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting mpmath>=0.19
  Using cached https://download.pytorch.org/whl/nightly/mpmath-1.2.1-py3-none-any.whl (532 kB)
Installing collected packages: mpmath, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, fsspec, filelock, charset-normalizer, certifi, requests, jinja2, torch, torchvision, torchaudio
Successfully installed MarkupSafe-2.1.3 certifi-2022.12.7 charset-normalizer-2.1.1 filelock-3.9.0 fsspec-2023.4.0 idna-3.4 jinja2-3.1.2 mpmath-1.2.1 networkx-3.0rc1 numpy-1.24.1 pillow-9.3.0 requests-2.28.1 sympy-1.11.1 torch-2.3.0.dev20240122 torchaudio-2.2.0.dev20240122 torchvision-0.18.0.dev20240122 typing-extensions-4.8.0 urllib3-1.26.13
WARNING: There was an error checking the latest version of pip.
Installing clip
Installing open_clip
Installing requirements for CodeFormer
Installing requirements
Collecting ultralytics>=8.1.0
  Using cached ultralytics-8.1.4-py3-none-any.whl (701 kB)
Requirement already satisfied: opencv-python>=4.6.0 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (4.9.0.80)
Requirement already satisfied: psutil in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (5.9.5)
Requirement already satisfied: matplotlib>=3.3.0 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (3.8.2)
Requirement already satisfied: torchvision>=0.9.0 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (0.18.0.dev20240122)
Requirement already satisfied: numpy>=1.22.2 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (1.23.5)
Requirement already satisfied: pillow>=7.1.2 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (9.5.0)
Collecting thop>=0.1.1
  Using cached thop-0.1.1.post2209072238-py3-none-any.whl (15 kB)
Requirement already satisfied: scipy>=1.4.1 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (1.12.0)
Requirement already satisfied: pandas>=1.1.4 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (2.2.0)
Collecting seaborn>=0.11.0
  Using cached seaborn-0.13.1-py3-none-any.whl (294 kB)
Requirement already satisfied: torch>=1.8.0 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (2.3.0.dev20240122)
Requirement already satisfied: requests>=2.23.0 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (2.28.1)
Requirement already satisfied: pyyaml>=5.3.1 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (6.0.1)
Collecting py-cpuinfo
  Using cached py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)
Requirement already satisfied: tqdm>=4.64.0 in ./venv/lib/python3.10/site-packages (from ultralytics>=8.1.0) (4.66.1)
Requirement already satisfied: pyparsing>=2.3.1 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (3.1.1)
Requirement already satisfied: contourpy>=1.0.1 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (1.2.0)
Requirement already satisfied: packaging>=20.0 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (23.2)
Requirement already satisfied: kiwisolver>=1.3.1 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (1.4.5)
Requirement already satisfied: cycler>=0.10 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (4.47.2)
Requirement already satisfied: python-dateutil>=2.7 in ./venv/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics>=8.1.0) (2.8.2)
Requirement already satisfied: tzdata>=2022.7 in ./venv/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics>=8.1.0) (2023.4)
Requirement already satisfied: pytz>=2020.1 in ./venv/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics>=8.1.0) (2023.3.post1)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics>=8.1.0) (2022.12.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./venv/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics>=8.1.0) (1.26.13)
Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics>=8.1.0) (3.4)
Requirement already satisfied: charset-normalizer<3,>=2 in ./venv/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics>=8.1.0) (2.1.1)
Requirement already satisfied: jinja2 in ./venv/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics>=8.1.0) (3.1.2)
Requirement already satisfied: filelock in ./venv/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics>=8.1.0) (3.9.0)
Requirement already satisfied: fsspec in ./venv/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics>=8.1.0) (2023.12.2)
Requirement already satisfied: typing-extensions>=4.8.0 in ./venv/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics>=8.1.0) (4.8.0)
Requirement already satisfied: sympy in ./venv/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics>=8.1.0) (1.11.1)
Requirement already satisfied: networkx in ./venv/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics>=8.1.0) (3.0rc1)
Requirement already satisfied: six>=1.5 in ./venv/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib>=3.3.0->ultralytics>=8.1.0) (1.16.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.10/site-packages (from jinja2->torch>=1.8.0->ultralytics>=8.1.0) (2.1.3)
Requirement already satisfied: mpmath>=0.19 in ./venv/lib/python3.10/site-packages (from sympy->torch>=1.8.0->ultralytics>=8.1.0) (1.2.1)
Installing collected packages: py-cpuinfo, thop, seaborn, ultralytics
Successfully installed py-cpuinfo-9.0.0 seaborn-0.13.1 thop-0.1.1.post2209072238 ultralytics-8.1.4
Collecting mediapipe>=0.10.9
  Using cached mediapipe-0.10.9-cp310-cp310-macosx_11_0_x86_64.whl (47.1 MB)
Requirement already satisfied: absl-py in ./venv/lib/python3.10/site-packages (from mediapipe>=0.10.9) (2.1.0)
Requirement already satisfied: protobuf<4,>=3.11 in ./venv/lib/python3.10/site-packages (from mediapipe>=0.10.9) (3.20.0)
Requirement already satisfied: matplotlib in ./venv/lib/python3.10/site-packages (from mediapipe>=0.10.9) (3.8.2)
Collecting opencv-contrib-python
  Using cached opencv_contrib_python-4.9.0.80-cp37-abi3-macosx_10_16_x86_64.whl (65.4 MB)
Collecting flatbuffers>=2.0
  Using cached flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB)
Requirement already satisfied: numpy in ./venv/lib/python3.10/site-packages (from mediapipe>=0.10.9) (1.23.5)
Collecting sounddevice>=0.4.4
  Using cached sounddevice-0.4.6-py3-none-macosx_10_6_x86_64.macosx_10_6_universal2.whl (107 kB)
Requirement already satisfied: attrs>=19.1.0 in ./venv/lib/python3.10/site-packages (from mediapipe>=0.10.9) (23.2.0)
Collecting CFFI>=1.0
  Using cached cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl (182 kB)
Requirement already satisfied: contourpy>=1.0.1 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (1.2.0)
Requirement already satisfied: fonttools>=4.22.0 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (4.47.2)
Requirement already satisfied: pillow>=8 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (9.5.0)
Requirement already satisfied: python-dateutil>=2.7 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (2.8.2)
Requirement already satisfied: pyparsing>=2.3.1 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (3.1.1)
Requirement already satisfied: packaging>=20.0 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (23.2)
Requirement already satisfied: cycler>=0.10 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (0.12.1)
Requirement already satisfied: kiwisolver>=1.3.1 in ./venv/lib/python3.10/site-packages (from matplotlib->mediapipe>=0.10.9) (1.4.5)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Requirement already satisfied: six>=1.5 in ./venv/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib->mediapipe>=0.10.9) (1.16.0)
Installing collected packages: flatbuffers, pycparser, opencv-contrib-python, CFFI, sounddevice, mediapipe
Successfully installed CFFI-1.16.0 flatbuffers-23.5.26 mediapipe-0.10.9 opencv-contrib-python-4.9.0.80 pycparser-2.21 sounddevice-0.4.6
Collecting rich>=13.0.0
  Using cached rich-13.7.0-py3-none-any.whl (240 kB)
Collecting pygments<3.0.0,>=2.13.0
  Using cached pygments-2.17.2-py3-none-any.whl (1.2 MB)
Collecting markdown-it-py>=2.2.0
  Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Collecting mdurl~=0.1
  Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: pygments, mdurl, markdown-it-py, rich
Successfully installed markdown-it-py-3.0.0 mdurl-0.1.2 pygments-2.17.2 rich-13.7.0
Installing sd-webui-infinite-image-browsing requirement: python-dotenv
Installing sd-webui-infinite-image-browsing requirement: pyfunctional
Installing requirement for task-scheduler
Launching Web UI with arguments: --skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half --medvram-sdxl --use-cpu interrogate
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Style database not found: /Users/privateuser/stable-diffusion-webui/styles.csv
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
Civitai Helper: Get Custom Model Folder
[-] ADetailer initialized. version: 24.1.1, num models: 14
Using sqlite file: /Users/privateuser/stable-diffusion-webui/extensions/sd-webui-agent-scheduler/task_scheduler.sqlite3
Loading weights [ed9015e9bc] from /Users/privateuser/stable-diffusion-webui/models/Stable-diffusion/SD 1.5/mercadoralpha_v10.safetensors
Civitai Helper: Set Proxy: 
Creating model from config: /Users/privateuser/stable-diffusion-webui/configs/v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 152.2s (prepare environment: 140.7s, import torch: 3.7s, import gradio: 1.2s, setup paths: 0.8s, initialize shared: 0.2s, other imports: 1.1s, load scripts: 2.1s, create ui: 1.1s, gradio launch: 0.5s, app_started_callback: 0.7s).
Applying attention optimization: sub-quadratic... done.
Model loaded in 7.6s (load weights from disk: 1.2s, create model: 0.5s, apply weights to model: 4.0s, apply float(): 0.4s, calculate empty prompt: 1.3s).

Additional information

No response

raffetazarius commented 9 months ago

Changing the UI theme to another theme and back to "Default" does not restore the slider colors.

raffetazarius commented 9 months ago

Actually I've discovered this issue only impacts Safari, not Chrome

raffetazarius commented 9 months ago

Have since realized this seems to be due to how Safari (WebKit) displays sliders by default, not due to a SDUI or Gradio bug specifically. Sliders in Safari don't have the blue color that they do have (by default) in Chrome, so I think there would need to be some custom WebKit/Safari-specific CSS in Gradio for them to display consistently across browsers.