1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-09-23 19:08:25 +02:00

Fix [DOUBLE UPSCAYL] Wrong scale size being used #841

This commit is contained in:
Nayam Amarshe 2024-05-29 23:18:13 +05:30
parent d75bd9ac8f
commit 4b3c0e209f
2 changed files with 14 additions and 3 deletions

View File

@ -29,7 +29,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
const tileSize = payload.tileSize;
const compression = payload.compression;
const scale = parseInt(payload.scale) ** 2;
const scale = payload.scale;
const useCustomWidth = payload.useCustomWidth;
const customWidth = useCustomWidth ? payload.customWidth : "";
const model = payload.model;
@ -65,6 +65,8 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
? modelsPath
: savedCustomModelsPath ?? modelsPath,
model,
scale,
customWidth,
gpuId,
saveImageAs,
tileSize,
@ -171,7 +173,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
model,
gpuId,
saveImageAs,
scale: scale.toString(),
scale,
customWidth,
compression,
tileSize,

View File

@ -69,20 +69,26 @@ export const getDoubleUpscaleArguments = ({
fullfileName,
outFile,
modelsPath,
scale,
model,
gpuId,
saveImageAs,
customWidth,
tileSize,
}: {
inputDir: string;
fullfileName: string;
outFile: string;
modelsPath: string;
scale: string;
model: string;
gpuId: string;
saveImageAs: ImageFormat;
customWidth: string;
tileSize: number;
}) => {
const modelScale = getModelScale(model);
let includeScale = modelScale !== scale && !customWidth;
return [
// INPUT IMAGE
"-i",
@ -90,6 +96,9 @@ export const getDoubleUpscaleArguments = ({
// OUTPUT IMAGE
"-o",
outFile,
// OUTPUT SCALE
includeScale ? "-s" : "",
includeScale ? scale : "",
// MODELS PATH
"-m",
modelsPath,
@ -129,7 +138,7 @@ export const getDoubleUpscaleSecondPassArguments = ({
compression: string;
tileSize: number;
}) => {
const modelScale = (parseInt(getModelScale(model)) ** 2).toString();
const modelScale = getModelScale(model);
let includeScale = modelScale !== scale && !customWidth;
return [
// INPUT IMAGE