mirror of
https://github.com/upscayl/upscayl.git
synced 2025-01-23 22:54:12 +01:00
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import { ImageFormat } from "@/lib/valid-formats";
|
|
import { ModelId } from "@common/models-list";
|
|
import { atom } from "jotai";
|
|
import { atomWithStorage } from "jotai/utils";
|
|
|
|
export const customModelsPathAtom = atomWithStorage<string | null>(
|
|
"customModelsPath",
|
|
null,
|
|
);
|
|
|
|
export const selectedModelIdAtom = atomWithStorage<ModelId | string>(
|
|
"selectedModelId",
|
|
"upscayl-standard-4x",
|
|
);
|
|
export const doubleUpscaylAtom = atomWithStorage("doubleUpscayl", false);
|
|
export const gpuIdAtom = atomWithStorage("gpuId", "");
|
|
export const saveImageAsAtom = atomWithStorage<ImageFormat>(
|
|
"saveImageAs",
|
|
"png",
|
|
);
|
|
|
|
export const scaleAtom = atomWithStorage<string>("scale", "4");
|
|
|
|
export const batchModeAtom = atom<boolean>(false);
|
|
|
|
/**
|
|
* The path to the last folder the user saved an image to.
|
|
* Reset to "" if rememberOutputFolder is false.
|
|
*/
|
|
export const savedOutputPathAtom = atomWithStorage<string | null>(
|
|
"savedOutputPath",
|
|
null,
|
|
);
|
|
|
|
export const progressAtom = atom<string>("");
|
|
|
|
export const rememberOutputFolderAtom = atomWithStorage<boolean>(
|
|
"rememberOutputFolder",
|
|
false,
|
|
);
|
|
|
|
export const dontShowCloudModalAtom = atomWithStorage<boolean>(
|
|
"dontShowCloudModal",
|
|
false,
|
|
);
|
|
|
|
export const noImageProcessingAtom = atomWithStorage<boolean>(
|
|
"noImageProcessing",
|
|
false,
|
|
);
|
|
|
|
export const compressionAtom = atomWithStorage<number>("compression", 0);
|
|
|
|
export const overwriteAtom = atomWithStorage("overwrite", false);
|
|
|
|
export const turnOffNotificationsAtom = atomWithStorage(
|
|
"turnOffNotifications",
|
|
false,
|
|
);
|
|
|
|
export const viewTypeAtom = atomWithStorage<"slider" | "lens">(
|
|
"viewType",
|
|
"slider",
|
|
);
|
|
|
|
export const lensSizeAtom = atomWithStorage<number>("lensSize", 100);
|
|
|
|
export const customWidthAtom = atomWithStorage<number>("customWidth", 0);
|
|
|
|
export const useCustomWidthAtom = atomWithStorage<boolean>(
|
|
"useCustomWidth",
|
|
false,
|
|
);
|
|
|
|
export const tileSizeAtom = atomWithStorage<number | null>("tileSize", null);
|
|
|
|
// CLIENT SIDE ONLY
|
|
export const showSidebarAtom = atomWithStorage("showSidebar", true);
|