comfy-ts 2.18.1 → 2.20.0
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/README.md +147 -97
- package/claude-code/.claude-plugin/plugin.json +9 -0
- package/claude-code/skills/convert/SKILL.md +25 -0
- package/claude-code/skills/guide/SKILL.md +21 -0
- package/claude-code/skills/run/SKILL.md +12 -0
- package/claude-code/skills/setup/SKILL.md +15 -0
- package/claude-code/skills/workflow/SKILL.md +19 -0
- package/dist/{ServeApp-qXcQfdgT.js → ServeApp-B469W26E.js} +5 -5
- package/dist/{ServeApp-qXcQfdgT.js.map → ServeApp-B469W26E.js.map} +1 -1
- package/dist/cli.js +228 -11
- package/dist/cli.js.map +1 -1
- package/dist/{state-C067Kbew.js → exampleAssets-j1f26nGc.js} +177 -56
- package/dist/{state-C067Kbew.js.map → exampleAssets-j1f26nGc.js.map} +1 -1
- package/dist/{findDefinedWorkflow-0lG-VTEd.js → findDefinedWorkflow-B90-xFxX.js} +2 -2
- package/dist/{findDefinedWorkflow-0lG-VTEd.js.map → findDefinedWorkflow-B90-xFxX.js.map} +1 -1
- package/dist/index.cjs +92 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +92 -10
- package/dist/index.js.map +1 -1
- package/dist/{run-run-Zr699h2S.js → run-run-QEoh7Wbh.js} +5 -6
- package/dist/{run-run-Zr699h2S.js.map → run-run-QEoh7Wbh.js.map} +1 -1
- package/dist/{run-serve-DaXzoVTS.js → run-serve-CsEYPGm9.js} +4 -4
- package/dist/{run-serve-DaXzoVTS.js.map → run-serve-CsEYPGm9.js.map} +1 -1
- package/dist/{run-tui-CeM1GOJP.js → run-tui-YxiSoNvK.js} +9 -15
- package/dist/run-tui-YxiSoNvK.js.map +1 -0
- package/dist/{schemaDrift-CbsABBuk.js → schemaDrift-DaWsE-mt.js} +15 -15
- package/dist/{schemaDrift-CbsABBuk.js.map → schemaDrift-DaWsE-mt.js.map} +1 -1
- package/dist/web.d.ts +30 -20
- package/dist/web.js +83 -6
- package/dist/web.js.map +1 -1
- package/examples/README.md +17 -11
- package/examples/rvion/01-txt2img.cflow.ts +1 -1
- package/examples/rvion/02-img2img-upload.cflow.ts +1 -1
- package/examples/rvion/03-export-workflow-json.cflow.ts +1 -1
- package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +1 -1
- package/examples/rvion/06-qwen-image-edit.cflow.ts +1 -1
- package/examples/rvion/07-local-llm-text-gen.cflow.ts +1 -1
- package/examples/rvion/08-qwen-image-21-t2i.cflow.ts +1 -1
- package/examples/rvion/09-qwen-image-21-edit.cflow.ts +1 -1
- package/examples/rvion/10-anima-t2i.cflow.ts +1 -1
- package/examples/rvion/11-yue2-t2a.cflow.ts +1 -1
- package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +1 -1
- package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +1 -1
- package/examples/rvion/14-video-soundtrack.cflow.ts +1 -1
- package/examples/rvion/15-tts-voice-clone.cflow.ts +1 -1
- package/examples/rvion/16-tts-voice-design.cflow.ts +1 -1
- package/guide-for-agents.md +8 -5
- package/package.json +8 -7
- package/src/cli/comfy-ts-cli.ts +12 -2
- package/src/cli/gen.ts +6 -1
- package/src/cli/serve/ServeApp.ts +4 -4
- package/src/cli/serve/web/api.ts +1 -1
- package/src/cli/skill.ts +207 -0
- package/src/cli/tui/components/Header.tsx +1 -4
- package/src/cli/tui/components/HostPanel.tsx +1 -4
- package/src/cli/tui/state/HostSt.ts +2 -2
- package/src/exampleAssets.ts +10 -4
- package/src/host/ComfyHost.ts +35 -5
- package/src/host/hostFile.ts +57 -0
- package/src/state.ts +15 -9
- package/dist/exampleAssets-BfWzygoM.js +0 -38
- package/dist/exampleAssets-BfWzygoM.js.map +0 -1
- package/dist/run-tui-CeM1GOJP.js.map +0 -1
package/dist/web.d.ts
CHANGED
|
@@ -12262,16 +12262,9 @@ declare const types$1: import("arktype").Module<{
|
|
|
12262
12262
|
};
|
|
12263
12263
|
PromptID: PromptID;
|
|
12264
12264
|
PromptRelated_WsMsg: {
|
|
12265
|
-
type: "
|
|
12266
|
-
data: {
|
|
12267
|
-
value: number;
|
|
12268
|
-
max: number;
|
|
12269
|
-
};
|
|
12270
|
-
} | {
|
|
12271
|
-
type: "executing";
|
|
12265
|
+
type: "execution_start";
|
|
12272
12266
|
data: {
|
|
12273
12267
|
prompt_id: PromptID;
|
|
12274
|
-
node?: ComfyNodeId | null | undefined;
|
|
12275
12268
|
};
|
|
12276
12269
|
} | {
|
|
12277
12270
|
type: "execution_cached";
|
|
@@ -12280,9 +12273,16 @@ declare const types$1: import("arktype").Module<{
|
|
|
12280
12273
|
prompt_id: PromptID;
|
|
12281
12274
|
};
|
|
12282
12275
|
} | {
|
|
12283
|
-
type: "
|
|
12276
|
+
type: "executing";
|
|
12284
12277
|
data: {
|
|
12285
12278
|
prompt_id: PromptID;
|
|
12279
|
+
node?: ComfyNodeId | null | undefined;
|
|
12280
|
+
};
|
|
12281
|
+
} | {
|
|
12282
|
+
type: "progress";
|
|
12283
|
+
data: {
|
|
12284
|
+
value: number;
|
|
12285
|
+
max: number;
|
|
12286
12286
|
};
|
|
12287
12287
|
} | {
|
|
12288
12288
|
type: "progress_state";
|
|
@@ -12361,16 +12361,9 @@ declare const types$1: import("arktype").Module<{
|
|
|
12361
12361
|
data: string;
|
|
12362
12362
|
};
|
|
12363
12363
|
WsMsg: {
|
|
12364
|
-
type: "
|
|
12365
|
-
data: {
|
|
12366
|
-
value: number;
|
|
12367
|
-
max: number;
|
|
12368
|
-
};
|
|
12369
|
-
} | {
|
|
12370
|
-
type: "executing";
|
|
12364
|
+
type: "execution_start";
|
|
12371
12365
|
data: {
|
|
12372
12366
|
prompt_id: PromptID;
|
|
12373
|
-
node?: ComfyNodeId | null | undefined;
|
|
12374
12367
|
};
|
|
12375
12368
|
} | {
|
|
12376
12369
|
type: "execution_cached";
|
|
@@ -12379,9 +12372,16 @@ declare const types$1: import("arktype").Module<{
|
|
|
12379
12372
|
prompt_id: PromptID;
|
|
12380
12373
|
};
|
|
12381
12374
|
} | {
|
|
12382
|
-
type: "
|
|
12375
|
+
type: "executing";
|
|
12383
12376
|
data: {
|
|
12384
12377
|
prompt_id: PromptID;
|
|
12378
|
+
node?: ComfyNodeId | null | undefined;
|
|
12379
|
+
};
|
|
12380
|
+
} | {
|
|
12381
|
+
type: "progress";
|
|
12382
|
+
data: {
|
|
12383
|
+
value: number;
|
|
12384
|
+
max: number;
|
|
12385
12385
|
};
|
|
12386
12386
|
} | {
|
|
12387
12387
|
type: "progress_state";
|
|
@@ -17698,8 +17698,18 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17698
17698
|
/** the schema instance with all methods to interract with the host schema */
|
|
17699
17699
|
schema: ComfySchema;
|
|
17700
17700
|
uploader: ComfyUploader;
|
|
17701
|
-
/** parsed ONCE from data (url-first
|
|
17702
|
-
|
|
17701
|
+
/** parsed ONCE from data (url-first, legacy host/port/https, or the address `gen` saved for
|
|
17702
|
+
* the id alone): the url ground truth. Throws the noAddress text when there is none */
|
|
17703
|
+
get base(): ParsedHostBase;
|
|
17704
|
+
private _base;
|
|
17705
|
+
/** why the id alone found no saved address; null when the host has one. An import stays safe
|
|
17706
|
+
* (like a missing schema cache): the error is logged once, then thrown at first use */
|
|
17707
|
+
noAddress: string | null;
|
|
17708
|
+
/** `host:port` for labels, or a short note when there is no address; never throws */
|
|
17709
|
+
get addressLabel(): string;
|
|
17710
|
+
/** read again at each use until found: a `comfy-ts gen` run after the import (a TUI or a
|
|
17711
|
+
* serve that stays up) makes the host usable without a restart */
|
|
17712
|
+
private readSavedAddress;
|
|
17703
17713
|
constructor(data: ComfyHostData & {
|
|
17704
17714
|
id: ID;
|
|
17705
17715
|
});
|
package/dist/web.js
CHANGED
|
@@ -101,7 +101,7 @@ function getComfyStorage() {
|
|
|
101
101
|
}
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region package.json
|
|
104
|
-
var version = "2.
|
|
104
|
+
var version = "2.20.0";
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/litegraph/LiteGraphLinkID.ts
|
|
107
107
|
const asLiteGraphLinkID = (id) => id;
|
|
@@ -5040,6 +5040,54 @@ function renderPort(p) {
|
|
|
5040
5040
|
return p.port === schemeDefault ? "" : `:${p.port}`;
|
|
5041
5041
|
}
|
|
5042
5042
|
//#endregion
|
|
5043
|
+
//#region src/host/hostFile.ts
|
|
5044
|
+
const HOST_FILE_NAME = "host.json";
|
|
5045
|
+
/** true when the caller gave no address at all: the id alone asks for the saved one */
|
|
5046
|
+
function namesNoAddress(p) {
|
|
5047
|
+
return p.url == null && p.host == null && p.port == null && p.https == null;
|
|
5048
|
+
}
|
|
5049
|
+
function hostFilePath(hostFolder) {
|
|
5050
|
+
return join(hostFolder, HOST_FILE_NAME);
|
|
5051
|
+
}
|
|
5052
|
+
/** the saved address of `id`, parsed; when there is none, the error text names the command that writes it */
|
|
5053
|
+
function readHostFile(storage, hostFolder, id) {
|
|
5054
|
+
const path = hostFilePath(hostFolder);
|
|
5055
|
+
const gen = `\`comfy-ts gen --host <url> --id ${id}\``;
|
|
5056
|
+
const text = storage.readTextIfExists(path);
|
|
5057
|
+
if (text == null) return {
|
|
5058
|
+
base: null,
|
|
5059
|
+
error: `host '${id}': no address given and no ${path}. ${storage.kind === "node" ? `run ${gen} once from this project (it saves the address), or pass the address: host({ id: '${id}', url: '<url>' })` : `this runtime has no saved hosts (${storage.kind} storage): pass the address, host({ id: '${id}', url: '<url>' })`}`
|
|
5060
|
+
};
|
|
5061
|
+
let json;
|
|
5062
|
+
try {
|
|
5063
|
+
json = JSON.parse(text);
|
|
5064
|
+
} catch {
|
|
5065
|
+
return {
|
|
5066
|
+
base: null,
|
|
5067
|
+
error: `host '${id}': ${path} is not valid json. Write it again with ${gen}`
|
|
5068
|
+
};
|
|
5069
|
+
}
|
|
5070
|
+
const url = json != null && typeof json === "object" && "url" in json ? json.url : null;
|
|
5071
|
+
if (typeof url !== "string" || url === "") return {
|
|
5072
|
+
base: null,
|
|
5073
|
+
error: `host '${id}': ${path} has no "url" string. Write it again with ${gen}`
|
|
5074
|
+
};
|
|
5075
|
+
try {
|
|
5076
|
+
return {
|
|
5077
|
+
base: parseHostBase({
|
|
5078
|
+
id,
|
|
5079
|
+
url
|
|
5080
|
+
}),
|
|
5081
|
+
error: null
|
|
5082
|
+
};
|
|
5083
|
+
} catch (e) {
|
|
5084
|
+
return {
|
|
5085
|
+
base: null,
|
|
5086
|
+
error: `${extractErrorMessage(e)} (read from ${path})`
|
|
5087
|
+
};
|
|
5088
|
+
}
|
|
5089
|
+
}
|
|
5090
|
+
//#endregion
|
|
5043
5091
|
//#region src/host/ResilientWebsocket.ts
|
|
5044
5092
|
let transportPromise = null;
|
|
5045
5093
|
/** node: the ws package (headers on the upgrade). browser: native WebSocket. */
|
|
@@ -6772,9 +6820,30 @@ var ComfyHostAuthError = class extends Error {
|
|
|
6772
6820
|
}
|
|
6773
6821
|
};
|
|
6774
6822
|
var ComfyHost = class {
|
|
6823
|
+
/** parsed ONCE from data (url-first, legacy host/port/https, or the address `gen` saved for
|
|
6824
|
+
* the id alone): the url ground truth. Throws the noAddress text when there is none */
|
|
6825
|
+
get base() {
|
|
6826
|
+
this.readSavedAddress();
|
|
6827
|
+
if (this._base == null) throw new Error(this.noAddress ?? `host '${this.data.id}': no address`);
|
|
6828
|
+
return this._base;
|
|
6829
|
+
}
|
|
6830
|
+
/** `host:port` for labels, or a short note when there is no address; never throws */
|
|
6831
|
+
get addressLabel() {
|
|
6832
|
+
return this._base == null ? "no saved address" : `${this._base.host}:${this._base.port}`;
|
|
6833
|
+
}
|
|
6834
|
+
/** read again at each use until found: a `comfy-ts gen` run after the import (a TUI or a
|
|
6835
|
+
* serve that stays up) makes the host usable without a restart */
|
|
6836
|
+
readSavedAddress() {
|
|
6837
|
+
if (this._base != null || !namesNoAddress(this.data)) return;
|
|
6838
|
+
const saved = readHostFile(getComfyStorage(), this.cacheFolder, this.data.id);
|
|
6839
|
+
this._base = saved.base;
|
|
6840
|
+
this.noAddress = saved.error;
|
|
6841
|
+
}
|
|
6775
6842
|
constructor(data) {
|
|
6776
6843
|
this.data = data;
|
|
6777
6844
|
this.uploader = new ComfyUploader(this);
|
|
6845
|
+
this._base = null;
|
|
6846
|
+
this.noAddress = null;
|
|
6778
6847
|
this.matchRequirements = (requirements) => this.manager.matchRequirements(requirements);
|
|
6779
6848
|
this.checkRequirements = (requirements) => this.manager.checkRequirements(requirements);
|
|
6780
6849
|
this.serverLogs = [];
|
|
@@ -6884,6 +6953,8 @@ var ComfyHost = class {
|
|
|
6884
6953
|
this._schemaStrategy = "auto";
|
|
6885
6954
|
this._schemaMaxAgeMs = 24 * 36e5;
|
|
6886
6955
|
this.connect = (p = {}) => {
|
|
6956
|
+
this.readSavedAddress();
|
|
6957
|
+
if (this.noAddress != null) return Promise.reject(new Error(this.noAddress));
|
|
6887
6958
|
if (this._ready == null) {
|
|
6888
6959
|
this._schemaStrategy = p.schema ?? "auto";
|
|
6889
6960
|
this._schemaMaxAgeMs = p.maxAgeMs ?? 24 * 36e5;
|
|
@@ -7043,10 +7114,13 @@ var ComfyHost = class {
|
|
|
7043
7114
|
this._unknownWsEventTypes = /* @__PURE__ */ new Set();
|
|
7044
7115
|
this.status = null;
|
|
7045
7116
|
this.lastWsMessageAt = null;
|
|
7046
|
-
this.base = parseHostBase(this.data);
|
|
7047
7117
|
/** folder where file related to the host config will be cached */
|
|
7048
7118
|
this.cacheFolder = comfyts.resolveFromHosts(this.data.id);
|
|
7049
7119
|
const storage = getComfyStorage();
|
|
7120
|
+
if (namesNoAddress(this.data)) {
|
|
7121
|
+
this.readSavedAddress();
|
|
7122
|
+
if (this.noAddress != null) logError(this.noAddress);
|
|
7123
|
+
} else this._base = parseHostBase(this.data);
|
|
7050
7124
|
if (!storage.exists(this.cacheFolder)) {
|
|
7051
7125
|
console.log("🟢 creating folder", this.cacheFolder);
|
|
7052
7126
|
storage.mkdirp(this.cacheFolder);
|
|
@@ -7948,11 +8022,14 @@ var ComfyTS = class ComfyTS {
|
|
|
7948
8022
|
host(data) {
|
|
7949
8023
|
const existing = this.hosts.get(data.id);
|
|
7950
8024
|
if (existing != null) {
|
|
7951
|
-
const incoming = parseHostBase(data);
|
|
7952
|
-
const cur = existing.base;
|
|
7953
|
-
const sameBase = cur.scheme === incoming.scheme && cur.host === incoming.host && cur.port === incoming.port && cur.basePath === incoming.basePath;
|
|
8025
|
+
const incoming = namesNoAddress(data) ? null : parseHostBase(data);
|
|
8026
|
+
const cur = existing.noAddress == null ? existing.base : null;
|
|
8027
|
+
const sameBase = incoming == null || cur != null && cur.scheme === incoming.scheme && cur.host === incoming.host && cur.port === incoming.port && cur.basePath === incoming.basePath;
|
|
7954
8028
|
const sameAuth = existing.data.apiKey == null === (data.apiKey == null);
|
|
7955
|
-
if (!sameBase || !sameAuth)
|
|
8029
|
+
if (!sameBase || !sameAuth) {
|
|
8030
|
+
const authed = (p) => p.apiKey != null ? " (authed)" : "";
|
|
8031
|
+
throw new Error(`host id '${data.id}' already registered ${cur == null ? "with no address" : `at ${renderHttpBase(cur)}`}${authed(existing.data)} — refusing ${incoming == null ? "the id alone" : renderHttpBase(incoming)}${authed(data)}`);
|
|
8032
|
+
}
|
|
7956
8033
|
return existing;
|
|
7957
8034
|
}
|
|
7958
8035
|
const created = new ComfyHost(data);
|