more user configurable stuff

This commit is contained in:
tim h 2023-01-02 00:45:03 -06:00
parent b6e5523f82
commit 8ca3782c8f
3 changed files with 55 additions and 5 deletions

View file

@ -309,7 +309,7 @@
<button id="settings-btn-close" class="close"></button>
</div>
<div class="ui separator"></div>
<iframe id="page-overlay" src="pages/configuration.html"></iframe>
<iframe id="page-overlay" src="pages/configuration.html?v=ae8af5d"></iframe>
</div>
</div>
@ -335,7 +335,7 @@
<!-- Content -->
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
<script src="js/index.js?v=15066c2" type="text/javascript"></script>
<script src="js/index.js?v=418388d" type="text/javascript"></script>
<script
src="js/ui/floating/history.js?v=fc92d14"

View file

@ -575,8 +575,8 @@ makeSlider(
"CFG Scale",
document.getElementById("cfgScale"),
"cfg_scale",
-1,
25,
localStorage.getItem("openoutpaint/settings.min-cfg") || -1,
localStorage.getItem("openoutpaint/settings.max-cfg") || 25,
0.5,
7.0,
0.1
@ -610,7 +610,16 @@ makeSlider(
0.1
);
makeSlider("Steps", document.getElementById("steps"), "steps", 1, 70, 5, 30, 1);
makeSlider(
"Steps",
document.getElementById("steps"),
"steps",
1,
localStorage.getItem("openoutpaint/settings.max-steps") || 70,
5,
30,
1
);
makeSlider(
"HRfix Lock Px.",

View file

@ -59,10 +59,39 @@
type="number"
step="1" />
</label>
<label style="display: flex">
Max Steps:
<input
id="max-steps"
class="canvas-size-input"
type="number"
step="1"
value="70" />
</label>
<label style="display: flex">
CFG minmax:
<input
id="min-cfg"
class="canvas-size-input"
type="number"
step="0.1"
value="-1.0" />
::
<input
id="max-cfg"
class="canvas-size-input"
type="number"
step="0.1"
value="30.0" />
</label>
<p>Refresh the page to apply settings.</p>
<script>
const canvasWidth = document.getElementById("canvas-width");
const canvasHeight = document.getElementById("canvas-height");
const maxSteps = document.getElementById("max-steps");
const minCfg = document.getElementById("min-cfg");
const maxCfg = document.getElementById("max-cfg");
function writeToLocalStorage() {
localStorage.setItem(
@ -73,6 +102,9 @@
"openoutpaint/settings.canvas-height",
canvasHeight.value
);
localStorage.setItem("openoutpaint/settings.max-steps", maxSteps.value);
localStorage.setItem("openoutpaint/settings.min-cfg", minCfg.value);
localStorage.setItem("openoutpaint/settings.max-cfg", maxCfg.value);
}
// Loads values from local storage
@ -80,11 +112,20 @@
localStorage.getItem("openoutpaint/settings.canvas-width") || 2048;
canvasHeight.value =
localStorage.getItem("openoutpaint/settings.canvas-height") || 2048;
maxSteps.value =
localStorage.getItem("openoutpaint/settings.max-steps") || 70;
minCfg.value =
localStorage.getItem("openoutpaint/settings.min-cfg") || -1;
maxCfg.value =
localStorage.getItem("openoutpaint/settings.max-cfg") || 30;
writeToLocalStorage();
canvasWidth.onchange = writeToLocalStorage;
canvasHeight.onchange = writeToLocalStorage;
maxSteps.onchange = writeToLocalStorage;
minCfg.onchange = writeToLocalStorage;
maxCfg.onchange = writeToLocalStorage;
</script>
</body>
</html>