mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-13 23:12:35 +08:00
create dir
This commit is contained in:
parent
0da6173268
commit
62e0102324
@ -1,6 +1,6 @@
|
|||||||
const { spawn } = require("child_process");
|
const { spawn } = require("child_process");
|
||||||
const { resolve } = require("path");
|
const { resolve } = require("path");
|
||||||
const { writeFile, existsSync } = require("fs");
|
const { existsSync, mkdirSync, writeFileSync } = require("fs");
|
||||||
const http = require("http");
|
const http = require("http");
|
||||||
|
|
||||||
async function setup() {
|
async function setup() {
|
||||||
@ -23,23 +23,17 @@ async function setup() {
|
|||||||
|
|
||||||
data = JSON.stringify(objectInfo, undefined, "\t");
|
data = JSON.stringify(objectInfo, undefined, "\t");
|
||||||
|
|
||||||
const outPath = resolve("./data/object_info.json")
|
const outDir = resolve("./data");
|
||||||
|
if (!existsSync(outDir)) {
|
||||||
|
mkdirSync(outDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
const outPath = resolve(outDir, "object_info.json");
|
||||||
console.log(`Writing ${Object.keys(objectInfo).length} nodes to ${outPath}`);
|
console.log(`Writing ${Object.keys(objectInfo).length} nodes to ${outPath}`);
|
||||||
writeFile(
|
writeFileSync(outPath, data, {
|
||||||
outPath,
|
encoding: "utf8",
|
||||||
data,
|
});
|
||||||
{
|
res();
|
||||||
encoding: "utf8",
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
if (err) {
|
|
||||||
rej(err);
|
|
||||||
} else {
|
|
||||||
console.log("Done!")
|
|
||||||
res();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.on("error", rej);
|
.on("error", rej);
|
||||||
@ -47,6 +41,7 @@ async function setup() {
|
|||||||
success = true;
|
success = true;
|
||||||
break;
|
break;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(i + "/30", error);
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
// 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...");
|
||||||
@ -62,8 +57,9 @@ async function setup() {
|
|||||||
args = ["main.py"];
|
args = ["main.py"];
|
||||||
cwd = "..";
|
cwd = "..";
|
||||||
}
|
}
|
||||||
|
args.push("--cpu");
|
||||||
console.log(python, ...args);
|
console.log(python, ...args);
|
||||||
child = spawn(python, [...args, "--cpu"], { cwd });
|
child = spawn(python, args, { cwd });
|
||||||
child.on("error", (err) => {
|
child.on("error", (err) => {
|
||||||
console.log(`Server error (${err})`);
|
console.log(`Server error (${err})`);
|
||||||
i = 30;
|
i = 30;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user