localstorage for new hrfix junk

This commit is contained in:
tim h 2023-01-02 18:13:46 -06:00
parent 5523ee71ec
commit 3043622ecd
2 changed files with 20 additions and 2 deletions

View file

@ -340,7 +340,7 @@
<!-- Content --> <!-- Content -->
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script> <script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
<script src="js/index.js?v=9056c91" type="text/javascript"></script> <script src="js/index.js?v=134f3eb" type="text/javascript"></script>
<script <script
src="js/ui/floating/history.js?v=fc92d14" src="js/ui/floating/history.js?v=fc92d14"

View file

@ -560,6 +560,7 @@ const hrFixUpscalerAutoComplete = createAutoComplete(
); );
hrFixUpscalerAutoComplete.onchange.on(({value}) => { hrFixUpscalerAutoComplete.onchange.on(({value}) => {
stableDiffusionData.hr_upscaler = value; stableDiffusionData.hr_upscaler = value;
localStorage.setItem(`openoutpaint/hr_upscaler`, value);
}); });
const resSlider = makeSlider( const resSlider = makeSlider(
@ -647,7 +648,7 @@ makeSlider(
"denoising_strength", "denoising_strength",
0.0, 0.0,
1.0, 1.0,
0.1, 0.05,
0.7, 0.7,
0.01 0.01
); );
@ -1103,6 +1104,20 @@ function loadSettings() {
? true ? true
: localStorage.getItem("openoutpaint/sync_cursor_size") === "true"; : localStorage.getItem("openoutpaint/sync_cursor_size") === "true";
let _hrfix_scale =
localStorage.getItem("openoutpaint/hr_scale") === null
? 2.0
: localStorage.getItem("openoutpaint/hr_scale");
let _hrfix_upscaler =
localStorage.getItem("openoutpaint/hr_upscaler") === null
? "None"
: localStorage.getItem("openoutpaint/hr_upscaler");
let _hrfix_denoising =
localStorage.getItem("openoutpaint/denoising_strength") === null
? 0.7
: localStorage.getItem("openoutpaint/denoising_strength");
// set the values into the UI // set the values into the UI
document.getElementById("maskBlur").value = Number(_mask_blur); document.getElementById("maskBlur").value = Number(_mask_blur);
document.getElementById("seed").value = Number(_seed); document.getElementById("seed").value = Number(_seed);
@ -1110,6 +1125,9 @@ function loadSettings() {
document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces); document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces);
document.getElementById("cbxSyncCursorSize").checked = document.getElementById("cbxSyncCursorSize").checked =
Boolean(_sync_cursor_size); Boolean(_sync_cursor_size);
document.getElementById("hrFixScale").value = Number(_hrfix_scale);
document.getElementById("hrFixUpscaler").value = Number(_hrfix_upscaler);
document.getElementById("hrDenoising").value = Number(_hrfix_denoising);
} }
imageCollection.element.addEventListener( imageCollection.element.addEventListener(