1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-24 15:40:21 +01:00
upscayl/electron/utils/getArguments.ts
2023-03-18 17:45:48 +05:30

153 lines
2.4 KiB
TypeScript

export const getSingleImageArguments = (
inputDir: string,
fullfileName: string,
outFile: string,
modelsPath: string,
model: string,
scale: any,
gpuId: string,
saveImageAs: string
) => {
return [
"-i",
inputDir + "/" + fullfileName,
"-o",
outFile,
"-s",
scale == "2" ? "4" : scale,
"-m",
modelsPath,
"-n",
model,
gpuId ? `-g ${gpuId}` : "",
"-f",
saveImageAs,
];
};
export const getSingleImageSharpenArguments = (
inputDir: string,
fullfileName: string,
outFile: string,
modelsPath: string,
model: string,
scale: any,
gpuId: string,
saveImageAs: string
) => {
return [
"-i",
inputDir + "/" + fullfileName,
"-o",
outFile,
"-s",
scale,
"-x",
"-m",
modelsPath + "/" + model,
gpuId ? `-g ${gpuId}` : "",
"-f",
saveImageAs,
];
};
export const getDoubleUpscaleArguments = (
inputDir: string,
fullfileName: string,
outFile: string,
modelsPath: string,
model: string,
gpuId: string,
saveImageAs: string
) => {
return [
"-i",
inputDir + "/" + fullfileName,
"-o",
outFile,
"-s",
"4",
"-m",
modelsPath,
"-n",
model,
gpuId ? `-g ${gpuId}` : "",
"-f",
saveImageAs,
];
};
export const getDoubleUpscaleSecondPassArguments = (
isAlpha: boolean,
outFile: string,
modelsPath: string,
model: string,
gpuId: string,
saveImageAs: string
) => {
return [
"-i",
isAlpha ? outFile + ".png" : outFile,
"-o",
isAlpha ? outFile + ".png" : outFile,
"-s",
"4",
"-m",
modelsPath,
"-n",
model,
gpuId ? `-g ${gpuId}` : "",
"-f",
isAlpha ? "" : saveImageAs,
];
};
export const getBatchArguments = (
inputDir: string,
outputDir: string,
modelsPath: string,
model: string,
gpuId: string,
saveImageAs: string
) => {
return [
"-i",
inputDir,
"-o",
outputDir,
"-s",
"4",
"-m",
modelsPath,
"-n",
model,
gpuId ? `-g ${gpuId}` : "",
"-f",
saveImageAs,
];
};
export const getBatchSharpenArguments = (
inputDir: string,
outputDir: string,
modelsPath: string,
model: string,
gpuId: string,
saveImageAs: string
) => {
return [
"-i",
inputDir,
"-o",
outputDir,
"-s",
"4",
"-x",
"-m",
modelsPath + "/" + model,
gpuId ? `-g ${gpuId}` : "",
"-f",
saveImageAs,
];
};