This commit is contained in:
lllyasviel 2023-11-15 08:22:24 -08:00
parent 608fe3962c
commit ab528b78cf
5 changed files with 18 additions and 1 deletions

View File

@ -15,6 +15,8 @@ fcbh_cli.parser.add_argument("--enable-smart-memory", action="store_true",
help="Force loading models to vram when the unload can be avoided. "
"Some Mac users may need this.")
fcbh_cli.parser.add_argument("--theme", type=str, help="launches the UI with light or dark theme", default=None)
fcbh_cli.parser.set_defaults(
disable_cuda_malloc=True,
auto_launch=True,

View File

@ -1 +1 @@
version = '2.1.816'
version = '2.1.817'

View File

@ -166,3 +166,10 @@ function uiElementInSight(el) {
function playNotification() {
gradioApp().querySelector('#audio_notification audio')?.play();
}
function set_theme(theme) {
var gradioURL = window.location.href;
if (!gradioURL.includes('?__theme=')) {
window.location.replace(gradioURL + '?__theme=' + theme);
}
}

View File

@ -38,6 +38,10 @@ def javascript_html():
head += f'<script type="text/javascript" src="{edit_attention_js_path}"></script>\n'
head += f'<script type="text/javascript" src="{viewer_js_path}"></script>\n'
head += f'<script type="text/javascript" src="{image_viewer_js_path}"></script>\n'
if args_manager.args.theme:
head += f'<script type="text/javascript">set_theme(\"{args_manager.args.theme}\");</script>\n'
return head

View File

@ -1,3 +1,7 @@
# 2.1.817
* support "--theme dark" and "--theme light".
# 2.1.815
* Multiple loras in preset.