--theme
This commit is contained in:
parent
608fe3962c
commit
ab528b78cf
@ -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. "
|
help="Force loading models to vram when the unload can be avoided. "
|
||||||
"Some Mac users may need this.")
|
"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(
|
fcbh_cli.parser.set_defaults(
|
||||||
disable_cuda_malloc=True,
|
disable_cuda_malloc=True,
|
||||||
auto_launch=True,
|
auto_launch=True,
|
||||||
|
@ -1 +1 @@
|
|||||||
version = '2.1.816'
|
version = '2.1.817'
|
||||||
|
@ -166,3 +166,10 @@ function uiElementInSight(el) {
|
|||||||
function playNotification() {
|
function playNotification() {
|
||||||
gradioApp().querySelector('#audio_notification audio')?.play();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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="{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="{viewer_js_path}"></script>\n'
|
||||||
head += f'<script type="text/javascript" src="{image_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
|
return head
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# 2.1.817
|
||||||
|
|
||||||
|
* support "--theme dark" and "--theme light".
|
||||||
|
|
||||||
# 2.1.815
|
# 2.1.815
|
||||||
|
|
||||||
* Multiple loras in preset.
|
* Multiple loras in preset.
|
||||||
|
Loading…
Reference in New Issue
Block a user