opencomic-ai-bin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +260 -0
- package/calculate-latency.mts +72 -0
- package/dist/calculate-latency.mjs +761 -0
- package/dist/index.cjs +714 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.mjs +712 -0
- package/index.mts +922 -0
- package/linux/arm64/realcugan/realcugan-ncnn-vulkan +0 -0
- package/linux/arm64/waifu2x/waifu2x-ncnn-vulkan +0 -0
- package/linux/x64/realcugan/realcugan-ncnn-vulkan +0 -0
- package/linux/x64/upscayl/upscayl-bin +0 -0
- package/linux/x64/waifu2x/waifu2x-ncnn-vulkan +0 -0
- package/mac/arm64/realcugan/realcugan-ncnn-vulkan.app +0 -0
- package/mac/arm64/upscayl/upscayl-bin.app +0 -0
- package/mac/arm64/waifu2x/waifu2x-ncnn-vulkan.app +0 -0
- package/mac/x64/realcugan/realcugan-ncnn-vulkan.app +0 -0
- package/mac/x64/upscayl/upscayl-bin.app +0 -0
- package/mac/x64/waifu2x/waifu2x-ncnn-vulkan.app +0 -0
- package/package.json +42 -0
- package/rollup.config.js +47 -0
- package/tsconfig.json +13 -0
- package/win/x64/realcugan/realcugan-ncnn-vulkan.exe +0 -0
- package/win/x64/realcugan/vcomp140.dll +0 -0
- package/win/x64/upscayl/upscayl-bin.exe +0 -0
- package/win/x64/waifu2x/vcomp140.dll +0 -0
- package/win/x64/waifu2x/waifu2x-ncnn-vulkan.exe +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
type Formats = 'bmp' | 'dib' | 'exr' | 'hdr' | 'jpe' | 'jpeg' | 'jpg' | 'pbm' | 'pgm' | 'pic' | 'png' | 'pnm' | 'ppm' | 'pxm' | 'ras' | 'sr' | 'tif' | 'tiff' | 'webp';
|
|
2
|
+
type ModelType = 'upscale' | 'descreen' | 'artifact-removal';
|
|
3
|
+
type Upscaler = 'realcugan' | 'waifu2x' | 'upscayl';
|
|
4
|
+
type Speed = 'Very Fast' | 'Fast' | 'Moderate' | 'Slow' | 'Very Slow';
|
|
5
|
+
interface UpscalerObject {
|
|
6
|
+
name: string;
|
|
7
|
+
binary: string;
|
|
8
|
+
platforms: Partial<Record<NodeJS.Platform, Partial<Record<NodeJS.Architecture, string>>>>;
|
|
9
|
+
}
|
|
10
|
+
interface ModelObject {
|
|
11
|
+
key?: Model;
|
|
12
|
+
name: string;
|
|
13
|
+
upscaler: Upscaler;
|
|
14
|
+
type?: ModelType;
|
|
15
|
+
scales: number[];
|
|
16
|
+
noise: number[] | undefined;
|
|
17
|
+
latency: number;
|
|
18
|
+
speed?: Speed;
|
|
19
|
+
folder: string;
|
|
20
|
+
path?: string;
|
|
21
|
+
files: string[];
|
|
22
|
+
supportCurrentPlatform?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare let models: Record<ModelType, Record<string, ModelObject>>;
|
|
25
|
+
type Model = keyof typeof models.upscale & keyof typeof models.descreen & keyof typeof models['artifact-removal'];
|
|
26
|
+
interface OpenComicAIOptions {
|
|
27
|
+
model?: Model;
|
|
28
|
+
noise?: 0 | 1 | 2 | 3;
|
|
29
|
+
scale?: number;
|
|
30
|
+
tileSize?: number;
|
|
31
|
+
gpuId?: string;
|
|
32
|
+
threads?: number;
|
|
33
|
+
tta?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface Downloading {
|
|
36
|
+
start?: () => void;
|
|
37
|
+
progress?: (progress: number) => void;
|
|
38
|
+
end?: () => void;
|
|
39
|
+
}
|
|
40
|
+
declare class OpenComicAI {
|
|
41
|
+
static models: Record<ModelType, Record<string, ModelObject>>;
|
|
42
|
+
static modelsList: string[];
|
|
43
|
+
static modelsTypeList: Record<ModelType, string[]>;
|
|
44
|
+
static modelsPath: string | undefined;
|
|
45
|
+
private static resolve;
|
|
46
|
+
static setModelsPath: (path: string) => void;
|
|
47
|
+
static model: (model?: Model) => ModelObject;
|
|
48
|
+
static binary: (model: Model) => string;
|
|
49
|
+
private static download;
|
|
50
|
+
private static getModels;
|
|
51
|
+
static pipeline: (source: string, dest: string, steps: OpenComicAIOptions[], progress?: ((progress?: number) => void) | false, downloading?: Downloading | false) => Promise<string>;
|
|
52
|
+
private static closest;
|
|
53
|
+
private static image;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { OpenComicAI as default };
|
|
57
|
+
export type { Downloading, Formats, Model, ModelObject, ModelType, OpenComicAIOptions, Speed, Upscaler, UpscalerObject };
|