diff --git a/index.html b/index.html index 976b608..789bf7c 100644 --- a/index.html +++ b/index.html @@ -313,7 +313,7 @@
+ src="pages/configuration.html?v=3d710ce"> @@ -353,7 +353,7 @@ src="js/ui/tool/generic.js?v=2bcd36d" type="text/javascript"> - + diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index 3a3bd53..53428a1 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -130,6 +130,22 @@ const _dream = async (endpoint, request) => { let data = null; try { generating = true; + if ( + endpoint == "txt2img" && + request.enable_hr && + localStorage.getItem("openoutpaint/settings.hrfix-liar") == "true" + ) { + /** + * try and make the new HRfix method useful for our purposes + * since it now returns an image that's been upscaled x the hr_scale parameter, + * we cheekily lie to SD and tell it that the original dimensions are _divided_ + * by the scale factor so it returns something about the same size as we wanted initially + */ + var newWidth = Math.floor(request.width / request.hr_scale); + var newHeight = Math.floor(request.height / request.hr_scale); + request.width = newWidth; + request.height = newHeight; + } const response = await fetch(apiURL, { method: "POST", headers: { diff --git a/pages/configuration.html b/pages/configuration.html index 2adff2a..81409ec 100644 --- a/pages/configuration.html +++ b/pages/configuration.html @@ -84,6 +84,10 @@ step="0.1" value="30.0" /> +Refresh the page to apply settings.