stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Support Gradio's theme API

Open space-nuko opened this issue 2 years ago • 6 comments

Describe what this pull request is trying to achieve.

Adds support for loading Gradio themes. Adds a "Gradio theme" config option

Additional notes and description of your changes

The list of available themes is taken from Hugging Face Hub

Environment this was tested in

List the environment you have developed / tested this on. As per the contributing page, changes should be able to work on Windows out of the box.

  • OS: Windows
  • Browser: Chrome
  • Graphics card: NVIDIA RTX 3090

Screenshots or videos of your changes

Monochrome theme 2023-03-21 20_35_30-Stable Diffusion - Chromium

Darcula theme 2023-03-25 16_14_29-Stable Diffusion - Chromium

space-nuko avatar Mar 25 '23 20:03 space-nuko

Where do I look to find such themes? could you also tell me what font you've used here

Hosiokaa avatar Mar 26 '23 04:03 Hosiokaa

In this PR it's the Gradio theme (requires restart) option under User Interface in the settings

The font is called Poppins

space-nuko avatar Mar 26 '23 04:03 space-nuko

This one is a touch to make decision on. Its small and nice, but I think the main tool for the developer of the theme should be css, not gradio theme stuff. Any non-default gradio theme then would mess up the chosen css for user.

AUTOMATIC1111 avatar Mar 27 '23 04:03 AUTOMATIC1111

This one is a touch to make decision on. Its small and nice, but I think the main tool for the developer of the theme should be css, not gradio theme stuff. Any non-default gradio theme then would mess up the chosen css for user.

yes but... ;)

new gradio finally uses well-formatted css, so its much easier to override variables in user.css than to target specific elements or classes)

example of built-in theme css:

.dark {
  --body-text-color: var(--neutral-100);
  --color-accent-soft: var(--neutral-700);
...

vladmandic avatar Mar 27 '23 16:03 vladmandic

Looks like some merge was done on the branch for this PR

catboxanon avatar Apr 16 '23 15:04 catboxanon

Looks like some merge was done on the branch for this PR

I've merged the PR into different fork, but WTF is github doing listing all totally unrelated items here. update: phew, i've managed to clean it up. this pr remains as-is for original a1111 while modified/extented version is in different fork.

vladmandic avatar Apr 18 '23 01:04 vladmandic