-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
90 lines (72 loc) · 2.31 KB
/
app.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
const express = require('express');
const { exec } = require('child_process');
const app = express();
const PORT = 8000;
app.use(express.static('public'));
app.get('/stop_a1111', (req, res) => {
exec('scripts/stop_a1111.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error stopping A1111: ${error}`);
}
});
res.send('Stopped A1111 successfully!');
});
app.get('/start_a1111', (req, res) => {
exec('scripts/start_a1111.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error starting A1111: ${error}`);
}
});
res.send('Started A1111 successfully!');
});
app.get('/stop_kohya', (req, res) => {
exec('scripts/stop_kohya.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error stopping Kohya_ss: ${error}`);
}
});
res.send('Stopped Kohya_ss successfully!');
});
app.get('/start_kohya', (req, res) => {
exec('scripts/start_kohya.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error starting Kohya_ss: ${error}`);
}
});
res.send('Started Kohya_ss successfully!');
});
app.get('/stop_comfyui', (req, res) => {
exec('scripts/stop_comfyui.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error stopping ComfyUI: ${error}`);
}
});
res.send('Stopped ComfyUI successfully!');
});
app.get('/start_comfyui', (req, res) => {
exec('scripts/start_comfyui.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error starting ComfyUI: ${error}`);
}
});
res.send('Started ComfyUI successfully!');
});
app.get('/stop_invokeai', (req, res) => {
exec('scripts/stop_invokeai.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error stopping InvokeAI: ${error}`);
}
});
res.send('Stopped InvokeAI successfully!');
});
app.get('/start_invokeai', (req, res) => {
exec('scripts/start_invokeai.sh &', (error, stdout, stderr) => {
if (error) {
console.error(`Error starting InvokeAI: ${error}`);
}
});
res.send('Started InvokeAI successfully!');
});
app.listen(PORT, '0.0.0.0', () => {
console.log(`Server is running on http://0.0.0.0:${PORT}`);
});