1
0
mirror of https://github.com/upscayl/upscayl.git synced 2025-01-31 04:03:51 +01:00
This commit is contained in:
Nayam Amarshe 2023-09-25 09:09:21 +05:30
parent 22df2a1908
commit c3b124cba1
4 changed files with 15 additions and 4 deletions

View File

@ -47,7 +47,7 @@ const batchUpscayl = async (event, payload) => {
scale = "4";
}
outputDir += `_${model}_x${payload.scale}`;
outputDir += slash + `upscayl_${model}_x${payload.scale}`;
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir, { recursive: true });
}

View File

@ -98,9 +98,18 @@ function SettingsTab({
localStorage.setItem("model", JSON.stringify(modelOptions[0]));
logit("🔀 Setting model to", modelOptions[0].value);
} else {
const currentlySavedModel = JSON.parse(
let currentlySavedModel = JSON.parse(
localStorage.getItem("model")
) as (typeof modelOptions)[0];
if (
modelOptions.find(
(model) => model.value === currentlySavedModel.value
) === undefined
) {
localStorage.setItem("model", JSON.stringify(modelOptions[0]));
logit("🔀 Setting model to", modelOptions[0].value);
currentlySavedModel = modelOptions[0];
}
setCurrentModel(currentlySavedModel);
setModel(currentlySavedModel.value);
logit(

View File

@ -10,7 +10,9 @@ function ProgressBar({
const [batchProgress, setBatchProgress] = React.useState(0);
React.useEffect(() => {
if (progress.includes("0.00%")) {
const progressString = progress.replace(/\n/g, "");
console.log({ progressString });
if (progressString.length === 5 && progressString === "0.00%") {
setBatchProgress((prev) => prev + 1);
}
}, [progress]);

View File

@ -293,7 +293,7 @@ const Home = () => {
if (path !== null) {
logit("🖼 Selected Folder Path: ", path);
setBatchFolderPath(path);
setOutputPath(path + "_upscayled");
setOutputPath(path);
} else {
logit("🚫 Folder selection cancelled");
setBatchFolderPath("");