mirror of
https://github.com/upscayl/upscayl.git
synced 2025-01-31 04:03:51 +01:00
Added batch upscale format warning
This commit is contained in:
parent
2888887fa8
commit
be14a3f96f
@ -265,39 +265,41 @@ electron_1.ipcMain.on(commands_1.default.UPSCAYL, (event, payload) => __awaiter(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let upscayl;
|
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) {
|
switch (model) {
|
||||||
default:
|
default:
|
||||||
upscayl = (0, upscayl_1.spawnUpscayl)([
|
upscayl = (0, upscayl_1.spawnUpscayl)(defaultArguments, "realesrgan");
|
||||||
"-i",
|
|
||||||
inputDir + "/" + fullfileName,
|
|
||||||
"-o",
|
|
||||||
outFile,
|
|
||||||
"-s",
|
|
||||||
scale === 2 ? 4 : scale,
|
|
||||||
"-m",
|
|
||||||
binaries_1.modelsPath,
|
|
||||||
"-n",
|
|
||||||
model,
|
|
||||||
gpuId ? `-g ${gpuId}` : "",
|
|
||||||
"-f",
|
|
||||||
saveImageAs,
|
|
||||||
], "realesrgan");
|
|
||||||
break;
|
break;
|
||||||
case "models-DF2K":
|
case "models-DF2K":
|
||||||
upscayl = (0, upscayl_1.spawnUpscayl)([
|
upscayl = (0, upscayl_1.spawnUpscayl)(sharpenArguments, "realsr");
|
||||||
"-i",
|
|
||||||
inputDir + "/" + fullfileName,
|
|
||||||
"-o",
|
|
||||||
outFile,
|
|
||||||
"-s",
|
|
||||||
scale,
|
|
||||||
"-x",
|
|
||||||
"-m",
|
|
||||||
binaries_1.modelsPath + "/" + model,
|
|
||||||
gpuId ? `-g ${gpuId}` : "",
|
|
||||||
"-f",
|
|
||||||
saveImageAs,
|
|
||||||
], "realsr");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let isAlpha = false;
|
let isAlpha = false;
|
||||||
|
@ -281,15 +281,26 @@ function LeftPaneImageSteps({
|
|||||||
disabled={progress.length > 0}>
|
disabled={progress.length > 0}>
|
||||||
{progress.length > 0 ? "Upscayling⏳" : "Upscayl"}
|
{progress.length > 0 ? "Upscayling⏳" : "Upscayl"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
{/* ADVANCED OPTIONS */}
|
||||||
<div className="rounded-btn collapse mt-5">
|
<div className="rounded-btn collapse mt-5">
|
||||||
<input type="checkbox" className="peer" />
|
<input type="checkbox" className="peer" />
|
||||||
|
{/* HEADER */}
|
||||||
<div className="collapse-title bg-neutral text-neutral-content peer-checked:bg-primary peer-checked:text-primary-content">
|
<div className="collapse-title bg-neutral text-neutral-content peer-checked:bg-primary peer-checked:text-primary-content">
|
||||||
Advanced Options
|
Advanced Options
|
||||||
</div>
|
</div>
|
||||||
|
{/* CONTENT */}
|
||||||
<div className="collapse-content flex flex-col gap-4 bg-neutral text-neutral-content peer-checked:bg-base-300 peer-checked:py-4 peer-checked:text-base-content">
|
<div className="collapse-content flex flex-col gap-4 bg-neutral text-neutral-content peer-checked:bg-base-300 peer-checked:py-4 peer-checked:text-base-content">
|
||||||
|
{/* IMAGE FORMAT BUTTONS */}
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<p>Save Image As:</p>
|
<p>Save Image As:</p>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap gap-2">
|
||||||
|
{batchMode && (
|
||||||
|
<p className="text-sm text-base-content/70">
|
||||||
|
Only PNG is supported in Batch Upscale
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{/* PNG */}
|
||||||
<button
|
<button
|
||||||
className={`btn-primary btn ${
|
className={`btn-primary btn ${
|
||||||
saveImageAs === "png" && "btn-accent"
|
saveImageAs === "png" && "btn-accent"
|
||||||
@ -297,6 +308,7 @@ function LeftPaneImageSteps({
|
|||||||
onClick={() => setExportType("png")}>
|
onClick={() => setExportType("png")}>
|
||||||
PNG
|
PNG
|
||||||
</button>
|
</button>
|
||||||
|
{/* JPG */}
|
||||||
<button
|
<button
|
||||||
className={`btn-primary btn ${
|
className={`btn-primary btn ${
|
||||||
saveImageAs === "jpg" && "btn-accent"
|
saveImageAs === "jpg" && "btn-accent"
|
||||||
@ -304,6 +316,7 @@ function LeftPaneImageSteps({
|
|||||||
onClick={() => setExportType("jpg")}>
|
onClick={() => setExportType("jpg")}>
|
||||||
JPG
|
JPG
|
||||||
</button>
|
</button>
|
||||||
|
{/* WEBP */}
|
||||||
<button
|
<button
|
||||||
className={`btn-primary btn ${
|
className={`btn-primary btn ${
|
||||||
saveImageAs === "webp" && "btn-accent"
|
saveImageAs === "webp" && "btn-accent"
|
||||||
@ -313,6 +326,7 @@ function LeftPaneImageSteps({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/* THEME SELECTOR */}
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<p>Upscayl Theme:</p>
|
<p>Upscayl Theme:</p>
|
||||||
<select data-choose-theme className="select-primary select">
|
<select data-choose-theme className="select-primary select">
|
||||||
@ -326,6 +340,7 @@ function LeftPaneImageSteps({
|
|||||||
})}
|
})}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
{/* GPU ID INPUT */}
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<p>GPU ID:</p>
|
<p>GPU ID:</p>
|
||||||
<input
|
<input
|
||||||
@ -336,6 +351,7 @@ function LeftPaneImageSteps({
|
|||||||
onChange={handleGpuIdChange}
|
onChange={handleGpuIdChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{/* DONATE BUTTON */}
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<p>If you like what we do :)</p>
|
<p>If you like what we do :)</p>
|
||||||
<a
|
<a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user