-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinstall.js
202 lines (200 loc) · 6.93 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
const arm64 = require('./initialize-models-mac-arm64')
const nvidia = require('./initialize-models-nvidia')
const d = require('./initialize-models-default')
//const flux_full = require('./download-flux-schnell.json')
const flux = require('./download-flux-schnell-fp8.json')
const flux_merged = require('./download-flux-merged-fp8.json')
module.exports = async (kernel, info) => {
let run = [
// Edit this step to customize the git repository to use
{
method: "shell.run",
params: {
message: [
"git clone https://github.com/comfyanonymous/ComfyUI app",
"conda install -y conda-forge::huggingface_hub",
]
}
},
{
"method": "shell.run",
"params": {
"message": [
"git clone https://github.com/comfyanonymous/ComfyUI_examples"
],
"path": "workflows"
}
},
{
"method": "shell.run",
"params": {
"message": [
"git clone https://github.com/ltdrdata/ComfyUI-Manager",
],
"path": "app/custom_nodes"
}
},
// Delete this step if your project does not use torch
{
method: "script.start",
params: {
uri: "torch.js",
params: {
venv: "env", // Edit this to customize the venv folder path
path: "app", // Edit this to customize the path to start the shell from
// xformers: true // uncomment this line if your project requires xformers
}
}
},
// Edit this step with your custom install commands
{
method: "shell.run",
params: {
venv: "env", // Edit this to customize the venv folder path
path: "app", // Edit this to customize the path to start the shell from
message: [
"pip install -r requirements.txt",
"pip install -U bitsandbytes"
]
}
},
{
"method": "fs.link",
"params": {
"drive": {
"checkpoints": "app/models/checkpoints",
"clip": "app/models/clip",
"clip_vision": "app/models/clip_vision",
"configs": "app/models/configs",
"controlnet": "app/models/controlnet",
"embeddings": "app/models/embeddings",
"loras": "app/models/loras",
"upscale_models": "app/models/upscale_models",
"vae": "app/models/vae",
"vae_approx": "app/models/VAE-approx",
"diffusers": "app/models/diffusers",
"unet": "app/models/unet",
"hypernetworks": "app/models/hypernetworks",
"gligen": "app/models/gligen",
"style_models": "app/models/style_models",
"photomaker": "app/models/photomaker"
},
"peers": [
"https://github.com/cocktailpeanut/fluxgym.git",
"https://github.com/cocktailpeanutlabs/automatic1111.git",
"https://github.com/cocktailpeanutlabs/fooocus.git",
"https://github.com/cocktailpeanutlabs/comfyui.git",
"https://github.com/pinokiofactory/stable-diffusion-webui-forge.git"
]
}
},
{
"method": "fs.link",
"params": {
"drive": {
"output": "app/output"
}
}
},
{
"when": "{{['true', '1'].includes(String(env.FLUX_AUTODOWNLOAD).toLowerCase())}}",
"method": "script.start",
"params": {
"uri": "hf.json",
"params": {
"repo": "Comfy-Org/flux1-schnell",
"files": "flux1-schnell-fp8.safetensors",
"path": "app/models/checkpoints"
}
}
},
{
method: "shell.run",
params: {
venv: "env", // Edit this to customize the venv folder path
env: {
PYTORCH_ENABLE_MPS_FALLBACK: "1",
TOKENIZERS_PARALLELISM: "false"
}, // Edit this to customize environment variables (see documentation)
path: "app", // Edit this to customize the path to start the shell from
message: [
//"{{platform === 'win32' && gpu === 'amd' ? 'python main.py --directml --front-end-version Comfy-Org/[email protected]' : 'python main.py --front-end-version Comfy-Org/[email protected]'}}"
"{{platform === 'win32' && gpu === 'amd' ? 'python main.py --directml' : 'python main.py'}}"
],
on: [{
// The regular expression pattern to monitor.
// When this pattern occurs in the shell terminal, the shell will return,
// and the script will go onto the next step.
"event": "/http:\/\/[a-zA-Z0-9.]+:[0-9]+/",
// "done": true will move to the next step while keeping the shell alive.
// "kill": true will move to the next step after killing the shell.
"kill": true
}, {
"event": "/errno/i",
"break": false
}, {
"event": "/error:/i",
"break": false
}]
}
},
{
method: "shell.run",
params: {
message: [
"git clone https://github.com/comfyanonymous/ComfyUI_examples"
],
path: "app/user/default/workflows"
}
},
{
method: "shell.run",
params: {
message: [
"git clone https://github.com/cocktailpeanut/comfy_json_workflow"
],
path: "app/user/default/workflows"
}
}
]
//if (kernel.platform === "darwin") {
// run = run.concat(flux.run)
//} else {
// run = run.concat(flux_merged.run)
//}
// run = run.concat(flux.run)
// if (kernel.platform === 'darwin' && kernel.arch === "arm64") {
// run = run.concat(arm64.run)
// } else if (kernel.platform === 'darwin' && kernel.arch === "x64") {
// run = run.concat(arm64.run)
// //run = run.concat(d.run)
// } else if (kernel.gpu === 'nvidia') {
// run = run.concat(nvidia.run)
// } else {
// run = run.concat(d.run)
// }
// run = run.concat([
// {
// method: "shell.run",
// params: {
// venv: "env", // Edit this to customize the venv folder path
// env: { }, // Edit this to customize environment variables (see documentation)
// path: "app", // Edit this to customize the path to start the shell from
// message: [
// "{{platform === 'win32' && gpu === 'amd' ? 'python main.py --directml --front-end-version Comfy-Org/[email protected]' : 'python main.py --front-end-version Comfy-Org/[email protected]'}}"
// ],
// on: [{
// // The regular expression pattern to monitor.
// // When this pattern occurs in the shell terminal, the shell will return,
// // and the script will go onto the next step.
// "event": "/http:\/\/\\S+/",
//
// // "done": true will move to the next step while keeping the shell alive.
// // "kill": true will move to the next step after killing the shell.
// "done": true
// }]
// }
// },
// ])
return { run }
}