Update images and fix model issue
@ -7,15 +7,15 @@ export const MODELS = {
|
||||
id: "upscayl-lite-4x",
|
||||
name: "Upscayl Lite",
|
||||
},
|
||||
remacri: {
|
||||
"remacri-4x": {
|
||||
id: "remacri-4x",
|
||||
name: "Remacri (Non-Commercial)",
|
||||
},
|
||||
ultramix_balanced: {
|
||||
"ultramix-balanced-4x": {
|
||||
id: "ultramix-balanced-4x",
|
||||
name: "Ultramix (Non-Commercial)",
|
||||
},
|
||||
ultrasharp: {
|
||||
"ultrasharp-4x": {
|
||||
id: "ultrasharp-4x",
|
||||
name: "Ultrasharp (Non-Commercial)",
|
||||
},
|
||||
@ -26,7 +26,3 @@ export const MODELS = {
|
||||
};
|
||||
|
||||
export type ModelId = keyof typeof MODELS;
|
||||
|
||||
export const DEFAULT_MODELS_ID_LIST = Object.keys(MODELS).map(
|
||||
(modelId) => modelId,
|
||||
);
|
||||
|
@ -14,7 +14,7 @@ import { modelsPath } from "../utils/get-resource-paths";
|
||||
import { ELECTRON_COMMANDS } from "../../common/electron-commands";
|
||||
import { BatchUpscaylPayload } from "../../common/types/types";
|
||||
import showNotification from "../utils/show-notification";
|
||||
import { DEFAULT_MODELS_ID_LIST } from "../../common/models-list";
|
||||
import { MODELS } from "../../common/models-list";
|
||||
|
||||
const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
|
||||
const mainWindow = getMainWindow();
|
||||
@ -41,7 +41,7 @@ const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
|
||||
fs.mkdirSync(outputFolderPath, { recursive: true });
|
||||
}
|
||||
|
||||
const isDefaultModel = DEFAULT_MODELS_ID_LIST.includes(model);
|
||||
const isDefaultModel = model in MODELS;
|
||||
|
||||
// UPSCALE
|
||||
const upscayl = spawnUpscayl(
|
||||
@ -50,7 +50,7 @@ const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
|
||||
outputDir: outputFolderPath,
|
||||
modelsPath: isDefaultModel
|
||||
? modelsPath
|
||||
: savedCustomModelsPath ?? modelsPath,
|
||||
: (savedCustomModelsPath ?? modelsPath),
|
||||
model,
|
||||
gpuId,
|
||||
saveImageAs,
|
||||
@ -75,9 +75,13 @@ const batchUpscayl = async (event, payload: BatchUpscaylPayload) => {
|
||||
ELECTRON_COMMANDS.FOLDER_UPSCAYL_PROGRESS,
|
||||
data.toString(),
|
||||
);
|
||||
if ((data as string).includes("Error")) {
|
||||
if (
|
||||
(data as string).includes("Error") ||
|
||||
(data as string).includes("failed")
|
||||
) {
|
||||
logit("❌ ", data);
|
||||
encounteredError = true;
|
||||
onError(data);
|
||||
} else if (data.includes("Resizing")) {
|
||||
mainWindow.webContents.send(ELECTRON_COMMANDS.SCALING_AND_CONVERTING);
|
||||
}
|
||||
|
@ -18,10 +18,10 @@ import { ELECTRON_COMMANDS } from "../../common/electron-commands";
|
||||
import { DoubleUpscaylPayload } from "../../common/types/types";
|
||||
import { ImageFormat } from "../types/types";
|
||||
import showNotification from "../utils/show-notification";
|
||||
import { DEFAULT_MODELS_ID_LIST } from "../../common/models-list";
|
||||
import getFilenameFromPath from "../../common/get-file-name";
|
||||
import decodePath from "../../common/decode-path";
|
||||
import getDirectoryFromPath from "../../common/get-directory-from-path";
|
||||
import { MODELS } from "../../common/models-list";
|
||||
|
||||
const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
|
||||
const mainWindow = getMainWindow();
|
||||
@ -41,7 +41,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
|
||||
const fullfileName = getFilenameFromPath(imagePath);
|
||||
const fileName = parse(fullfileName).name;
|
||||
|
||||
const isDefaultModel = DEFAULT_MODELS_ID_LIST.includes(model);
|
||||
const isDefaultModel = model in MODELS;
|
||||
|
||||
// COPY IMAGE TO TMP FOLDER
|
||||
|
||||
@ -63,7 +63,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
|
||||
outFile,
|
||||
modelsPath: isDefaultModel
|
||||
? modelsPath
|
||||
: savedCustomModelsPath ?? modelsPath,
|
||||
: (savedCustomModelsPath ?? modelsPath),
|
||||
model,
|
||||
scale,
|
||||
customWidth,
|
||||
@ -113,9 +113,10 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
|
||||
data,
|
||||
);
|
||||
// IF PROGRESS HAS ERROR, UPSCAYL FAILED
|
||||
if (data.includes("Error")) {
|
||||
if (data.includes("Error") || data.includes("failed")) {
|
||||
upscayl2.kill();
|
||||
failed2 = true;
|
||||
onError2(data);
|
||||
} else if (data.includes("Resizing")) {
|
||||
mainWindow.webContents.send(ELECTRON_COMMANDS.SCALING_AND_CONVERTING);
|
||||
}
|
||||
@ -170,6 +171,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
|
||||
if (data.includes("Error") || data.includes("failed")) {
|
||||
upscayl.kill();
|
||||
failed = true;
|
||||
onError(data);
|
||||
} else if (data.includes("Resizing")) {
|
||||
mainWindow.webContents.send(ELECTRON_COMMANDS.SCALING_AND_CONVERTING);
|
||||
}
|
||||
@ -184,7 +186,7 @@ const doubleUpscayl = async (event, payload: DoubleUpscaylPayload) => {
|
||||
outFile,
|
||||
modelsPath: isDefaultModel
|
||||
? modelsPath
|
||||
: savedCustomModelsPath ?? modelsPath,
|
||||
: (savedCustomModelsPath ?? modelsPath),
|
||||
model,
|
||||
gpuId,
|
||||
saveImageAs,
|
||||
|
@ -16,10 +16,10 @@ import { getMainWindow } from "../main-window";
|
||||
import { ImageUpscaylPayload } from "../../common/types/types";
|
||||
import { ImageFormat } from "../types/types";
|
||||
import showNotification from "../utils/show-notification";
|
||||
import { DEFAULT_MODELS_ID_LIST } from "../../common/models-list";
|
||||
import getFilenameFromPath from "../../common/get-file-name";
|
||||
import decodePath from "../../common/decode-path";
|
||||
import getDirectoryFromPath from "../../common/get-directory-from-path";
|
||||
import { MODELS } from "../../common/models-list";
|
||||
|
||||
const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
|
||||
const mainWindow = getMainWindow();
|
||||
@ -55,7 +55,7 @@ const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
|
||||
"." +
|
||||
saveImageAs;
|
||||
|
||||
const isDefaultModel = DEFAULT_MODELS_ID_LIST.includes(model);
|
||||
const isDefaultModel = model in MODELS;
|
||||
|
||||
// Check if windows can write the new filename to the file system
|
||||
if (outFile.length >= 255) {
|
||||
@ -97,7 +97,7 @@ const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
|
||||
outFile,
|
||||
modelsPath: isDefaultModel
|
||||
? modelsPath
|
||||
: savedCustomModelsPath ?? modelsPath,
|
||||
: (savedCustomModelsPath ?? modelsPath),
|
||||
model,
|
||||
scale,
|
||||
gpuId,
|
||||
@ -122,9 +122,10 @@ const imageUpscayl = async (event, payload: ImageUpscaylPayload) => {
|
||||
ELECTRON_COMMANDS.UPSCAYL_PROGRESS,
|
||||
data.toString(),
|
||||
);
|
||||
if (data.includes("Error")) {
|
||||
if (data.includes("Error") || data.includes("failed")) {
|
||||
upscayl.kill();
|
||||
failed = true;
|
||||
onError(data);
|
||||
} else if (data.includes("Resizing")) {
|
||||
mainWindow.webContents.send(ELECTRON_COMMANDS.SCALING_AND_CONVERTING);
|
||||
}
|
||||
|
20
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "upscayl",
|
||||
"version": "2.11.5",
|
||||
"version": "2.15.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "upscayl",
|
||||
"version": "2.11.5",
|
||||
"version": "2.15.0",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
@ -52,7 +52,7 @@
|
||||
"electron-builder": "^24.13.3",
|
||||
"next": "^14.2.10",
|
||||
"postcss": "^8.4.31",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-tailwindcss": "^0.4.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
@ -4176,9 +4176,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||
"dependencies": {
|
||||
"path-key": "^3.1.0",
|
||||
"shebang-command": "^2.0.0",
|
||||
@ -9144,10 +9144,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz",
|
||||
"integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==",
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
|
||||
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
},
|
||||
@ -9163,6 +9164,7 @@
|
||||
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.4.1.tgz",
|
||||
"integrity": "sha512-hwn2EiJmv8M+AW4YDkbjJ6HlZCTzLyz1QlySn9sMuKV/Px0fjwldlB7tol8GzdgqtkdPtzT3iJ4UzdnYXP25Ag==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12.17.0"
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "upscayl",
|
||||
"private": true,
|
||||
"version": "2.11.5",
|
||||
"version": "2.15.0",
|
||||
"productName": "Upscayl",
|
||||
"author": {
|
||||
"name": "Nayam Amarshe",
|
||||
@ -215,7 +215,7 @@
|
||||
"electron-builder": "^24.13.3",
|
||||
"next": "^14.2.10",
|
||||
"postcss": "^8.4.31",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-tailwindcss": "^0.4.1",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
@ -254,6 +254,6 @@
|
||||
"theme-change": "^2.5.0"
|
||||
},
|
||||
"volta": {
|
||||
"node": "18.17.0"
|
||||
"node": "18.20.5"
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@
|
||||
"TITLE": "Step 2",
|
||||
"DESCRIPTION": "Select Model",
|
||||
"MODELS": {
|
||||
"x4plus": "General Photo (Real-ESRGAN)",
|
||||
"upscayl-standard-4x": "General Photo (Real-ESRGAN)",
|
||||
"x4fast": "General Photo (Fast Real-ESRGAN)",
|
||||
"remacri": "General Photo (Remacri)",
|
||||
"ultramix": "General Photo (Ultramix Balanced)",
|
||||
|
@ -102,7 +102,7 @@
|
||||
"TITLE": "Paso 2",
|
||||
"DESCRIPTION": "Seleccionar modelo",
|
||||
"MODELS": {
|
||||
"x4plus": "Foto General (Real-ESRGAN)",
|
||||
"upscayl-standard-4x": "Foto General (Real-ESRGAN)",
|
||||
"x4fast": "Foto General (Fast Real-ESRGAN)",
|
||||
"remacri": "Foto General (Remacri)",
|
||||
"ultramix": "Foto General (Ultramix Balanced)",
|
||||
|
@ -102,7 +102,7 @@
|
||||
"TITLE": "Étape 2",
|
||||
"DESCRIPTION": "Sélectionner un modèle",
|
||||
"MODELS": {
|
||||
"x4plus": "Photo Générale (Real-ESRGAN)",
|
||||
"upscayl-standard-4x": "Photo Générale (Real-ESRGAN)",
|
||||
"x4fast": "Photo Générale (Fast Real-ESRGAN)",
|
||||
"remacri": "Photo Générale (Remacri)",
|
||||
"ultramix": "Photo Générale (Ultramix Balanced)",
|
||||
|
@ -102,7 +102,7 @@
|
||||
"TITLE": "ステップ 2",
|
||||
"DESCRIPTION": "モデルを選択",
|
||||
"MODELS": {
|
||||
"x4plus": "一般写真 (Real-ESRGAN)",
|
||||
"upscayl-standard-4x": "一般写真 (Real-ESRGAN)",
|
||||
"x4fast": "一般写真 (高速 Real-ESRGAN)",
|
||||
"remacri": "一般写真 (Remacri)",
|
||||
"ultramix": "一般写真 (Ultramix Balanced)",
|
||||
|
@ -102,7 +102,7 @@
|
||||
"TITLE": "Шаг 2",
|
||||
"DESCRIPTION": "Выберите модель",
|
||||
"MODELS": {
|
||||
"x4plus": "Общая Фотография (Real-ESRGAN)",
|
||||
"upscayl-standard-4x": "Общая Фотография (Real-ESRGAN)",
|
||||
"x4fast": "Общая Фотография (Быстрый Real-ESRGAN)",
|
||||
"remacri": "Общая Фотография (Remacri)",
|
||||
"ultramix": "Общая Фотография (Ultramix Balanced)",
|
||||
|
@ -102,7 +102,7 @@
|
||||
"TITLE": "第二步",
|
||||
"DESCRIPTION": "选择模型",
|
||||
"MODELS": {
|
||||
"x4plus": "一般照片 (Real-ESRGAN)",
|
||||
"upscayl-standard-4x": "一般照片 (Real-ESRGAN)",
|
||||
"x4fast": "一般照片 (快速办 Real-ESRGAN)",
|
||||
"remacri": "一般照片 (Remacri)",
|
||||
"ultramix": "一般照片 (Ultramix Balanced)",
|
||||
|
Before ![]() (image error) Size: 718 KiB After ![]() (image error) Size: 20 KiB ![]() ![]() |
Before ![]() (image error) Size: 14 KiB After ![]() (image error) Size: 4.5 KiB ![]() ![]() |
Before ![]() (image error) Size: 718 KiB After ![]() (image error) Size: 64 KiB ![]() ![]() |
Before ![]() (image error) Size: 14 KiB After ![]() (image error) Size: 16 KiB ![]() ![]() |
Before ![]() (image error) Size: 718 KiB After ![]() (image error) Size: 68 KiB ![]() ![]() |
Before ![]() (image error) Size: 14 KiB After ![]() (image error) Size: 4.7 KiB ![]() ![]() |
Before ![]() (image error) Size: 718 KiB After ![]() (image error) Size: 84 KiB ![]() ![]() |
Before ![]() (image error) Size: 14 KiB After ![]() (image error) Size: 13 KiB ![]() ![]() |