aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-10-18 11:04:26 +0000
committerGitHub <noreply@github.com>2022-10-18 11:04:26 +0000
commitc07dbd4cf9831b1f785c01a6dec409c0338a41ab (patch)
treedd1a7276d6d43f950227e54dbae28fbf6801d35b /modules
parentc71008c74156635558bb2e877d1628913f6f781e (diff)
parentf6c758d055ca8e181d5bfc056cb85ff5a2df7f66 (diff)
downloadstable-diffusion-webui-gfx803-c07dbd4cf9831b1f785c01a6dec409c0338a41ab.tar.gz
stable-diffusion-webui-gfx803-c07dbd4cf9831b1f785c01a6dec409c0338a41ab.tar.bz2
stable-diffusion-webui-gfx803-c07dbd4cf9831b1f785c01a6dec409c0338a41ab.zip
Merge pull request #2939 from Michoko92/dark-mode
Added dark mode switch
Diffstat (limited to 'modules')
-rw-r--r--modules/shared.py2
-rw-r--r--modules/ui.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/shared.py b/modules/shared.py
index 2a2b0427..9603d26e 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -70,13 +70,13 @@ parser.add_argument("--gradio-img2img-tool", type=str, help='gradio image upload
parser.add_argument("--opt-channelslast", action='store_true', help="change memory type for stable diffusion to channels last")
parser.add_argument("--styles-file", type=str, help="filename to use for styles", default=os.path.join(script_path, 'styles.csv'))
parser.add_argument("--autolaunch", action='store_true', help="open the webui URL in the system's default browser upon launch", default=False)
+parser.add_argument("--theme", type=str, help="launches the UI with light or dark theme", default=None)
parser.add_argument("--use-textbox-seed", action='store_true', help="use textbox for seeds in UI (no up/down, but possible to input long seeds)", default=False)
parser.add_argument("--disable-console-progressbars", action='store_true', help="do not output progressbars to console", default=False)
parser.add_argument("--enable-console-prompts", action='store_true', help="print prompts to console when generating with txt2img and img2img", default=False)
parser.add_argument('--vae-path', type=str, help='Path to Variational Autoencoders model', default=None)
parser.add_argument("--disable-safe-unpickle", action='store_true', help="disable checking pytorch models for malicious code", default=False)
-
cmd_opts = parser.parse_args()
restricted_opts = [
"samples_filename_pattern",
diff --git a/modules/ui.py b/modules/ui.py
index 2a7f64f9..1dae4a65 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1796,6 +1796,9 @@ for filename in sorted(os.listdir(jsdir)):
with open(os.path.join(jsdir, filename), "r", encoding="utf8") as jsfile:
javascript += f"\n<script>{jsfile.read()}</script>"
+if cmd_opts.theme is not None:
+ javascript += f"\n<script>set_theme('{cmd_opts.theme}');</script>\n"
+
javascript += f"\n<script>{localization.localization_js(shared.opts.localization)}</script>"
if 'gradio_routes_templates_response' not in globals():