diff --git a/css/index.css b/css/index.css
index 80fa23d..0585f43 100644
--- a/css/index.css
+++ b/css/index.css
@@ -644,3 +644,9 @@ select > .style-select-option:active {
.button.tool.active {
background-color: rgb(60, 60, 130);
}
+
+/* Miscellaneous garbage */
+
+.thirdwidth {
+ max-width: 33%;
+}
diff --git a/index.html b/index.html
index ce50bf7..1315cc4 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
-
+
@@ -100,8 +100,31 @@
+
+
+
+
+
+
+
@@ -323,7 +346,7 @@
-
+
@@ -341,7 +364,7 @@
-
+
-
+
diff --git a/js/index.js b/js/index.js
index 1424164..8b2ea19 100644
--- a/js/index.js
+++ b/js/index.js
@@ -111,6 +111,9 @@ var stableDiffusionData = {
//firstphase_height: 0, //20230102 welp looks like the entire way HRfix is implemented has become bonkersly different
hr_scale: 2.0,
hr_upscaler: "None",
+ hr_second_pass_steps: 0,
+ hr_resize_x: 0,
+ hr_resize_y: 0,
styles: [],
// here's some more fields that might be useful
@@ -679,6 +682,17 @@ const lockPxSlider = makeSlider(
1
);
+const hrStepsSlider = makeSlider(
+ "HRfix Steps",
+ document.getElementById("hrFixSteps"),
+ "hr_second_pass_steps",
+ 0,
+ localStorage.getItem("openoutpaint/settings.max-steps") || 70,
+ 5,
+ 30,
+ 1
+);
+
function changeMaskBlur() {
stableDiffusionData.mask_blur = parseInt(
document.getElementById("maskBlur").value
@@ -691,29 +705,45 @@ function changeSeed() {
localStorage.setItem("openoutpaint/seed", stableDiffusionData.seed);
}
+function changeHRFX() {
+ stableDiffusionData.hr_resize_x =
+ document.getElementById("hr_resize_x").value;
+}
+
+function changeHRFY() {
+ stableDiffusionData.hr_resize_y =
+ document.getElementById("hr_resize_y").value;
+}
+
function changeHiResFix() {
stableDiffusionData.enable_hr = Boolean(
document.getElementById("cbxHRFix").checked
);
localStorage.setItem("openoutpaint/enable_hr", stableDiffusionData.enable_hr);
- var hrfSlider = document.getElementById("hrFixScale");
- var hrfOpotions = document.getElementById("hrFixUpscaler");
- var hrfLabel = document.getElementById("hrFixLabel");
- var hrfDenoiseSlider = document.getElementById("hrDenoising");
- var hrfLockPxSlider = document.getElementById("hrFixLockPx");
+ // var hrfSlider = document.getElementById("hrFixScale");
+ // var hrfOpotions = document.getElementById("hrFixUpscaler");
+ // var hrfLabel = document.getElementById("hrFixLabel");
+ // var hrfDenoiseSlider = document.getElementById("hrDenoising");
+ // var hrfLockPxSlider = document.getElementById("hrFixLockPx");
if (stableDiffusionData.enable_hr) {
- hrfSlider.classList.remove("invisible");
- hrfOpotions.classList.remove("invisible");
- hrfLabel.classList.remove("invisible");
- hrfDenoiseSlider.classList.remove("invisible");
- hrfLockPxSlider.classList.remove("invisible");
+ document
+ .querySelectorAll(".hrfix")
+ .forEach((el) => el.classList.remove("invisible"));
+ // hrfSlider.classList.remove("invisible");
+ // hrfOpotions.classList.remove("invisible");
+ // hrfLabel.classList.remove("invisible");
+ // hrfDenoiseSlider.classList.remove("invisible");
+ // hrfLockPxSlider.classList.remove("invisible");
//state.ctxmenu.keepUnmaskedBlurSliderLinebreak.classList.add("invisible");
} else {
- hrfSlider.classList.add("invisible");
- hrfOpotions.classList.add("invisible");
- hrfLabel.classList.add("invisible");
- hrfDenoiseSlider.classList.add("invisible");
- hrfLockPxSlider.classList.add("invisible");
+ document
+ .querySelectorAll(".hrfix")
+ .forEach((el) => el.classList.add("invisible"));
+ // hrfSlider.classList.add("invisible");
+ // hrfOpotions.classList.add("invisible");
+ // hrfLabel.classList.add("invisible");
+ // hrfDenoiseSlider.classList.add("invisible");
+ // hrfLockPxSlider.classList.add("invisible");
//state.ctxmenu.keepUnmaskedBlurSliderLinebreak.classList.remove("invisible");
}
}
diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js
index 77207c5..2d5cc58 100644
--- a/js/ui/tool/dream.js
+++ b/js/ui/tool/dream.js
@@ -844,8 +844,16 @@ const dream_generate_callback = async (bb, resolution, state) => {
var newWidth = Math.floor(request.width / request.hr_scale);
var newHeight = Math.floor(request.height / request.hr_scale);
- request.width = newWidth;
- request.height = newHeight;
+ request.hr_resize_x = stableDiffusionData.hr_resize_x;
+ request.hr_resize_y = stableDiffusionData.hr_resize_y;
+ request.width =
+ stableDiffusionData.hr_resize_x || stableDiffusionData.hr_resize_y > 0
+ ? request.width
+ : newWidth;
+ request.height =
+ stableDiffusionData.hr_resize_x || stableDiffusionData.hr_resize_y > 0
+ ? request.height
+ : newHeight; //in webUI if _either_ x or y is > 0 then their values are used over scale as per https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/81490780949fffed77493b4bd741e96ec737fe27#diff-ddc07d50fa3b043925b1e831b1373976798d62c9f5c11fcb16c6c830bd3857cdR104
}
// For compatibility with the old HRFix API
diff --git a/pages/configuration.html b/pages/configuration.html
index 5e53994..d8f0935 100644
--- a/pages/configuration.html
+++ b/pages/configuration.html
@@ -7,7 +7,7 @@
-
+