aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichoko <michoko@hotmail.com>2022-10-17 09:05:05 +0000
committerMichoko <michoko@hotmail.com>2022-10-17 09:05:05 +0000
commit8c6a981d5d9ef30381ac2327460285111550acbc (patch)
treed32072df61e6b336dc4d8f771668df0194809b0d /modules
parentcccc5a20fce4bde9a4299f8790366790735f1d05 (diff)
downloadstable-diffusion-webui-gfx803-8c6a981d5d9ef30381ac2327460285111550acbc.tar.gz
stable-diffusion-webui-gfx803-8c6a981d5d9ef30381ac2327460285111550acbc.tar.bz2
stable-diffusion-webui-gfx803-8c6a981d5d9ef30381ac2327460285111550acbc.zip
Added dark mode switch
Launch the UI in dark mode with the --dark-mode switch
Diffstat (limited to 'modules')
-rw-r--r--modules/shared.py2
-rw-r--r--modules/ui.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/shared.py b/modules/shared.py
index c2775603..cbf158e4 100644
--- a/modules/shared.py
+++ b/modules/shared.py
@@ -69,13 +69,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("--dark-mode", action='store_true', help="launches the UI in dark mode", default=False)
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 43dc88fc..a0cd052e 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -1783,6 +1783,8 @@ 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.dark_mode:
+ javascript += "\n<script>go_dark_mode();</script>\n"
if 'gradio_routes_templates_response' not in globals():
def template_response(*args, **kwargs):