-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpinokio.js
136 lines (135 loc) · 4.71 KB
/
pinokio.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
const path = require('path')
module.exports = {
version: "2.0",
title: "Forge",
description: "[NVIDIA ONLY] The most efficient way to run FLUX (Optimized to run even on low memory machines, as low as 3GB VRAM with 512x512 resolution) https://github.com/lllyasviel/stable-diffusion-webui-forge",
icon: "icon.jpeg",
menu: async (kernel, info) => {
let installed = info.exists("app/venv")
let downloading = [
"download-xlabs.json",
"download-flux1-dev-nf4-v2.json",
"download-flux1-schnell-nf4.json",
"download-flux1-dev-fp8.json",
"download-sdxl.json",
"download-turbo.json",
"download-svd-xt-1.1.json",
"download-svd-xt.json",
"download-svd.json",
"download-lcm-lora.json",
"download-sd15.json",
"download-sd21.json",
"download.json"
]
let is_downloading = null
for(let item of downloading) {
let d = info.running(item)
if (d === true) {
is_downloading = item
break;
}
}
let running = {
install: info.running("install.js"),
start: info.running("start.js"),
update: info.running("update.js"),
reset: info.running("reset.js"),
}
if (running.install) {
return [{
default: true,
icon: "fa-solid fa-plug",
text: "Installing",
href: "install.js",
}]
} else if (installed) {
if (running.start) {
let local = info.local("start.js")
if (local && local.url) {
return [{
default: true,
icon: "fa-solid fa-rocket",
text: "Open Web UI",
href: local.url,
}, {
icon: 'fa-solid fa-terminal',
text: "Terminal",
href: "start.js",
}]
} else {
return [{
default: true,
icon: 'fa-solid fa-terminal',
text: "Terminal",
href: "start.js",
}]
}
} else if (is_downloading) {
return [{
default: true,
icon: 'fa-solid fa-terminal',
text: "Downloading",
href: is_downloading,
}]
} else if (running.update) {
return [{
default: true,
icon: 'fa-solid fa-terminal',
text: "Updating",
href: "update.js",
}]
} else if (running.reset) {
return [{
default: true,
icon: 'fa-solid fa-terminal',
text: "Resetting",
href: "reset.js",
}]
} else {
return [{
default: true,
icon: "fa-solid fa-power-off",
text: "Start",
href: "start.js",
}, {
icon: "fa-solid fa-download",
text: "Download Models",
menu: [
{ text: "Download by URL", icon: "fa-solid fa-download", href: "download.html?raw=true" },
{ text: "FLUX1-Dev-fp8", icon: "fa-solid fa-download", href: "download-flux1-dev-fp8.json", mode: "refresh" },
{ text: "FLUX1-Dev-nf4-v2", icon: "fa-solid fa-download", href: "download-flux1-dev-nf4-v2.json", mode: "refresh" },
{ text: "FLUX1-Schnell-nf4", icon: "fa-solid fa-download", href: "download-flux1-schnell-nf4.json", mode: "refresh" },
// { text: "XLabs Lora Collection", icon: "fa-solid fa-download", href: "download-xlabs.json", mode: "refresh" },
{ text: "SDXL", icon: "fa-solid fa-download", href: "download-sdxl.json", mode: "refresh" },
{ text: "SDXL Turbo", icon: "fa-solid fa-download", href: "download-turbo.json", mode: "refresh" },
{ text: "Stable Video XT 1.1", icon: "fa-solid fa-download", href: "download-svd-xt-1.1.json", mode: "refresh" },
{ text: "Stable Video XT", icon: "fa-solid fa-download", href: "download-svd-xt.json", mode: "refresh" },
{ text: "Stable Video", icon: "fa-solid fa-download", href: "download-svd.json", mode: "refresh" },
{ text: "LCM LoRA", icon: "fa-solid fa-download", href: "download-lcm-lora.json", mode: "refresh" },
{ text: "SD 1.5", icon: "fa-solid fa-download", href: "download-sd15.json", mode: "refresh" },
{ text: "SD 2.1", icon: "fa-solid fa-download", href: "download-sd21.json", mode: "refresh" },
]
}, {
icon: "fa-solid fa-plug",
text: "Update",
href: "update.js",
}, {
icon: "fa-solid fa-plug",
text: "Install",
href: "install.js",
}, {
icon: "fa-regular fa-circle-xmark",
text: "Reset",
href: "reset.js",
}]
}
} else {
return [{
default: true,
icon: "fa-solid fa-plug",
text: "Install",
href: "install.js",
}]
}
}
}