mirror of
https://github.com/upscayl/upscayl.git
synced 2025-01-19 01:24:09 +01:00
Added new model and changed logging emoji
This commit is contained in:
parent
31985b1de6
commit
8a615f58d5
@ -178,7 +178,7 @@ ipcMain.handle(commands.SELECT_FILE, async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (canceled) {
|
if (canceled) {
|
||||||
logit("❌ File Operation Cancelled");
|
logit("🚫 File Operation Cancelled");
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
imagePath = filePaths[0];
|
imagePath = filePaths[0];
|
||||||
@ -213,7 +213,7 @@ ipcMain.handle(commands.SELECT_FILE, async () => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
logit("📢 Selected File Path: ", filePaths[0]);
|
logit("📄 Selected File Path: ", filePaths[0]);
|
||||||
// CREATE input AND upscaled FOLDER
|
// CREATE input AND upscaled FOLDER
|
||||||
return filePaths[0];
|
return filePaths[0];
|
||||||
}
|
}
|
||||||
@ -227,11 +227,11 @@ ipcMain.handle(commands.SELECT_FOLDER, async (event, message) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (canceled) {
|
if (canceled) {
|
||||||
logit("❌ Select Folder Operation Cancelled");
|
logit("🚫 Select Folder Operation Cancelled");
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
folderPath = folderPaths[0];
|
folderPath = folderPaths[0];
|
||||||
logit("📢 Selected Folder Path: ", folderPath);
|
logit("📁 Selected Folder Path: ", folderPath);
|
||||||
return folderPaths[0];
|
return folderPaths[0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -271,7 +271,7 @@ const getModels = (folderPath: string) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
logit("📢 Detected Custom Models: ", models);
|
logit("🔎 Detected Custom Models: ", models);
|
||||||
return models;
|
return models;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ ipcMain.on(commands.GET_MODELS_LIST, async (event, payload) => {
|
|||||||
if (payload) {
|
if (payload) {
|
||||||
customModelsFolderPath = payload;
|
customModelsFolderPath = payload;
|
||||||
|
|
||||||
logit("📢 Custom Models Folder Path: ", customModelsFolderPath);
|
logit("📁 Custom Models Folder Path: ", customModelsFolderPath);
|
||||||
|
|
||||||
mainWindow.webContents.send(
|
mainWindow.webContents.send(
|
||||||
commands.CUSTOM_MODEL_FILES_LIST,
|
commands.CUSTOM_MODEL_FILES_LIST,
|
||||||
@ -296,7 +296,7 @@ ipcMain.handle(commands.SELECT_CUSTOM_MODEL_FOLDER, async (event, message) => {
|
|||||||
defaultPath: customModelsFolderPath,
|
defaultPath: customModelsFolderPath,
|
||||||
});
|
});
|
||||||
if (canceled) {
|
if (canceled) {
|
||||||
logit("❌ Select Custom Models Folder Operation Cancelled");
|
logit("🚫 Select Custom Models Folder Operation Cancelled");
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
customModelsFolderPath = folderPaths[0];
|
customModelsFolderPath = folderPaths[0];
|
||||||
@ -322,14 +322,14 @@ ipcMain.handle(commands.SELECT_CUSTOM_MODEL_FOLDER, async (event, message) => {
|
|||||||
getModels(customModelsFolderPath)
|
getModels(customModelsFolderPath)
|
||||||
);
|
);
|
||||||
|
|
||||||
logit("Custom Folder Path: ", customModelsFolderPath);
|
logit("📁 Custom Folder Path: ", customModelsFolderPath);
|
||||||
return customModelsFolderPath;
|
return customModelsFolderPath;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//------------------------Open Folder-----------------------------//
|
//------------------------Open Folder-----------------------------//
|
||||||
ipcMain.on(commands.OPEN_FOLDER, async (event, payload) => {
|
ipcMain.on(commands.OPEN_FOLDER, async (event, payload) => {
|
||||||
logit("📢 Opening Folder: ", payload);
|
logit("📂 Opening Folder: ", payload);
|
||||||
shell.openPath(payload);
|
shell.openPath(payload);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ ipcMain.on(commands.STOP, async (event, payload) => {
|
|||||||
stopped = true;
|
stopped = true;
|
||||||
|
|
||||||
childProcesses.forEach((child) => {
|
childProcesses.forEach((child) => {
|
||||||
logit("📢 Stopping Upscaling Process", child.process.pid);
|
logit("🛑 Stopping Upscaling Process", child.process.pid);
|
||||||
child.kill();
|
child.kill();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -433,7 +433,7 @@ ipcMain.on(commands.DOUBLE_UPSCAYL, async (event, payload) => {
|
|||||||
|
|
||||||
const onClose2 = (code) => {
|
const onClose2 = (code) => {
|
||||||
if (!failed2 && !stopped) {
|
if (!failed2 && !stopped) {
|
||||||
logit("Done upscaling");
|
logit("💯 Done upscaling");
|
||||||
mainWindow.webContents.send(
|
mainWindow.webContents.send(
|
||||||
commands.DOUBLE_UPSCAYL_DONE,
|
commands.DOUBLE_UPSCAYL_DONE,
|
||||||
isAlpha ? outFile + ".png" : outFile
|
isAlpha ? outFile + ".png" : outFile
|
||||||
@ -504,7 +504,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
|||||||
// UPSCALE
|
// UPSCALE
|
||||||
if (fs.existsSync(outFile)) {
|
if (fs.existsSync(outFile)) {
|
||||||
// If already upscayled, just output that file
|
// If already upscayled, just output that file
|
||||||
logit("📢 Already upscayled at: ", outFile);
|
logit("✅ Already upscayled at: ", outFile);
|
||||||
mainWindow.webContents.send(commands.UPSCAYL_DONE, outFile);
|
mainWindow.webContents.send(commands.UPSCAYL_DONE, outFile);
|
||||||
} else {
|
} else {
|
||||||
const upscayl = spawnUpscayl(
|
const upscayl = spawnUpscayl(
|
||||||
@ -549,7 +549,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
|||||||
};
|
};
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
if (!failed && !stopped) {
|
if (!failed && !stopped) {
|
||||||
logit("Done upscaling");
|
logit("💯 Done upscaling");
|
||||||
mainWindow.setProgressBar(-1);
|
mainWindow.setProgressBar(-1);
|
||||||
mainWindow.webContents.send(
|
mainWindow.webContents.send(
|
||||||
commands.UPSCAYL_DONE,
|
commands.UPSCAYL_DONE,
|
||||||
@ -628,7 +628,7 @@ ipcMain.on(commands.FOLDER_UPSCAYL, async (event, payload) => {
|
|||||||
};
|
};
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
if (!failed && !stopped) {
|
if (!failed && !stopped) {
|
||||||
logit("Done upscaling");
|
logit("💯 Done upscaling");
|
||||||
mainWindow.webContents.send(commands.FOLDER_UPSCAYL_DONE, outputDir);
|
mainWindow.webContents.send(commands.FOLDER_UPSCAYL_DONE, outputDir);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -649,7 +649,7 @@ autoUpdater.on("update-available", ({ releaseNotes, releaseName }) => {
|
|||||||
detail:
|
detail:
|
||||||
"A new version is being downloaded. Please check GitHub for more details.",
|
"A new version is being downloaded. Please check GitHub for more details.",
|
||||||
};
|
};
|
||||||
logit("📢 Update Available", releaseName, releaseNotes);
|
logit("📲 Update Available", releaseName, releaseNotes);
|
||||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {});
|
dialog.showMessageBox(dialogOpts).then((returnValue) => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -662,7 +662,7 @@ autoUpdater.on("update-downloaded", (event) => {
|
|||||||
detail:
|
detail:
|
||||||
"A new version has been downloaded. Restart the application to apply the updates.",
|
"A new version has been downloaded. Restart the application to apply the updates.",
|
||||||
};
|
};
|
||||||
logit("📢 Update Downloaded");
|
logit("✅ Update Downloaded");
|
||||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||||
if (returnValue.response === 0) autoUpdater.quitAndInstall();
|
if (returnValue.response === 0) autoUpdater.quitAndInstall();
|
||||||
});
|
});
|
||||||
|
@ -7,6 +7,10 @@ export type TModelsList = {
|
|||||||
|
|
||||||
export const defaultModelsList = [
|
export const defaultModelsList = [
|
||||||
{ label: "General Photo (Real-ESRGAN)", value: "realesrgan-x4plus" },
|
{ label: "General Photo (Real-ESRGAN)", value: "realesrgan-x4plus" },
|
||||||
|
{
|
||||||
|
label: "General Photo (Fast Real-ESRGAN)",
|
||||||
|
value: "RealESRGAN_General_x4_v3",
|
||||||
|
},
|
||||||
{ label: "General Photo (Remacri)", value: "remacri" },
|
{ label: "General Photo (Remacri)", value: "remacri" },
|
||||||
{ label: "General Photo (Ultramix Balanced)", value: "ultramix_balanced" },
|
{ label: "General Photo (Ultramix Balanced)", value: "ultramix_balanced" },
|
||||||
{ label: "General Photo (Ultrasharp)", value: "ultrasharp" },
|
{ label: "General Photo (Ultrasharp)", value: "ultrasharp" },
|
||||||
|
@ -62,12 +62,12 @@ function LeftPaneImageSteps({
|
|||||||
themeChange(false);
|
themeChange(false);
|
||||||
|
|
||||||
if (!localStorage.getItem("saveImageAs")) {
|
if (!localStorage.getItem("saveImageAs")) {
|
||||||
logit("📢 Setting saveImageAs to png");
|
logit("⚙️ Setting saveImageAs to png");
|
||||||
localStorage.setItem("saveImageAs", "png");
|
localStorage.setItem("saveImageAs", "png");
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedImageFormat = localStorage.getItem("saveImageAs");
|
const currentlySavedImageFormat = localStorage.getItem("saveImageAs");
|
||||||
logit(
|
logit(
|
||||||
"📢 Getting saveImageAs from localStorage",
|
"⚙️ Getting saveImageAs from localStorage",
|
||||||
currentlySavedImageFormat
|
currentlySavedImageFormat
|
||||||
);
|
);
|
||||||
setSaveImageAs(currentlySavedImageFormat);
|
setSaveImageAs(currentlySavedImageFormat);
|
||||||
@ -77,7 +77,7 @@ function LeftPaneImageSteps({
|
|||||||
setCurrentModel(modelOptions[0]);
|
setCurrentModel(modelOptions[0]);
|
||||||
setModel(modelOptions[0].value);
|
setModel(modelOptions[0].value);
|
||||||
localStorage.setItem("model", JSON.stringify(modelOptions[0]));
|
localStorage.setItem("model", JSON.stringify(modelOptions[0]));
|
||||||
logit("📢 Setting model to", modelOptions[0].value);
|
logit("🔀 Setting model to", modelOptions[0].value);
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedModel = JSON.parse(
|
const currentlySavedModel = JSON.parse(
|
||||||
localStorage.getItem("model")
|
localStorage.getItem("model")
|
||||||
@ -85,23 +85,23 @@ function LeftPaneImageSteps({
|
|||||||
setCurrentModel(currentlySavedModel);
|
setCurrentModel(currentlySavedModel);
|
||||||
setModel(currentlySavedModel.value);
|
setModel(currentlySavedModel.value);
|
||||||
logit(
|
logit(
|
||||||
"📢 Getting model from localStorage",
|
"⚙️ Getting model from localStorage",
|
||||||
JSON.stringify(currentlySavedModel)
|
JSON.stringify(currentlySavedModel)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localStorage.getItem("gpuId")) {
|
if (!localStorage.getItem("gpuId")) {
|
||||||
localStorage.setItem("gpuId", "");
|
localStorage.setItem("gpuId", "");
|
||||||
logit("📢 Setting gpuId to empty string");
|
logit("⚙️ Setting gpuId to empty string");
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedGpuId = localStorage.getItem("gpuId");
|
const currentlySavedGpuId = localStorage.getItem("gpuId");
|
||||||
setGpuId(currentlySavedGpuId);
|
setGpuId(currentlySavedGpuId);
|
||||||
logit("📢 Getting gpuId from localStorage", currentlySavedGpuId);
|
logit("⚙️ Getting gpuId from localStorage", currentlySavedGpuId);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
logit("📢 Setting model to", currentModel.value);
|
logit("🔀 Setting model to", currentModel.value);
|
||||||
}, [currentModel]);
|
}, [currentModel]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -46,12 +46,12 @@ function SettingsTab({
|
|||||||
themeChange(false);
|
themeChange(false);
|
||||||
|
|
||||||
if (!localStorage.getItem("saveImageAs")) {
|
if (!localStorage.getItem("saveImageAs")) {
|
||||||
logit("📢 Setting saveImageAs to png");
|
logit("⚙️ Setting saveImageAs to png");
|
||||||
localStorage.setItem("saveImageAs", "png");
|
localStorage.setItem("saveImageAs", "png");
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedImageFormat = localStorage.getItem("saveImageAs");
|
const currentlySavedImageFormat = localStorage.getItem("saveImageAs");
|
||||||
logit(
|
logit(
|
||||||
"📢 Getting saveImageAs from localStorage",
|
"⚙️ Getting saveImageAs from localStorage",
|
||||||
currentlySavedImageFormat
|
currentlySavedImageFormat
|
||||||
);
|
);
|
||||||
setSaveImageAs(currentlySavedImageFormat);
|
setSaveImageAs(currentlySavedImageFormat);
|
||||||
@ -61,7 +61,7 @@ function SettingsTab({
|
|||||||
setCurrentModel(modelOptions[0]);
|
setCurrentModel(modelOptions[0]);
|
||||||
setModel(modelOptions[0].value);
|
setModel(modelOptions[0].value);
|
||||||
localStorage.setItem("model", JSON.stringify(modelOptions[0]));
|
localStorage.setItem("model", JSON.stringify(modelOptions[0]));
|
||||||
logit("📢 Setting model to", modelOptions[0].value);
|
logit("🔀 Setting model to", modelOptions[0].value);
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedModel = JSON.parse(
|
const currentlySavedModel = JSON.parse(
|
||||||
localStorage.getItem("model")
|
localStorage.getItem("model")
|
||||||
@ -69,29 +69,29 @@ function SettingsTab({
|
|||||||
setCurrentModel(currentlySavedModel);
|
setCurrentModel(currentlySavedModel);
|
||||||
setModel(currentlySavedModel.value);
|
setModel(currentlySavedModel.value);
|
||||||
logit(
|
logit(
|
||||||
"📢 Getting model from localStorage",
|
"⚙️ Getting model from localStorage",
|
||||||
JSON.stringify(currentlySavedModel)
|
JSON.stringify(currentlySavedModel)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localStorage.getItem("gpuId")) {
|
if (!localStorage.getItem("gpuId")) {
|
||||||
localStorage.setItem("gpuId", "");
|
localStorage.setItem("gpuId", "");
|
||||||
logit("📢 Setting gpuId to empty string");
|
logit("⚙️ Setting gpuId to empty string");
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedGpuId = localStorage.getItem("gpuId");
|
const currentlySavedGpuId = localStorage.getItem("gpuId");
|
||||||
setGpuId(currentlySavedGpuId);
|
setGpuId(currentlySavedGpuId);
|
||||||
logit("📢 Getting gpuId from localStorage", currentlySavedGpuId);
|
logit("⚙️ Getting gpuId from localStorage", currentlySavedGpuId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localStorage.getItem("rememberOutputFolder")) {
|
if (!localStorage.getItem("rememberOutputFolder")) {
|
||||||
logit("📢 Setting rememberOutputFolder to false");
|
logit("⚙️ Setting rememberOutputFolder to false");
|
||||||
localStorage.setItem("rememberOutputFolder", "false");
|
localStorage.setItem("rememberOutputFolder", "false");
|
||||||
} else {
|
} else {
|
||||||
const currentlySavedRememberOutputFolder = localStorage.getItem(
|
const currentlySavedRememberOutputFolder = localStorage.getItem(
|
||||||
"rememberOutputFolder"
|
"rememberOutputFolder"
|
||||||
);
|
);
|
||||||
logit(
|
logit(
|
||||||
"📢 Getting rememberOutputFolder from localStorage",
|
"⚙️ Getting rememberOutputFolder from localStorage",
|
||||||
currentlySavedRememberOutputFolder
|
currentlySavedRememberOutputFolder
|
||||||
);
|
);
|
||||||
setRememberOutputFolder(
|
setRememberOutputFolder(
|
||||||
|
@ -79,7 +79,7 @@ const Home = () => {
|
|||||||
|
|
||||||
// LOG
|
// LOG
|
||||||
window.electron.on(commands.LOG, (_, data: string) => {
|
window.electron.on(commands.LOG, (_, data: string) => {
|
||||||
logit(`📢 BACKEND REPORTED: `, data);
|
logit(`🐞 BACKEND REPORTED: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// UPSCAYL PROGRESS
|
// UPSCAYL PROGRESS
|
||||||
@ -88,7 +88,7 @@ const Home = () => {
|
|||||||
setProgress(data);
|
setProgress(data);
|
||||||
}
|
}
|
||||||
handleErrors(data);
|
handleErrors(data);
|
||||||
logit(`📢 UPSCAYL_PROGRESS: `, data);
|
logit(`🚧 UPSCAYL_PROGRESS: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// FOLDER UPSCAYL PROGRESS
|
// FOLDER UPSCAYL PROGRESS
|
||||||
@ -97,7 +97,7 @@ const Home = () => {
|
|||||||
setProgress(data);
|
setProgress(data);
|
||||||
}
|
}
|
||||||
handleErrors(data);
|
handleErrors(data);
|
||||||
logit(`📢 FOLDER_UPSCAYL_PROGRESS: `, data);
|
logit(`🚧 FOLDER_UPSCAYL_PROGRESS: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// DOUBLE UPSCAYL PROGRESS
|
// DOUBLE UPSCAYL PROGRESS
|
||||||
@ -109,7 +109,7 @@ const Home = () => {
|
|||||||
setProgress(data);
|
setProgress(data);
|
||||||
}
|
}
|
||||||
handleErrors(data);
|
handleErrors(data);
|
||||||
logit(`📢 DOUBLE_UPSCAYL_PROGRESS: `, data);
|
logit(`🚧 DOUBLE_UPSCAYL_PROGRESS: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// VIDEO UPSCAYL PROGRESS
|
// VIDEO UPSCAYL PROGRESS
|
||||||
@ -118,7 +118,7 @@ const Home = () => {
|
|||||||
setProgress(data);
|
setProgress(data);
|
||||||
}
|
}
|
||||||
handleErrors(data);
|
handleErrors(data);
|
||||||
logit(`📢 UPSCAYL_VIDEO_PROGRESS: `, data);
|
logit(`🚧 UPSCAYL_VIDEO_PROGRESS: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// UPSCAYL DONE
|
// UPSCAYL DONE
|
||||||
@ -126,14 +126,14 @@ const Home = () => {
|
|||||||
setProgress("");
|
setProgress("");
|
||||||
setUpscaledImagePath(data);
|
setUpscaledImagePath(data);
|
||||||
logit("upscaledImagePath: ", upscaledImagePath);
|
logit("upscaledImagePath: ", upscaledImagePath);
|
||||||
logit(`📢 UPSCAYL_DONE: `, data);
|
logit(`💯 UPSCAYL_DONE: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// FOLDER UPSCAYL DONE
|
// FOLDER UPSCAYL DONE
|
||||||
window.electron.on(commands.FOLDER_UPSCAYL_DONE, (_, data: string) => {
|
window.electron.on(commands.FOLDER_UPSCAYL_DONE, (_, data: string) => {
|
||||||
setProgress("");
|
setProgress("");
|
||||||
setUpscaledBatchFolderPath(data);
|
setUpscaledBatchFolderPath(data);
|
||||||
logit(`📢 FOLDER_UPSCAYL_DONE: `, data);
|
logit(`💯 FOLDER_UPSCAYL_DONE: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// DOUBLE UPSCAYL DONE
|
// DOUBLE UPSCAYL DONE
|
||||||
@ -141,21 +141,21 @@ const Home = () => {
|
|||||||
setProgress("");
|
setProgress("");
|
||||||
setDoubleUpscaylCounter(0);
|
setDoubleUpscaylCounter(0);
|
||||||
setUpscaledImagePath(data);
|
setUpscaledImagePath(data);
|
||||||
logit(`📢 DOUBLE_UPSCAYL_DONE: `, data);
|
logit(`💯 DOUBLE_UPSCAYL_DONE: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// VIDEO UPSCAYL DONE
|
// VIDEO UPSCAYL DONE
|
||||||
window.electron.on(commands.UPSCAYL_VIDEO_DONE, (_, data: string) => {
|
window.electron.on(commands.UPSCAYL_VIDEO_DONE, (_, data: string) => {
|
||||||
setProgress("");
|
setProgress("");
|
||||||
setUpscaledVideoPath(data);
|
setUpscaledVideoPath(data);
|
||||||
logit(`📢 UPSCAYL_VIDEO_DONE: `, data);
|
logit(`💯 UPSCAYL_VIDEO_DONE: `, data);
|
||||||
});
|
});
|
||||||
|
|
||||||
// CUSTOM FOLDER LISTENER
|
// CUSTOM FOLDER LISTENER
|
||||||
window.electron.on(
|
window.electron.on(
|
||||||
commands.CUSTOM_MODEL_FILES_LIST,
|
commands.CUSTOM_MODEL_FILES_LIST,
|
||||||
(_, data: string[]) => {
|
(_, data: string[]) => {
|
||||||
logit(`📢 CUSTOM_MODEL_FILES_LIST: `, data);
|
logit(`📜 CUSTOM_MODEL_FILES_LIST: `, data);
|
||||||
const newModelOptions = data.map((model) => {
|
const newModelOptions = data.map((model) => {
|
||||||
return {
|
return {
|
||||||
value: model,
|
value: model,
|
||||||
@ -182,7 +182,7 @@ const Home = () => {
|
|||||||
|
|
||||||
if (customModelsPath !== null) {
|
if (customModelsPath !== null) {
|
||||||
window.electron.send(commands.GET_MODELS_LIST, customModelsPath);
|
window.electron.send(commands.GET_MODELS_LIST, customModelsPath);
|
||||||
logit("📢 GET_MODELS_LIST: ", customModelsPath);
|
logit("🎯 GET_MODELS_LIST: ", customModelsPath);
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@ -204,10 +204,10 @@ const Home = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (imagePath.length > 0 && !isVideo) {
|
if (imagePath.length > 0 && !isVideo) {
|
||||||
logit("📢 imagePath: ", imagePath);
|
logit("🖼 imagePath: ", imagePath);
|
||||||
|
|
||||||
const extension = imagePath.toLocaleLowerCase().split(".").pop();
|
const extension = imagePath.toLocaleLowerCase().split(".").pop();
|
||||||
logit("📢 Extension: ", extension);
|
logit("🔤 Extension: ", extension);
|
||||||
|
|
||||||
if (!allowedFileTypes.includes(extension.toLowerCase())) {
|
if (!allowedFileTypes.includes(extension.toLowerCase())) {
|
||||||
alert("Please select an image");
|
alert("Please select an image");
|
||||||
@ -228,7 +228,7 @@ const Home = () => {
|
|||||||
}, [imagePath, videoPath]);
|
}, [imagePath, videoPath]);
|
||||||
|
|
||||||
const resetImagePaths = () => {
|
const resetImagePaths = () => {
|
||||||
logit("📢 Resetting image paths");
|
logit("🔄 Resetting image paths");
|
||||||
|
|
||||||
setDimensions({
|
setDimensions({
|
||||||
width: null,
|
width: null,
|
||||||
@ -273,10 +273,10 @@ const Home = () => {
|
|||||||
var path = await window.electron.invoke(commands.SELECT_FILE);
|
var path = await window.electron.invoke(commands.SELECT_FILE);
|
||||||
|
|
||||||
if (path !== null) {
|
if (path !== null) {
|
||||||
logit("📢 Selected Image Path: ", path);
|
logit("🖼 Selected Image Path: ", path);
|
||||||
SetImagePath(path);
|
SetImagePath(path);
|
||||||
var dirname = path.match(/(.*)[\/\\]/)[1] || "";
|
var dirname = path.match(/(.*)[\/\\]/)[1] || "";
|
||||||
logit("📢 Selected Image Directory: ", dirname);
|
logit("📁 Selected Image Directory: ", dirname);
|
||||||
setOutputPath(dirname);
|
setOutputPath(dirname);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -287,11 +287,11 @@ const Home = () => {
|
|||||||
var path = await window.electron.invoke(commands.SELECT_FOLDER);
|
var path = await window.electron.invoke(commands.SELECT_FOLDER);
|
||||||
|
|
||||||
if (path !== null) {
|
if (path !== null) {
|
||||||
logit("📢 Selected Folder Path: ", path);
|
logit("🖼 Selected Folder Path: ", path);
|
||||||
setBatchFolderPath(path);
|
setBatchFolderPath(path);
|
||||||
setOutputPath(path + "_upscayled");
|
setOutputPath(path + "_upscayled");
|
||||||
} else {
|
} else {
|
||||||
logit("📢 Folder selection cancelled");
|
logit("🚫 Folder selection cancelled");
|
||||||
setBatchFolderPath("");
|
setBatchFolderPath("");
|
||||||
setOutputPath("");
|
setOutputPath("");
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ const Home = () => {
|
|||||||
|
|
||||||
const handleModelChange = (e: any) => {
|
const handleModelChange = (e: any) => {
|
||||||
setModel(e.value);
|
setModel(e.value);
|
||||||
logit("📢 Model changed: ", e.value);
|
logit("🔀 Model changed: ", e.value);
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"model",
|
"model",
|
||||||
JSON.stringify({ label: e.label, value: e.value })
|
JSON.stringify({ label: e.label, value: e.value })
|
||||||
@ -329,7 +329,7 @@ const Home = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const openFolderHandler = (e) => {
|
const openFolderHandler = (e) => {
|
||||||
logit("📢 OPEN_FOLDER: ", upscaledBatchFolderPath);
|
logit("📂 OPEN_FOLDER: ", upscaledBatchFolderPath);
|
||||||
window.electron.send(commands.OPEN_FOLDER, upscaledBatchFolderPath);
|
window.electron.send(commands.OPEN_FOLDER, upscaledBatchFolderPath);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ const Home = () => {
|
|||||||
e.dataTransfer.items.length === 0 ||
|
e.dataTransfer.items.length === 0 ||
|
||||||
e.dataTransfer.files.length === 0
|
e.dataTransfer.files.length === 0
|
||||||
) {
|
) {
|
||||||
logit("📢 No valid files dropped");
|
logit("👎 No valid files dropped");
|
||||||
alert("Please drag and drop an image");
|
alert("Please drag and drop an image");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -349,25 +349,25 @@ const Home = () => {
|
|||||||
const type = e.dataTransfer.items[0].type;
|
const type = e.dataTransfer.items[0].type;
|
||||||
const filePath = e.dataTransfer.files[0].path;
|
const filePath = e.dataTransfer.files[0].path;
|
||||||
const extension = e.dataTransfer.files[0].name.split(".").at(-1);
|
const extension = e.dataTransfer.files[0].name.split(".").at(-1);
|
||||||
logit("📢 Dropped file: ", JSON.stringify({ type, filePath, extension }));
|
logit("⤵️ Dropped file: ", JSON.stringify({ type, filePath, extension }));
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(!type.includes("image") && !type.includes("video")) ||
|
(!type.includes("image") && !type.includes("video")) ||
|
||||||
(!allowedFileTypes.includes(extension.toLowerCase()) &&
|
(!allowedFileTypes.includes(extension.toLowerCase()) &&
|
||||||
!allowedVideoFileTypes.includes(extension.toLowerCase()))
|
!allowedVideoFileTypes.includes(extension.toLowerCase()))
|
||||||
) {
|
) {
|
||||||
logit("📢 Invalid file dropped");
|
logit("🚫 Invalid file dropped");
|
||||||
alert("Please drag and drop an image");
|
alert("Please drag and drop an image");
|
||||||
} else {
|
} else {
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
setVideoPath(filePath);
|
setVideoPath(filePath);
|
||||||
} else {
|
} else {
|
||||||
logit("📢 Setting image path: ", filePath);
|
logit("🖼 Setting image path: ", filePath);
|
||||||
SetImagePath(filePath);
|
SetImagePath(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
var dirname = filePath.match(/(.*)[\/\\]/)[1] || "";
|
var dirname = filePath.match(/(.*)[\/\\]/)[1] || "";
|
||||||
logit("📢 Setting output path: ", dirname);
|
logit("🗂 Setting output path: ", dirname);
|
||||||
setOutputPath(dirname);
|
setOutputPath(dirname);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -380,7 +380,7 @@ const Home = () => {
|
|||||||
const filePath = e.clipboardData.files[0].path;
|
const filePath = e.clipboardData.files[0].path;
|
||||||
const extension = e.clipboardData.files[0].name.split(".").at(-1);
|
const extension = e.clipboardData.files[0].name.split(".").at(-1);
|
||||||
|
|
||||||
logit("📢 Pasted file: ", JSON.stringify({ type, filePath, extension }));
|
logit("📋 Pasted file: ", JSON.stringify({ type, filePath, extension }));
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!type.includes("image") &&
|
!type.includes("image") &&
|
||||||
@ -390,7 +390,7 @@ const Home = () => {
|
|||||||
} else {
|
} else {
|
||||||
SetImagePath(filePath);
|
SetImagePath(filePath);
|
||||||
var dirname = filePath.match(/(.*)[\/\\]/)[1] || "";
|
var dirname = filePath.match(/(.*)[\/\\]/)[1] || "";
|
||||||
logit("📢 Setting output path: ", dirname);
|
logit("🗂 Setting output path: ", dirname);
|
||||||
setOutputPath(dirname);
|
setOutputPath(dirname);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -398,13 +398,13 @@ const Home = () => {
|
|||||||
const outputHandler = async () => {
|
const outputHandler = async () => {
|
||||||
var path = await window.electron.invoke(commands.SELECT_FOLDER);
|
var path = await window.electron.invoke(commands.SELECT_FOLDER);
|
||||||
if (path !== null) {
|
if (path !== null) {
|
||||||
logit("📢 Setting Output Path: ", path);
|
logit("🗂 Setting Output Path: ", path);
|
||||||
setOutputPath(path);
|
setOutputPath(path);
|
||||||
|
|
||||||
const rememberOutputFolder = localStorage.getItem("rememberOutputFolder");
|
const rememberOutputFolder = localStorage.getItem("rememberOutputFolder");
|
||||||
|
|
||||||
if (rememberOutputFolder) {
|
if (rememberOutputFolder) {
|
||||||
logit("📢 Remembering Output Folder: ", path);
|
logit("🧠 Remembering Output Folder: ", path);
|
||||||
localStorage.setItem("lastOutputFolderPath", path);
|
localStorage.setItem("lastOutputFolderPath", path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -416,7 +416,7 @@ const Home = () => {
|
|||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
setUpscaledVideoPath("");
|
setUpscaledVideoPath("");
|
||||||
} else {
|
} else {
|
||||||
logit("📢 Resetting Upscaled Image Path");
|
logit("🔄 Resetting Upscaled Image Path");
|
||||||
setUpscaledImagePath("");
|
setUpscaledImagePath("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ const Home = () => {
|
|||||||
saveImageAs,
|
saveImageAs,
|
||||||
scale,
|
scale,
|
||||||
});
|
});
|
||||||
logit("📢 DOUBLE_UPSCAYL");
|
logit("🏁 DOUBLE_UPSCAYL");
|
||||||
} else if (batchMode) {
|
} else if (batchMode) {
|
||||||
setDoubleUpscayl(false);
|
setDoubleUpscayl(false);
|
||||||
window.electron.send(commands.FOLDER_UPSCAYL, {
|
window.electron.send(commands.FOLDER_UPSCAYL, {
|
||||||
@ -444,7 +444,7 @@ const Home = () => {
|
|||||||
saveImageAs,
|
saveImageAs,
|
||||||
scale,
|
scale,
|
||||||
});
|
});
|
||||||
logit("📢 FOLDER_UPSCAYL");
|
logit("🏁 FOLDER_UPSCAYL");
|
||||||
} else {
|
} else {
|
||||||
window.electron.send(commands.UPSCAYL, {
|
window.electron.send(commands.UPSCAYL, {
|
||||||
scaleFactor,
|
scaleFactor,
|
||||||
@ -455,7 +455,7 @@ const Home = () => {
|
|||||||
saveImageAs,
|
saveImageAs,
|
||||||
scale,
|
scale,
|
||||||
});
|
});
|
||||||
logit("📢 UPSCAYL");
|
logit("🏁 UPSCAYL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else if (isVideo && videoPath !== "") {
|
// else if (isVideo && videoPath !== "") {
|
||||||
@ -470,13 +470,13 @@ const Home = () => {
|
|||||||
// }
|
// }
|
||||||
else {
|
else {
|
||||||
alert(`Please select ${isVideo ? "a video" : "an image"} to upscale`);
|
alert(`Please select ${isVideo ? "a video" : "an image"} to upscale`);
|
||||||
logit("📢 No valid image selected");
|
logit("🚫 No valid image selected");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const stopHandler = () => {
|
const stopHandler = () => {
|
||||||
window.electron.send(commands.STOP);
|
window.electron.send(commands.STOP);
|
||||||
logit("📢 Stopping Upscayl");
|
logit("🛑 Stopping Upscayl");
|
||||||
resetImagePaths();
|
resetImagePaths();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -573,8 +573,7 @@ const Home = () => {
|
|||||||
onDragOver={(e) => handleDragOver(e)}
|
onDragOver={(e) => handleDragOver(e)}
|
||||||
onDragEnter={(e) => handleDragEnter(e)}
|
onDragEnter={(e) => handleDragEnter(e)}
|
||||||
onDragLeave={(e) => handleDragLeave(e)}
|
onDragLeave={(e) => handleDragLeave(e)}
|
||||||
onPaste={(e) => handlePaste(e)}
|
onPaste={(e) => handlePaste(e)}>
|
||||||
>
|
|
||||||
{progress.length > 0 &&
|
{progress.length > 0 &&
|
||||||
upscaledImagePath.length === 0 &&
|
upscaledImagePath.length === 0 &&
|
||||||
upscaledBatchFolderPath.length === 0 &&
|
upscaledBatchFolderPath.length === 0 &&
|
||||||
@ -664,8 +663,7 @@ const Home = () => {
|
|||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
className="bg-gradient-blue rounded-lg p-3 font-medium text-white/90 transition-colors"
|
className="bg-gradient-blue rounded-lg p-3 font-medium text-white/90 transition-colors"
|
||||||
onClick={openFolderHandler}
|
onClick={openFolderHandler}>
|
||||||
>
|
|
||||||
Open Upscayled Folder
|
Open Upscayled Folder
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
|
BIN
resources/models/RealESRGAN_General_x4_v3.bin
Normal file
BIN
resources/models/RealESRGAN_General_x4_v3.bin
Normal file
Binary file not shown.
74
resources/models/RealESRGAN_General_x4_v3.param
Normal file
74
resources/models/RealESRGAN_General_x4_v3.param
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
7767517
|
||||||
|
72 73
|
||||||
|
Input input.1 0 1 data
|
||||||
|
Split splitncnn_input0 1 2 data input_splitncnn_0 input_splitncnn_1
|
||||||
|
Convolution Conv_0 1 1 input_splitncnn_1 102 0=64 1=3 4=1 5=1 6=1728
|
||||||
|
PReLU PRelu_1 1 1 102 105 0=64
|
||||||
|
Convolution Conv_2 1 1 105 106 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_3 1 1 106 109 0=64
|
||||||
|
Convolution Conv_4 1 1 109 110 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_5 1 1 110 113 0=64
|
||||||
|
Convolution Conv_6 1 1 113 114 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_7 1 1 114 117 0=64
|
||||||
|
Convolution Conv_8 1 1 117 118 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_9 1 1 118 121 0=64
|
||||||
|
Convolution Conv_10 1 1 121 122 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_11 1 1 122 125 0=64
|
||||||
|
Convolution Conv_12 1 1 125 126 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_13 1 1 126 129 0=64
|
||||||
|
Convolution Conv_14 1 1 129 130 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_15 1 1 130 133 0=64
|
||||||
|
Convolution Conv_16 1 1 133 134 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_17 1 1 134 137 0=64
|
||||||
|
Convolution Conv_18 1 1 137 138 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_19 1 1 138 141 0=64
|
||||||
|
Convolution Conv_20 1 1 141 142 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_21 1 1 142 145 0=64
|
||||||
|
Convolution Conv_22 1 1 145 146 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_23 1 1 146 149 0=64
|
||||||
|
Convolution Conv_24 1 1 149 150 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_25 1 1 150 153 0=64
|
||||||
|
Convolution Conv_26 1 1 153 154 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_27 1 1 154 157 0=64
|
||||||
|
Convolution Conv_28 1 1 157 158 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_29 1 1 158 161 0=64
|
||||||
|
Convolution Conv_30 1 1 161 162 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_31 1 1 162 165 0=64
|
||||||
|
Convolution Conv_32 1 1 165 166 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_33 1 1 166 169 0=64
|
||||||
|
Convolution Conv_34 1 1 169 170 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_35 1 1 170 173 0=64
|
||||||
|
Convolution Conv_36 1 1 173 174 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_37 1 1 174 177 0=64
|
||||||
|
Convolution Conv_38 1 1 177 178 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_39 1 1 178 181 0=64
|
||||||
|
Convolution Conv_40 1 1 181 182 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_41 1 1 182 185 0=64
|
||||||
|
Convolution Conv_42 1 1 185 186 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_43 1 1 186 189 0=64
|
||||||
|
Convolution Conv_44 1 1 189 190 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_45 1 1 190 193 0=64
|
||||||
|
Convolution Conv_46 1 1 193 194 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_47 1 1 194 197 0=64
|
||||||
|
Convolution Conv_48 1 1 197 198 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_49 1 1 198 201 0=64
|
||||||
|
Convolution Conv_50 1 1 201 202 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_51 1 1 202 205 0=64
|
||||||
|
Convolution Conv_52 1 1 205 206 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_53 1 1 206 209 0=64
|
||||||
|
Convolution Conv_54 1 1 209 210 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_55 1 1 210 213 0=64
|
||||||
|
Convolution Conv_56 1 1 213 214 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_57 1 1 214 217 0=64
|
||||||
|
Convolution Conv_58 1 1 217 218 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_59 1 1 218 221 0=64
|
||||||
|
Convolution Conv_60 1 1 221 222 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_61 1 1 222 225 0=64
|
||||||
|
Convolution Conv_62 1 1 225 226 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_63 1 1 226 229 0=64
|
||||||
|
Convolution Conv_64 1 1 229 230 0=64 1=3 4=1 5=1 6=36864
|
||||||
|
PReLU PRelu_65 1 1 230 233 0=64
|
||||||
|
Convolution Conv_66 1 1 233 234 0=48 1=3 4=1 5=1 6=27648
|
||||||
|
PixelShuffle DepthToSpace_67 1 1 234 235 0=4
|
||||||
|
Interp Resize_68 1 1 input_splitncnn_0 240 0=1 1=4.000000e+00 2=4.000000e+00
|
||||||
|
BinaryOp Add_69 2 1 235 240 output
|
Loading…
x
Reference in New Issue
Block a user