mirror of
https://github.com/upscayl/upscayl.git
synced 2025-02-17 11:18:36 +01:00
Updated UI
This commit is contained in:
parent
8f5cb99e66
commit
c9cf06ca28
@ -2,11 +2,13 @@ const path = require("path");
|
|||||||
const { rootPath } = require("electron-root-path");
|
const { rootPath } = require("electron-root-path");
|
||||||
const { isPackaged } = require("electron-is-packaged");
|
const { isPackaged } = require("electron-is-packaged");
|
||||||
const { getPlatform } = require("./getPlatform");
|
const { getPlatform } = require("./getPlatform");
|
||||||
const {app} = require('electron')
|
|
||||||
|
|
||||||
const IS_PROD = process.env.NODE_ENV === "production";
|
const IS_PROD = process.env.NODE_ENV === "production";
|
||||||
|
|
||||||
const binariesPath = path.join(app.getAppPath(), "../", getPlatform(), "./bin");
|
const binariesPath =
|
||||||
|
IS_PROD && isPackaged // the path to a bundled electron app.
|
||||||
|
? path.join(rootPath, "./Contents", "./Resources", "./bin")
|
||||||
|
: path.join(rootPath, "./resources", getPlatform(), "./bin");
|
||||||
|
|
||||||
const execPath = path.resolve(path.join(binariesPath, "./upscayl"));
|
const execPath = path.resolve(path.join(binariesPath, "./upscayl"));
|
||||||
const modelsPath = path.resolve(path.join(binariesPath, "./models"));
|
const modelsPath = path.resolve(path.join(binariesPath, "./models"));
|
||||||
|
@ -29,7 +29,7 @@ app.on("ready", async () => {
|
|||||||
|
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 1100,
|
width: 1100,
|
||||||
height: 850,
|
height: 700,
|
||||||
minHeight: 500,
|
minHeight: 500,
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@ -96,19 +96,11 @@ ipcMain.handle(commands.SELECT_FOLDER, async (event, message) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
||||||
//console.log(execPath)
|
|
||||||
console.log(payload);
|
|
||||||
const model = payload.model;
|
const model = payload.model;
|
||||||
const scale = payload.scaleFactor;
|
const scale = payload.scaleFactor;
|
||||||
let inputDir = payload.imagePath.match(/(.*)[\/\\]/)[1] || "";
|
|
||||||
/*if (!fs.existsSync(inputDir)) {
|
|
||||||
fs.mkdirSync(inputDir);
|
|
||||||
}*/
|
|
||||||
let outputDir = payload.outputPath;
|
|
||||||
|
|
||||||
// if (!fs.existsSync(outputDir)) {
|
let inputDir = payload.imagePath.match(/(.*)[\/\\]/)[1] || "";
|
||||||
// fs.mkdirSync(outputDir);
|
let outputDir = payload.outputPath;
|
||||||
// }
|
|
||||||
|
|
||||||
// COPY IMAGE TO upscaled FOLDER
|
// COPY IMAGE TO upscaled FOLDER
|
||||||
const fullfileName = payload.imagePath.split("/").slice(-1)[0];
|
const fullfileName = payload.imagePath.split("/").slice(-1)[0];
|
||||||
@ -126,9 +118,7 @@ ipcMain.on(commands.UPSCAYL, async (event, payload) => {
|
|||||||
"-s",
|
"-s",
|
||||||
scale === 2 ? 4 : scale,
|
scale === 2 ? 4 : scale,
|
||||||
"-m",
|
"-m",
|
||||||
modelsPath, // if (!fs.existsSync(outputDir)) {
|
modelsPath,
|
||||||
// fs.mkdirSync(outputDir);
|
|
||||||
// }
|
|
||||||
"-n",
|
"-n",
|
||||||
model,
|
model,
|
||||||
],
|
],
|
||||||
|
36
package.json
36
package.json
@ -1,17 +1,31 @@
|
|||||||
{
|
{
|
||||||
"name": "upscayl",
|
"name": "upscayl",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.3",
|
"version": "1.1.0",
|
||||||
"productName": "Upscayl",
|
"productName": "Upscayl",
|
||||||
"author": "TGS963 <nayam@nay.am>",
|
"contributors": [
|
||||||
"email": "nay@am.com",
|
{
|
||||||
|
"name": "Nayam Amarshe",
|
||||||
|
"email": "nayam@amars.he",
|
||||||
|
"url": "https://github.com/NayamAmarshe"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "TGS963",
|
||||||
|
"email": "tgs@963.com",
|
||||||
|
"url": "https://github.com/TGS963"
|
||||||
|
}
|
||||||
|
],
|
||||||
"license": "GPLv2",
|
"license": "GPLv2",
|
||||||
"description": "Upscayl - Linux first image upscale app",
|
"description": "Upscayl - Free and Open Source AI Image Upscaler",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"AI",
|
||||||
|
"Upscaler",
|
||||||
|
"Image Upscale",
|
||||||
|
"Linux image upscale",
|
||||||
|
"Topaz Gigapixel",
|
||||||
"Linux",
|
"Linux",
|
||||||
"Gnome",
|
"KDE",
|
||||||
"Desktop",
|
"Gnome"
|
||||||
"Shortcut"
|
|
||||||
],
|
],
|
||||||
"main": "main/index.js",
|
"main": "main/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -29,12 +43,16 @@
|
|||||||
{
|
{
|
||||||
"from": "constants",
|
"from": "constants",
|
||||||
"to": "constants",
|
"to": "constants",
|
||||||
"filter": ["**/*"]
|
"filter": [
|
||||||
|
"**/*"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": "resources",
|
"from": "resources",
|
||||||
"to": "resources",
|
"to": "resources",
|
||||||
"filter": ["**/*"]
|
"filter": [
|
||||||
|
"**/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"linux": {
|
"linux": {
|
||||||
|
@ -5,9 +5,8 @@ import {
|
|||||||
ReactCompareSliderImage,
|
ReactCompareSliderImage,
|
||||||
} from "react-compare-slider";
|
} from "react-compare-slider";
|
||||||
|
|
||||||
import Animated from '../public/loading.svg'
|
import Animated from "../public/loading.svg";
|
||||||
import Image from 'next/image'
|
import Image from "next/image";
|
||||||
|
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const [imagePath, SetImagePath] = useState("");
|
const [imagePath, SetImagePath] = useState("");
|
||||||
@ -57,7 +56,8 @@ const Home = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const upscaylHandler = async () => {
|
const upscaylHandler = async () => {
|
||||||
setProgress("0.00%");
|
setUpscaledImagePath("");
|
||||||
|
setProgress("Hold on...");
|
||||||
await window.electron.send(commands.UPSCAYL, {
|
await window.electron.send(commands.UPSCAYL, {
|
||||||
scaleFactor,
|
scaleFactor,
|
||||||
imagePath,
|
imagePath,
|
||||||
@ -87,7 +87,6 @@ const Home = () => {
|
|||||||
Select Image
|
Select Image
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* STEP 2 */}
|
{/* STEP 2 */}
|
||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
<p className="font-medium text-neutral-100">Step 2</p>
|
<p className="font-medium text-neutral-100">Step 2</p>
|
||||||
@ -103,8 +102,7 @@ const Home = () => {
|
|||||||
<option value="realesrgan-x4plus-anime">Digital Image</option>
|
<option value="realesrgan-x4plus-anime">Digital Image</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
{/* STEP 3
|
||||||
{/* STEP 3 */}
|
|
||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
<p className="font-medium text-neutral-100">Step 3</p>
|
<p className="font-medium text-neutral-100">Step 3</p>
|
||||||
<p className="mb-2 text-sm text-neutral-400">Select Scale Factor</p>
|
<p className="mb-2 text-sm text-neutral-400">Select Scale Factor</p>
|
||||||
@ -134,11 +132,11 @@ const Home = () => {
|
|||||||
4x
|
4x
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
|
|
||||||
{/* STEP 4 */}
|
{/* STEP 4 */}
|
||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
<p className="font-medium text-neutral-100">Step 4</p>
|
<p className="font-medium text-neutral-100">Step 3</p>
|
||||||
<p className="mb-2 text-sm text-neutral-400">
|
<p className="mb-2 text-sm text-neutral-400">
|
||||||
Defaults to Image's path
|
Defaults to Image's path
|
||||||
</p>
|
</p>
|
||||||
@ -149,8 +147,7 @@ const Home = () => {
|
|||||||
Set Output Folder
|
Set Output Folder
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
{/* STEP 4 */}
|
||||||
{/* STEP 5 */}
|
|
||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
<p className="mb-2 font-medium text-neutral-100">Step 5</p>
|
<p className="mb-2 font-medium text-neutral-100">Step 5</p>
|
||||||
<button
|
<button
|
||||||
@ -231,7 +228,7 @@ const Home = () => {
|
|||||||
alt="Upscayl"
|
alt="Upscayl"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
className="h-full"
|
className="object-contain"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 934 KiB After Width: | Height: | Size: 1.6 MiB |
Loading…
x
Reference in New Issue
Block a user