mirror of
https://github.com/upscayl/upscayl.git
synced 2024-11-12 01:40:53 +01:00
Fix [DOUBLE UPSCAYL] Wrong scale size being used #841
This commit is contained in:
parent
d75bd9ac8f
commit
4b3c0e209f
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user