"emergency" fix to just get upscalers working again
temporary as hell hardcoded list of "should be available to everyone from a fresh install" upscalers, subject to change upon bug reports
This commit is contained in:
parent
cb36c2b599
commit
85776d8637
2 changed files with 43 additions and 31 deletions
|
@ -209,7 +209,7 @@
|
|||
<br />
|
||||
<span id="version">
|
||||
<a href="https://github.com/zero01101/openOutpaint" target="_blank">
|
||||
Alpha release v0.0.13
|
||||
Alpha release v0.0.13.1
|
||||
</a>
|
||||
<br />
|
||||
<a
|
||||
|
@ -367,7 +367,7 @@
|
|||
|
||||
<!-- Content -->
|
||||
<script src="js/prompt.js?v=7a1c68c" type="text/javascript"></script>
|
||||
<script src="js/index.js?v=c4a7bed" type="text/javascript"></script>
|
||||
<script src="js/index.js?v=4c9e978" type="text/javascript"></script>
|
||||
|
||||
<script
|
||||
src="js/ui/floating/history.js?v=fc92d14"
|
||||
|
|
70
js/index.js
70
js/index.js
|
@ -881,38 +881,48 @@ async function getUpscalers() {
|
|||
*/
|
||||
|
||||
// hacky way to get the correct list of upscalers
|
||||
var extras_url =
|
||||
document.getElementById("host").value + "/sdapi/v1/extra-single-image/"; // endpoint for upscaling, needed for the hacky way to get the correct list of upscalers
|
||||
var empty_image = document.createElement("canvas");
|
||||
empty_image.width = 1;
|
||||
empty_image.height = 1;
|
||||
var purposefully_incorrect_data = {
|
||||
resize_mode: 0, // 0 = just resize, 1 = crop and resize, 2 = resize and fill i assume based on theimg2img tabs options
|
||||
upscaling_resize: 2,
|
||||
upscaler_1: "fake_upscaler",
|
||||
image: empty_image.toDataURL(),
|
||||
};
|
||||
// var extras_url =
|
||||
// document.getElementById("host").value + "/sdapi/v1/extra-single-image/"; // endpoint for upscaling, needed for the hacky way to get the correct list of upscalers
|
||||
// var purposefully_incorrect_data = {
|
||||
// resize_mode: 0, // 0 = just resize, 1 = crop and resize, 2 = resize and fill i assume based on theimg2img tabs options
|
||||
// upscaling_resize: 2,
|
||||
// upscaler_1: "fake_upscaler",
|
||||
// image: empty_image.toDataURL(),
|
||||
// };
|
||||
|
||||
upscalers = [
|
||||
"Lanczos",
|
||||
"Nearest",
|
||||
"LDSR",
|
||||
"SwinIR",
|
||||
"R-ESRGAN General 4xV3",
|
||||
"R-ESRGAN General WDN 4xV3",
|
||||
"R-ESRGAN AnimeVideo",
|
||||
"R-ESRGAN 4x+",
|
||||
"R-ESRGAN 4x+ Anime6B",
|
||||
"R-ESRGAN 2x+",
|
||||
];
|
||||
|
||||
try {
|
||||
const response = await fetch(extras_url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(purposefully_incorrect_data),
|
||||
});
|
||||
const data = await response.json();
|
||||
// const response = await fetch(extras_url, {
|
||||
// method: "POST",
|
||||
// headers: {
|
||||
// Accept: "application/json",
|
||||
// "Content-Type": "application/json",
|
||||
// },
|
||||
// body: JSON.stringify(purposefully_incorrect_data),
|
||||
// });
|
||||
// const data = await response.json();
|
||||
|
||||
console.log(
|
||||
"[index] purposefully_incorrect_data response, ignore above error"
|
||||
);
|
||||
// result = purposefully_incorrect_data response: Invalid upscaler, needs to be on of these: None , Lanczos , Nearest , LDSR , BSRGAN , R-ESRGAN General 4xV3 , R-ESRGAN 4x+ Anime6B , ScuNET , ScuNET PSNR , SwinIR_4x
|
||||
const upscalersPlusNone = data.detail
|
||||
.split(": ")[1]
|
||||
.split(",")
|
||||
.map((v) => v.trim()); // need "None" for stupid hrfix changes razza frazza
|
||||
const upscalers = upscalersPlusNone.filter((v) => v !== "None"); // converting the result to a list of upscalers
|
||||
// console.log(
|
||||
// "[index] purposefully_incorrect_data response, ignore above error"
|
||||
// );
|
||||
// // result = purposefully_incorrect_data response: Invalid upscaler, needs to be on of these: None , Lanczos , Nearest , LDSR , BSRGAN , R-ESRGAN General 4xV3 , R-ESRGAN 4x+ Anime6B , ScuNET , ScuNET PSNR , SwinIR_4x
|
||||
// const upscalersPlusNone = data.detail
|
||||
// .split(": ")[1]
|
||||
// .split(",")
|
||||
// .map((v) => v.trim()); // need "None" for stupid hrfix changes razza frazza
|
||||
// const upscalers = upscalersPlusNone.filter((v) => v !== "None"); // converting the result to a list of upscalers
|
||||
// upscalersPlusNone.push([
|
||||
// "Latent",
|
||||
// "Latent (antialiased)",
|
||||
|
@ -920,6 +930,8 @@ async function getUpscalers() {
|
|||
// "Latent (bicubic, antialiased)",
|
||||
// "Latent (nearest)",
|
||||
// ]);
|
||||
const upscalersPlusNone = [...upscalers];
|
||||
upscalersPlusNone.unshift("None"); //this is absurd
|
||||
upscalersPlusNone.push("Latent");
|
||||
upscalersPlusNone.push("Latent (antialiased)");
|
||||
upscalersPlusNone.push("Latent (bicubic)");
|
||||
|
|
Loading…
Reference in a new issue