MCPcopy Create free account
hub / github.com/6174/comflowyspace / start

Function start

apps/node/src/modules/shell/test-shell.ts:9–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7import { conda } from "../utils/conda";
8
9async function start() {
10 const { PIP_PATH, PYTHON_PATH, CONDA_SCRIPTS_PATH, CONDA_ENV_PATH } = conda.getCondaPaths();
11
12 try {
13 logger.info("start ");
14 const repoPath = getComfyUIDir();
15 const shell = isWindows ? 'cmd' : '/bin/bash';
16 const command = PYTHON_PATH;
17 const args = ['main.py', '--enable-cors-header'];
18
19 const proc = spawn(command, args, {
20 cwd: repoPath,
21 env: {
22 PATH: getSystemPath({
23 CONDA_SCRIPTS_PATH,
24 CONDA_ENV_PATH
25 })
26 },
27 shell
28 });
29
30 proc.stdout.on('data', (data) => {
31 logger.info(`stdout: ${data}`);
32 });
33
34 proc.stderr.on('data', (data) => {
35 console.error(`stderr: ${data}`);
36 });
37
38 proc.on('close', (code) => {
39 logger.info(`child process exited with code ${code}`);
40 });
41
42 } catch (err: any) {
43 throw new Error(`Start ComfyUI error: ${err.message}`);
44 }
45}
46
47start();

Callers 1

test-shell.tsFile · 0.85

Calls 4

getComfyUIDirFunction · 0.90
getSystemPathFunction · 0.90
getCondaPathsMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected