1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-11-23 23:21:05 +01:00

Fix models

This commit is contained in:
Nayam Amarshe 2024-10-30 19:03:41 +05:30
parent 773ca39daa
commit 6cfaf45b2a
30 changed files with 21 additions and 24 deletions

View File

@ -1,26 +1,26 @@
export const MODELS = {
"realesrgan-x4plus": {
id: "realesrgan-x4plus",
"upscayl-standard-4x": {
id: "upscayl-standard-4x",
name: "Upscayl Standard",
},
"realesrgan-x4fast": {
id: "realesrgan-x4fast",
"upscayl-lite-4x": {
id: "upscayl-lite-4x",
name: "Upscayl Lite",
},
remacri: {
id: "remacri",
id: "remacri-4x",
name: "Remacri (Non-Commercial)",
},
ultramix_balanced: {
id: "ultramix_balanced",
id: "ultramix-balanced-4x",
name: "Ultramix (Non-Commercial)",
},
ultrasharp: {
id: "ultrasharp",
id: "ultrasharp-4x",
name: "Ultrasharp (Non-Commercial)",
},
"realesrgan-x4plus-anime": {
id: "realesrgan-x4plus-anime",
"digital-art-4x": {
id: "digital-art-4x",
name: "Digital Art",
},
};

View File

@ -10,9 +10,9 @@ export const customModelsPathAtom = atomWithStorage<string | null>(
export const selectedModelIdAtom = atomWithStorage<ModelId | string>(
"selectedModelId",
"realesrgan-x4plus",
"upscayl-standard-4x",
);
export const doubleUpscaylAtom = atomWithStorage("selectedModelId", false);
export const doubleUpscaylAtom = atomWithStorage("doubleUpscayl", false);
export const gpuIdAtom = atomWithStorage("gpuId", "");
export const saveImageAsAtom = atomWithStorage<ImageFormat>(
"saveImageAs",

View File

@ -167,6 +167,8 @@ const MainContent = ({
e.preventDefault();
const items = e.clipboardData.items;
const files = e.clipboardData.files;
console.log("🚀 => files:", files);
if (items.length === 0 || files.length === 0) {
toast({
title: t("ERRORS.INVALID_IMAGE_ERROR.TITLE"),

View File

@ -28,10 +28,10 @@ import {
import { useToast } from "@/components/ui/use-toast";
import UpscaylSteps from "./upscayl-tab/upscayl-steps";
import SettingsTab from "./settings-tab";
import Footer from "../Footer";
import Footer from "../footer";
import { NewsModal } from "../news-modal";
import Tabs from "../Tabs";
import Header from "../Header";
import Tabs from "../tabs";
import Header from "../header";
import { ChevronLeftIcon } from "lucide-react";
import { logAtom } from "@/atoms/log-atom";
import { ELECTRON_COMMANDS } from "@common/electron-commands";
@ -90,15 +90,6 @@ const Sidebar = ({
const tileSize = useAtomValue(tileSizeAtom);
const [showSidebar, setShowSidebar] = useAtom(showSidebarAtom);
const handleModelChange = (e: any) => {
setSelectedModelId(e.value);
logit("🔀 Model changed: ", e.value);
localStorage.setItem(
"model",
JSON.stringify({ label: e.label, value: e.value }),
);
};
const upscaylHandler = async () => {
logit("🔄 Resetting Upscaled Image Path");
setUpscaledImagePath("");

View File

@ -18,11 +18,15 @@ import { customModelIdsAtom } from "@/atoms/models-list-atom";
export default function SelectModel() {
const [selectedModelId, setSelectedModelId] = useAtom(selectedModelIdAtom);
console.log("🚀 => selectedModelId:", selectedModelId);
const customModelIds = useAtomValue(customModelIdsAtom);
const [open, setOpen] = useState(false);
const [zoomedModel, setZoomedModel] = useState<ModelId | null>(null);
const handleModelSelect = (model: ModelId | string) => {
console.log("🚀 => model:", model);
setSelectedModelId(model);
setOpen(false);
};

View File

@ -176,7 +176,7 @@ function UpscaylSteps({
<p
className="cursor-pointer text-sm"
onClick={(e) => {
setDoubleUpscayl(!doubleUpscayl);
setDoubleUpscayl((prev) => !prev);
}}
>
{t("APP.DOUBLE_UPSCAYL.TITLE")}

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB