comfy-ts 2.4.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { _ as lmModelName, h as fetchLoraList, l as buildLoraMirror, m as writeLoraMirror, p as readLoraMirror, v as lmTrainedWords } from "./DefinedWorkflow-QrhT6V66.js";
3
- import { o as ComfySchema, r as readableStringify, t as ComfyTS } from "./state-BbKuSDCV.js";
3
+ import { o as ComfySchema, r as readableStringify, t as ComfyTS } from "./state-C0ARiFFM.js";
4
4
  import { spawnSync } from "node:child_process";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
@@ -272,7 +272,7 @@ async function main() {
272
272
  const { runServe } = await import("./run-serve-C9E8dyLP.js");
273
273
  return runServe(rest);
274
274
  }
275
- const { runTui } = await import("./run-tui-cawSJuuh.js");
275
+ const { runTui } = await import("./run-tui-8si-rVW0.js");
276
276
  return runTui(rest);
277
277
  }
278
278
  console.log(HELP);
package/dist/index.cjs CHANGED
@@ -134,7 +134,7 @@ function createNodeStorage() {
134
134
  }
135
135
  //#endregion
136
136
  //#region package.json
137
- var version = "2.4.0";
137
+ var version = "2.4.1";
138
138
  //#endregion
139
139
  //#region src/litegraph/LiteGraphLinkID.ts
140
140
  const asLiteGraphLinkID = (id) => id;
@@ -3838,6 +3838,7 @@ var ResilientWebSocketClient = class {
3838
3838
  this.messageBuffer = [];
3839
3839
  this.isOpen = false;
3840
3840
  this.debugMessages = [];
3841
+ this.hasEverOpened = false;
3841
3842
  this.permanentlyClosed = false;
3842
3843
  this.url = options.url();
3843
3844
  this.connect();
@@ -3889,6 +3890,7 @@ var ResilientWebSocketClient = class {
3889
3890
  ws.onopen = () => {
3890
3891
  if (ws !== this.currentWS) return;
3891
3892
  this.addInfo("✅ WebSocket connected to " + this.url);
3893
+ this.hasEverOpened = true;
3892
3894
  this.isOpen = true;
3893
3895
  this.options.onConnectOrReconnect();
3894
3896
  this.flushMessageBuffer();
@@ -3899,6 +3901,11 @@ var ResilientWebSocketClient = class {
3899
3901
  this.options.onClose();
3900
3902
  if (this.permanentlyClosed) return;
3901
3903
  this.addError(`WebSocket closed (reason=${JSON.stringify(event.reason)}, code=${event.code})`);
3904
+ if (!this.hasEverOpened && this.options.onFirstConnectFailed != null) {
3905
+ this.permanentlyClosed = true;
3906
+ this.options.onFirstConnectFailed(/* @__PURE__ */ new Error(`connection refused (code=${event.code}${event.reason === "" ? "" : `, ${event.reason}`})`));
3907
+ return;
3908
+ }
3902
3909
  this.addInfo("⏱️ reconnecting in 2 seconds...");
3903
3910
  this.reconnectTimeout = setTimeout(() => void this.connect(), 2e3);
3904
3911
  };
@@ -5212,6 +5219,7 @@ var ComfyHost = class {
5212
5219
  url: () => this.getWSUrl(),
5213
5220
  headers: () => this.authHeaders(),
5214
5221
  onTransportDead: (e) => this.markFailed(e),
5222
+ onFirstConnectFailed: (e) => this.markFailed(new ComfyHostUnreachableError(`host '${this.data.id}' is not reachable at ${this.getWSUrl()} — ${extractErrorMessage(e)}. Is ComfyUI running there ?`)),
5215
5223
  onClose: () => {
5216
5224
  logInfo(`[👢] WEBSOCKET: closed connection to ComfyUI host ${this.data.id}`);
5217
5225
  }