From be14a3f96f81f13a14783c289debf9bc19abddeb Mon Sep 17 00:00:00 2001 From: Feenix <25067102+NayamAmarshe@users.noreply.github.com> Date: Sun, 12 Mar 2023 15:27:42 +0530 Subject: [PATCH] Added batch upscale format warning --- main/index.js | 60 +++++++++++----------- renderer/components/LeftPaneImageSteps.tsx | 16 ++++++ 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/main/index.js b/main/index.js index 968ab4d..c36e0a9 100644 --- a/main/index.js +++ b/main/index.js @@ -265,39 +265,41 @@ electron_1.ipcMain.on(commands_1.default.UPSCAYL, (event, payload) => __awaiter( } else { let upscayl; + const defaultArguments = [ + "-i", + inputDir + "/" + fullfileName, + "-o", + outFile, + "-s", + scale === 2 ? 4 : scale, + "-m", + binaries_1.modelsPath, + "-n", + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; + const sharpenArguments = [ + "-i", + inputDir + "/" + fullfileName, + "-o", + outFile, + "-s", + scale, + "-x", + "-m", + binaries_1.modelsPath + "/" + model, + gpuId ? `-g ${gpuId}` : "", + "-f", + saveImageAs, + ]; switch (model) { default: - upscayl = (0, upscayl_1.spawnUpscayl)([ - "-i", - inputDir + "/" + fullfileName, - "-o", - outFile, - "-s", - scale === 2 ? 4 : scale, - "-m", - binaries_1.modelsPath, - "-n", - model, - gpuId ? `-g ${gpuId}` : "", - "-f", - saveImageAs, - ], "realesrgan"); + upscayl = (0, upscayl_1.spawnUpscayl)(defaultArguments, "realesrgan"); break; case "models-DF2K": - upscayl = (0, upscayl_1.spawnUpscayl)([ - "-i", - inputDir + "/" + fullfileName, - "-o", - outFile, - "-s", - scale, - "-x", - "-m", - binaries_1.modelsPath + "/" + model, - gpuId ? `-g ${gpuId}` : "", - "-f", - saveImageAs, - ], "realsr"); + upscayl = (0, upscayl_1.spawnUpscayl)(sharpenArguments, "realsr"); break; } let isAlpha = false; diff --git a/renderer/components/LeftPaneImageSteps.tsx b/renderer/components/LeftPaneImageSteps.tsx index 57c8dbe..768b19b 100644 --- a/renderer/components/LeftPaneImageSteps.tsx +++ b/renderer/components/LeftPaneImageSteps.tsx @@ -281,15 +281,26 @@ function LeftPaneImageSteps({ disabled={progress.length > 0}> {progress.length > 0 ? "Upscayling⏳" : "Upscayl"} + + {/* ADVANCED OPTIONS */}