forked from extern/easydiffusion
Merge pull request #485 from cmdr2/beta
UI setting for preventing browser autostart
This commit is contained in:
commit
2c861c65d4
@ -19,7 +19,7 @@
|
|||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="top-nav">
|
<div id="top-nav">
|
||||||
<div id="logo">
|
<div id="logo">
|
||||||
<h1>Stable Diffusion UI <small>v2.4.4 <span id="updateBranchLabel"></span></small></h1>
|
<h1>Stable Diffusion UI <small>v2.4.5 <span id="updateBranchLabel"></span></small></h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="server-status">
|
<div id="server-status">
|
||||||
<div id="server-status-color">●</div>
|
<div id="server-status-color">●</div>
|
||||||
@ -327,7 +327,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script src="media/js/parameters.js?v=8"></script>
|
<script src="media/js/parameters.js?v=9"></script>
|
||||||
<script src="media/js/plugins.js?v=1"></script>
|
<script src="media/js/plugins.js?v=1"></script>
|
||||||
<script src="media/js/utils.js?v=6"></script>
|
<script src="media/js/utils.js?v=6"></script>
|
||||||
<script src="media/js/inpainting-editor.js?v=1"></script>
|
<script src="media/js/inpainting-editor.js?v=1"></script>
|
||||||
|
@ -57,6 +57,13 @@ var PARAMETERS = [
|
|||||||
note: "plays a sound on task completion",
|
note: "plays a sound on task completion",
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "ui_open_browser_on_start",
|
||||||
|
type: ParameterType.checkbox,
|
||||||
|
label: "Open browser on startup",
|
||||||
|
note: "starts the default browser on startup",
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "turbo",
|
id: "turbo",
|
||||||
type: ParameterType.checkbox,
|
type: ParameterType.checkbox,
|
||||||
@ -158,6 +165,7 @@ let useFullPrecisionField = document.querySelector('#use_full_precision')
|
|||||||
let saveToDiskField = document.querySelector('#save_to_disk')
|
let saveToDiskField = document.querySelector('#save_to_disk')
|
||||||
let diskPathField = document.querySelector('#diskPath')
|
let diskPathField = document.querySelector('#diskPath')
|
||||||
let useBetaChannelField = document.querySelector("#use_beta_channel")
|
let useBetaChannelField = document.querySelector("#use_beta_channel")
|
||||||
|
let uiOpenBrowserOnStartField = document.querySelector("#ui_open_browser_on_start")
|
||||||
|
|
||||||
let saveSettingsBtn = document.querySelector('#save-system-settings-btn')
|
let saveSettingsBtn = document.querySelector('#save-system-settings-btn')
|
||||||
|
|
||||||
@ -186,6 +194,9 @@ async function getAppConfig() {
|
|||||||
if (config.update_branch === 'beta') {
|
if (config.update_branch === 'beta') {
|
||||||
useBetaChannelField.checked = true
|
useBetaChannelField.checked = true
|
||||||
}
|
}
|
||||||
|
if (config.ui && config.ui.open_browser_on_start === false) {
|
||||||
|
uiOpenBrowserOnStartField.checked = false
|
||||||
|
}
|
||||||
|
|
||||||
console.log('get config status response', config)
|
console.log('get config status response', config)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -313,6 +324,7 @@ saveSettingsBtn.addEventListener('click', function() {
|
|||||||
|
|
||||||
changeAppConfig({
|
changeAppConfig({
|
||||||
'render_devices': getCurrentRenderDeviceSelection(),
|
'render_devices': getCurrentRenderDeviceSelection(),
|
||||||
'update_branch': updateBranch
|
'update_branch': updateBranch,
|
||||||
|
'ui_open_browser_on_start': uiOpenBrowserOnStartField.checked
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
12
ui/server.py
12
ui/server.py
@ -24,6 +24,9 @@ APP_CONFIG_DEFAULTS = {
|
|||||||
# auto: selects the cuda device with the most free memory, cuda: use the currently active cuda device.
|
# auto: selects the cuda device with the most free memory, cuda: use the currently active cuda device.
|
||||||
'render_devices': 'auto', # valid entries: 'auto', 'cpu' or 'cuda:N' (where N is a GPU index)
|
'render_devices': 'auto', # valid entries: 'auto', 'cpu' or 'cuda:N' (where N is a GPU index)
|
||||||
'update_branch': 'main',
|
'update_branch': 'main',
|
||||||
|
'ui': {
|
||||||
|
'open_browser_on_start': True,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
APP_CONFIG_DEFAULT_MODELS = [
|
APP_CONFIG_DEFAULT_MODELS = [
|
||||||
# needed to support the legacy installations
|
# needed to support the legacy installations
|
||||||
@ -156,14 +159,19 @@ class SetAppConfigRequest(BaseModel):
|
|||||||
update_branch: str = None
|
update_branch: str = None
|
||||||
render_devices: Union[List[str], List[int], str, int] = None
|
render_devices: Union[List[str], List[int], str, int] = None
|
||||||
model_vae: str = None
|
model_vae: str = None
|
||||||
|
ui_open_browser_on_start: bool = None
|
||||||
|
|
||||||
@app.post('/app_config')
|
@app.post('/app_config')
|
||||||
async def setAppConfig(req : SetAppConfigRequest):
|
async def setAppConfig(req : SetAppConfigRequest):
|
||||||
config = getConfig()
|
config = getConfig()
|
||||||
if req.update_branch:
|
if req.update_branch is not None:
|
||||||
config['update_branch'] = req.update_branch
|
config['update_branch'] = req.update_branch
|
||||||
if req.render_devices:
|
if req.render_devices is not None:
|
||||||
update_render_devices_in_config(config, req.render_devices)
|
update_render_devices_in_config(config, req.render_devices)
|
||||||
|
if req.ui_open_browser_on_start is not None:
|
||||||
|
if 'ui' not in config:
|
||||||
|
config['ui'] = {}
|
||||||
|
config['ui']['open_browser_on_start'] = req.ui_open_browser_on_start
|
||||||
try:
|
try:
|
||||||
setConfig(config)
|
setConfig(config)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user