From aee0c33c7b7bf44ef295309b503268e08cc2e43d Mon Sep 17 00:00:00 2001 From: tim h Date: Fri, 30 Dec 2022 23:40:45 -0600 Subject: [PATCH] significantly more useful hrfix updates adds lock-to-max-hrfix-px slider which works pretty well if i do say so myself --- index.html | 5 +++-- js/index.js | 11 +++++++++++ js/ui/tool/dream.js | 12 ++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index ac87e61..9d4596b 100644 --- a/index.html +++ b/index.html @@ -100,6 +100,7 @@
+
- + - + diff --git a/js/index.js b/js/index.js index b3403a4..a9ee850 100644 --- a/js/index.js +++ b/js/index.js @@ -612,6 +612,17 @@ makeSlider( makeSlider("Steps", document.getElementById("steps"), "steps", 1, 70, 5, 30, 1); +makeSlider( + "HR Fix Lock Px.", + document.getElementById("hrFixLock"), + "hr_fix_lock_px", + 0.0, + 768.0, + 256.0, + 0.0, + 1.0 +); + function changeMaskBlur() { stableDiffusionData.mask_blur = parseInt( document.getElementById("maskBlur").value diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 0a7b9a5..5ae2ef3 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -1347,8 +1347,16 @@ const dreamTool = () => }; //hacky set non-square auto hrfix values - stableDiffusionData.firstphase_height = resolution.h / 2; - stableDiffusionData.firstphase_width = resolution.w / 2; + let hrLockPx = + localStorage.getItem("openoutpaint/hr_fix_lock_px") ?? 0; + stableDiffusionData.firstphase_height = + hrLockPx == 0 || resolution.h / 2 <= hrLockPx + ? resolution.h / 2 + : hrLockPx; + stableDiffusionData.firstphase_width = + hrLockPx == 0 || resolution.w / 2 <= hrLockPx + ? resolution.w / 2 + : hrLockPx; if (global.connection === "online") { dream_generate_callback(bb, resolution, state);