fix python

This commit is contained in:
pythongosssss 2023-10-20 18:40:40 +01:00
parent 57d1bba5eb
commit e09c8a351f
2 changed files with 57 additions and 53 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ venv/
/web/extensions/* /web/extensions/*
!/web/extensions/logging.js.example !/web/extensions/logging.js.example
!/web/extensions/core/ !/web/extensions/core/
/tests-ui/data/object_info.json

View File

@ -1,6 +1,6 @@
const { spawn } = require("child_process"); const { spawn } = require("child_process");
const { resolve } = require("path"); const { resolve } = require("path");
const { writeFile } = require("fs"); const { writeFile, existsSync } = require("fs");
const http = require("http"); const http = require("http");
async function setup() { async function setup() {
@ -49,7 +49,10 @@ const http = require("http");
// Start the server on first iteration if it fails to connect // Start the server on first iteration if it fails to connect
console.log("Starting ComfyUI server..."); console.log("Starting ComfyUI server...");
const python = resolve("../../python_embeded/python.exe"); let python = resolve("../../python_embeded/python.exe");
if (!existsSync(python)) {
python = "python";
}
child = spawn(python, ["-s", "ComfyUI/main.py", "--cpu"], { cwd: "../.." }); child = spawn(python, ["-s", "ComfyUI/main.py", "--cpu"], { cwd: "../.." });
} }
await new Promise((r) => { await new Promise((r) => {