-
Notifications
You must be signed in to change notification settings - Fork 0
/
pinokio.js
79 lines (79 loc) · 3.11 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
const path = require('path')
const execSync = require('child_process').execSync
module.exports = {
version: "1.2",
title: "Re-Forge",
description: "Stable Diffusion WebUI Forge is a platform on top of Stable Diffusion WebUI (based on Gradio) to make development easier, optimize resource management, and speed up inference. https://github.com/Panchovix/stable-diffusion-webui-reForge",
icon: "icon.jpeg",
menu: async (kernel) => {
let installed = await kernel.exists(__dirname, "app", "venv")
let installing = kernel.running(__dirname, "install.js")
if (installing) {
return [{ icon: "fa-solid fa-plug", text: "Installing", href: "install.js" }]
} else if (installed) {
let running = kernel.running(__dirname, "start.js")
let arr
if (running) {
let local = kernel.memory.local[path.resolve(__dirname, "start.js")]
if (local && local.url) {
arr = [{
icon: "fa-solid fa-rocket",
text: "Open Web UI",
href: local.url
}, {
icon: "fa-solid fa-desktop",
text: "Terminal",
href: "start.js"
}]
} else {
arr = [{
icon: "fa-solid fa-desktop",
text: "Terminal",
href: "start.js"
}]
}
} else {
arr = [{
icon: "fa-solid fa-rocket",
text: "Start",
href: "start.js"
}]
}
arr = arr.concat([{
icon: "fa-solid fa-download",
text: "Download Models",
menu: [
{ text: "Download by URL", icon: "fa-solid fa-download", href: "download.html?raw=true" },
{ 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-rotate", text: "Update", href: "update.json"
}, {
icon: "fa-solid fa-plug", text: "Reinstall", href: "install.js"
}])
if (!running) {
arr.push({
icon: "fa-solid fa-circle-xmark", text: "Reset", href: "reset.json", confirm: "Are you sure you wish to reset the app?"
})
}
return arr
} else {
return [{
icon: "fa-solid fa-plug",
text: "Install",
href: "install.js"
}, {
icon: "fa-solid fa-rotate",
text: "Update",
href: "update.json"
}]
}
}
}