Skip to content

Commit

Permalink
upscaler to localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
Hangover3832 committed Jan 13, 2024
1 parent 1538577 commit b63f254
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,11 @@ async function getUpscalers() {
return {name: u, value: u};
});

upscalerAutoComplete.value = upscalers[0];
upscalerAutoComplete.value =
localStorage.getItem("openoutpaint/hr_upscaler") === null
? upscalers[0]
: localStorage.getItem("openoutpaint/upscaler");

hrFixUpscalerAutoComplete.value =
localStorage.getItem("openoutpaint/hr_upscaler") === null
? "None"
Expand Down Expand Up @@ -1440,6 +1444,7 @@ async function upscaleAndDownload(download = false, add_resource = false, aCanva
var upscaler = upscalerAutoComplete.value;
var croppedCanvas = null;
var imgdata = null;
localStorage.setItem("openoutpaint/upscaler", upscaler);

if (aCanvas == null) {
console.log("Upscaling main canvas.");
Expand Down Expand Up @@ -1550,8 +1555,7 @@ function loadSettings() {
document.getElementById("seed").value = Number(_seed);
document.getElementById("cbxHRFix").checked = Boolean(_enable_hr);
document.getElementById("cbxRestoreFaces").checked = Boolean(_restore_faces);
document.getElementById("cbxSyncCursorSize").checked =
Boolean(_sync_cursor_size);
document.getElementById("cbxSyncCursorSize").checked = Boolean(_sync_cursor_size);
document.getElementById("hrFixScale").value = Number(_hrfix_scale);
document.getElementById("hrDenoising").value = Number(_hrfix_denoising);
document.getElementById("hrFixLockPx").value = Number(_hrfix_lock_px);
Expand Down

0 comments on commit b63f254

Please sign in to comment.