forked from pinokiofactory/comfy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.js
More file actions
77 lines (74 loc) · 2.1 KB
/
Copy pathstart.js
File metadata and controls
77 lines (74 loc) · 2.1 KB
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
module.exports = {
requires: {
bundle: "ai",
},
daemon: true,
run: [
// [index 0] Start ComfyUI
{
"id": "start_comfyui",
method: "shell.run",
params: {
venv: "env",
env: {
PYTORCH_ENABLE_MPS_FALLBACK: "1",
TOKENIZERS_PARALLELISM: "false"
},
path: "app",
message: [
"{{platform === 'win32' && gpu === 'amd' ? 'python main.py --directml' : 'python main.py'}}"
],
on: [{
"event": "/To see the GUI go to: +(http:\/\/[a-zA-Z0-9.]+:[0-9]+)/i",
"done": true
}, {
// kill: true ensures ComfyUI is fully terminated before we jump back to restart after manager installs custom nodes
"event": "/\\[ComfyUI-Manager\\] Restarting to reapply dependency installation/",
"kill": true
}, {
"event": "/errno/i",
"break": false
}, {
"event": "/error:/i",
"break": false
}]
}
},
// [index 1] Single conditional jump — routes to set_url on normal startup,
// or to manager_restart when Manager killed ComfyUI for dep installation.
// input.event[1] contains the URL on normal startup; absent on Manager restart.
// Pass the URL through jump params since jump resets input.
{
method: "jump",
params: {
id: "{{input.event && input.event[1] ? 'set_url' : 'manager_restart'}}",
params: {
url: "{{input.event && input.event[1] ? input.event[1] : ''}}"
}
}
},
// [index 2] Manager restart path
{
"id": "manager_restart",
method: "notify",
params: {
html: "<b>✅ ComfyUI Manager installed new dependencies</b><br>Restarting ComfyUI to apply them — this will take a moment.",
type: "info"
}
},
{
method: "jump",
params: {
id: "start_comfyui"
}
},
// [index 4] Normal startup — set the URL for the Open WebUI button
{
"id": "set_url",
method: "local.set",
params: {
url: "http://localhost:8188"
}
}
]
}