-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.js
114 lines (113 loc) · 3.62 KB
/
install.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
const path = require("path")
const os = require('os')
module.exports = async (kernel) => {
const platform = os.platform()
const graphics = await kernel.system.graphics()
const vendor = graphics.controllers[0].vendor
let setup
if (platform === "darwin") {
setup = [{
method: "shell.run",
params: { message: "brew install cmake protobuf rust [email protected] git wget", },
//params: { message: "brew install protobuf rust wget", },
}, {
method: "shell.run",
params: { message: "git clone https://github.com/vladmandic/automatic automatic", path: path.resolve(__dirname) },
}]
} else {
if (/amd/i.test(vendor)) {
if (platform === 'win32') {
setup = [{
method: "shell.run",
params: { message: "git clone https://github.com/vladmandic/automatic automatic", path: path.resolve(__dirname) },
}]
} else {
setup = [{
method: "shell.run",
params: { message: "git clone https://github.com/vladmandic/automatic automatic", path: path.resolve(__dirname) },
}]
}
} else {
setup = [{
method: "shell.run",
params: { message: "git clone https://github.com/vladmandic/automatic automatic", path: path.resolve(__dirname) },
}]
}
}
let run = setup.concat([{
"uri": "./index.js",
"method": "config",
}, {
"method": "self.set",
"params": {
"automatic/ui-config.json": {
"txt2img/Width/value": 1024,
"txt2img/Height/value": 1024,
}
}
}, {
"method": "notify",
"params": {
"html": "<b>Downloading Model</b><br>Downloading the Stable Diffusion XL 1.0 model..."
}
}, {
"method": "fs.download",
"params": {
"url": "https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors",
"path": "automatic/models/Stable-diffusion/sd_xl_base_1.0.safetensors"
}
}, {
"method": "fs.download",
"params": {
"url": "https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/resolve/main/sd_xl_refiner_1.0.safetensors",
"path": "automatic/models/Stable-diffusion/sd_xl_refiner_1.0.safetensors"
}
// }, {
// "method": "fs.download",
// "params": {
// //"url": "https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/resolve/main/sdxl_vae.safetensors",
// //"path": "automatic/models/Stable-diffusion/sd_xl_base_0.9.vae.safetensors"
// "url": "https://huggingface.co/stabilityai/sdxl-vae/blob/main/sdxl_vae.safetensors",
// "path": "automatic/models/Stable-diffusion/sd_xl_base_1.0.vae.safetensors"
// }
}, {
"method": "notify",
"params": {
"html": "<b>Installing webui</b><br>All SDXL 1.0 models downloaded successfully. Now setting up Automatic/stable-diffusion-webui..."
}
}, {
"method": "shell.start",
"params": {
"path": "automatic",
"env": {
"HF_HOME": "../huggingface"
},
}
}, {
"method": "shell.enter",
"params": {
"message": "{{os.platform() === 'win32' ? 'webui.bat' : 'bash webui.sh -f'}}",
"on": [{
"event": "/(http:\/\/[0-9.:]+)/",
"return": "{{event.matches[0][1]}}"
}]
}
}, {
"method": "local.set",
"params": {
"url": "{{input}}"
}
}, {
"method": "input",
"params": {
"title": "Install Success",
"description": "Go back to the dashboard and launch the app!"
}
}, {
"method": "browser.open",
"params": {
"uri": "/?selected=Stable Diffusion web UI"
}
}])
return { run }
}