1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-23 23:21:05 +01:00

Fix upscale above 32k

This commit is contained in:
Feenix 2023-06-03 06:19:13 +05:30
parent 0a62f8a5df
commit e729a2bea7
2 changed files with 27 additions and 2 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "upscayl",
"version": "2.5.0",
"version": "2.5.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "upscayl",
"version": "2.5.0",
"version": "2.5.1",
"license": "AGPL-3.0",
"dependencies": {
"app-root-dir": "^1.0.2",

View File

@ -104,6 +104,31 @@ function LeftPaneImageSteps({
logit("🔀 Setting model to", currentModel.value);
}, [currentModel]);
const getUpscaleResolution = () => {
const newDimensions = {
width: dimensions.width,
height: dimensions.height,
};
if (doubleUpscayl) {
newDimensions.width = dimensions.width * 16;
newDimensions.height = dimensions.height * 16;
} else {
newDimensions.width = dimensions.width * 4;
newDimensions.height = dimensions.height * 4;
}
if (newDimensions.width > 32768) {
logit("🚫 Upscale width is too large, setting to a maximum of 32768px");
newDimensions.width = 32384;
}
if (newDimensions.height > 32768) {
logit("🚫 Upscale height is too large, setting to a maximum of 32768px");
newDimensions.height = 32384;
}
return newDimensions;
};
return (
<div className="animate-step-in animate flex h-screen flex-col gap-7 overflow-y-auto p-5 overflow-x-hidden">
{/* BATCH OPTION */}