comfy-ts 2.10.0 → 2.11.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/dist/{LogsSt-DFxzQfDc.js → LogsSt-qtFzOKpu.js} +2 -2
- package/dist/{LogsSt-DFxzQfDc.js.map → LogsSt-qtFzOKpu.js.map} +1 -1
- package/dist/cli.js +4 -4
- package/dist/index.cjs +93 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +93 -1
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-_nrvJYyt.js → run-serve-BK7BA2dn.js} +91 -3
- package/dist/run-serve-BK7BA2dn.js.map +1 -0
- package/dist/{run-tui-Atvf9vb3.js → run-tui-CQyvMf0N.js} +36 -4
- package/dist/run-tui-CQyvMf0N.js.map +1 -0
- package/dist/{DefinedWorkflow-BatWaZO1.js → schemaDrift-DjjEtwfx.js} +176 -2
- package/dist/schemaDrift-DjjEtwfx.js.map +1 -0
- package/dist/serve-web.js +32 -16
- package/dist/{state-6RFDIQwJ.js → state--wrz0BQc.js} +14 -3
- package/dist/{state-6RFDIQwJ.js.map → state--wrz0BQc.js.map} +1 -1
- package/dist/web.d.ts +19 -0
- package/dist/web.js +93 -1
- package/dist/web.js.map +1 -1
- package/examples/comfy-cloud/capybara-i2v.cflow.ts +2 -0
- package/examples/comfy-cloud/wan22-5b-t2v.cflow.ts +2 -0
- package/examples/comfy-cloud/wan22-i2v.cflow.ts +2 -0
- package/examples/comfy-cloud/wan22-t2v.cflow.ts +2 -0
- package/examples/rvion/07-local-llm-text-gen.cflow.ts +2 -2
- package/package.json +4 -2
- package/src/cli/serve/ServeApp.ts +94 -0
- package/src/cli/serve/describeVar.ts +7 -0
- package/src/cli/serve/favicon.ts +3 -0
- package/src/cli/serve/web/api.ts +12 -0
- package/src/cli/serve/web/components/VarsForm.tsx +18 -7
- package/src/cli/serve/web/components/controls/LorasControl.tsx +102 -6
- package/src/cli/serve/web/state/WebSt.ts +79 -0
- package/src/cli/serve/web/state/loraSort.ts +39 -0
- package/src/cli/serve/web/styles.ts +15 -0
- package/src/cli/tui/components/Header.tsx +2 -0
- package/src/cli/tui/state/HostSt.ts +34 -0
- package/src/host/ComfyHost.ts +15 -0
- package/src/host/loraInfoCache.ts +64 -0
- package/src/host/loraManagerApi.ts +27 -0
- package/src/host/schemaDrift.ts +87 -0
- package/dist/DefinedWorkflow-BatWaZO1.js.map +0 -1
- package/dist/run-serve-_nrvJYyt.js.map +0 -1
- package/dist/run-tui-Atvf9vb3.js.map +0 -1
package/dist/web.d.ts
CHANGED
|
@@ -16430,6 +16430,19 @@ declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = V
|
|
|
16430
16430
|
}): Promise<ComfyExecution>;
|
|
16431
16431
|
}
|
|
16432
16432
|
//#endregion
|
|
16433
|
+
//#region src/host/schemaDrift.d.ts
|
|
16434
|
+
type Delta = {
|
|
16435
|
+
added: string[];
|
|
16436
|
+
removed: string[];
|
|
16437
|
+
};
|
|
16438
|
+
type SchemaDrift = {
|
|
16439
|
+
/** null on a light check: node types are only compared by a full one */
|
|
16440
|
+
nodes: Delta | null;
|
|
16441
|
+
models: ({
|
|
16442
|
+
noun: string;
|
|
16443
|
+
} & Delta)[];
|
|
16444
|
+
};
|
|
16445
|
+
//#endregion
|
|
16433
16446
|
//#region src/host/ComfyHost.d.ts
|
|
16434
16447
|
type ComfyHostID = Tagged<string, {
|
|
16435
16448
|
HostID: true;
|
|
@@ -16643,6 +16656,12 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
16643
16656
|
enabled: boolean;
|
|
16644
16657
|
clientId: string;
|
|
16645
16658
|
}) => Promise<void>;
|
|
16659
|
+
/** what changed on the host since this schema was loaded (src/host/schemaDrift.ts). `full: false`
|
|
16660
|
+
* asks only the loaders the schema has, a few KB, so it can run on a timer. Throws when the host
|
|
16661
|
+
* cannot be reached, which is itself the signal a caller watches for a restart */
|
|
16662
|
+
checkSchemaDrift: (p: {
|
|
16663
|
+
full: boolean;
|
|
16664
|
+
}) => Promise<SchemaDrift>;
|
|
16646
16665
|
/** GET a JSON route through host.fetch (/api preferred, bare fallback) */
|
|
16647
16666
|
private fetchJSON_;
|
|
16648
16667
|
/** retrieve the comfy spec from the schema*/
|
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.11.0";
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/litegraph/LiteGraphLinkID.ts
|
|
107
107
|
const asLiteGraphLinkID = (id) => id;
|
|
@@ -5000,6 +5000,87 @@ var DefinedWorkflow = class {
|
|
|
5000
5000
|
}
|
|
5001
5001
|
};
|
|
5002
5002
|
//#endregion
|
|
5003
|
+
//#region src/host/schemaDrift.ts
|
|
5004
|
+
/**
|
|
5005
|
+
* what changed on a host since a schema was loaded: node types, and the model files each loader
|
|
5006
|
+
* lists. ComfyUI exposes no boot time, so staleness is decided by CONTENT: a restart that changed
|
|
5007
|
+
* nothing stays quiet, a new lora shows even when nobody knows when the box rebooted.
|
|
5008
|
+
* A light check asks only the loaders (`/object_info/<node>`, a few KB); a full one compares every
|
|
5009
|
+
* node type (`/object_info`, megabytes).
|
|
5010
|
+
*/
|
|
5011
|
+
/** the loader inputs whose combo IS a model folder listing */
|
|
5012
|
+
const MODEL_LISTS = [
|
|
5013
|
+
{
|
|
5014
|
+
noun: "lora",
|
|
5015
|
+
node: "LoraLoader",
|
|
5016
|
+
input: "lora_name"
|
|
5017
|
+
},
|
|
5018
|
+
{
|
|
5019
|
+
noun: "checkpoint",
|
|
5020
|
+
node: "CheckpointLoaderSimple",
|
|
5021
|
+
input: "ckpt_name"
|
|
5022
|
+
},
|
|
5023
|
+
{
|
|
5024
|
+
noun: "unet",
|
|
5025
|
+
node: "UNETLoader",
|
|
5026
|
+
input: "unet_name"
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
noun: "text encoder",
|
|
5030
|
+
node: "CLIPLoader",
|
|
5031
|
+
input: "clip_name"
|
|
5032
|
+
},
|
|
5033
|
+
{
|
|
5034
|
+
noun: "vae",
|
|
5035
|
+
node: "VAELoader",
|
|
5036
|
+
input: "vae_name"
|
|
5037
|
+
}
|
|
5038
|
+
];
|
|
5039
|
+
/** a combo's options in both object_info spellings: `[[...options]]` and `['COMBO', { options }]` */
|
|
5040
|
+
function comboOptions(spec, node, input) {
|
|
5041
|
+
const def = spec[node];
|
|
5042
|
+
if (!isRecord(def) || !isRecord(def["input"])) return null;
|
|
5043
|
+
const sections = def["input"];
|
|
5044
|
+
for (const section of ["required", "optional"]) {
|
|
5045
|
+
const sec = sections[section];
|
|
5046
|
+
if (!isRecord(sec)) continue;
|
|
5047
|
+
const slot = sec[input];
|
|
5048
|
+
if (!Array.isArray(slot)) continue;
|
|
5049
|
+
const first = slot[0];
|
|
5050
|
+
if (Array.isArray(first)) return first.filter((x) => typeof x === "string");
|
|
5051
|
+
const opts = slot[1];
|
|
5052
|
+
if (first === "COMBO" && isRecord(opts) && Array.isArray(opts["options"])) return opts["options"].filter((x) => typeof x === "string");
|
|
5053
|
+
}
|
|
5054
|
+
return null;
|
|
5055
|
+
}
|
|
5056
|
+
function delta(before, after) {
|
|
5057
|
+
const was = new Set(before);
|
|
5058
|
+
const now = new Set(after);
|
|
5059
|
+
return {
|
|
5060
|
+
added: after.filter((x) => !was.has(x)),
|
|
5061
|
+
removed: before.filter((x) => !now.has(x))
|
|
5062
|
+
};
|
|
5063
|
+
}
|
|
5064
|
+
/** `live` may be PARTIAL (a light check holds only the loaders): a list is compared only where both
|
|
5065
|
+
* sides have the loader, and node types only when `full` */
|
|
5066
|
+
function diffSchemas(p) {
|
|
5067
|
+
const models = [];
|
|
5068
|
+
for (const m of MODEL_LISTS) {
|
|
5069
|
+
const before = comboOptions(p.loaded, m.node, m.input);
|
|
5070
|
+
const after = comboOptions(p.live, m.node, m.input);
|
|
5071
|
+
if (before == null || after == null) continue;
|
|
5072
|
+
const d = delta(before, after);
|
|
5073
|
+
if (d.added.length > 0 || d.removed.length > 0) models.push({
|
|
5074
|
+
noun: m.noun,
|
|
5075
|
+
...d
|
|
5076
|
+
});
|
|
5077
|
+
}
|
|
5078
|
+
return {
|
|
5079
|
+
nodes: p.full ? delta(Object.keys(p.loaded), Object.keys(p.live)) : null,
|
|
5080
|
+
models
|
|
5081
|
+
};
|
|
5082
|
+
}
|
|
5083
|
+
//#endregion
|
|
5003
5084
|
//#region src/host/ComfyHost.ts
|
|
5004
5085
|
/** the host never came up within ConnectOptions.timeoutMs */
|
|
5005
5086
|
var ComfyHostUnreachableError = class extends Error {
|
|
@@ -5225,6 +5306,17 @@ var ComfyHost = class {
|
|
|
5225
5306
|
}, { apiPrefix: false });
|
|
5226
5307
|
if (!res.ok) throw new Error(`PATCH /internal/logs/subscribe failed: ${res.status}`);
|
|
5227
5308
|
};
|
|
5309
|
+
this.checkSchemaDrift = async (p) => {
|
|
5310
|
+
const loaded = this.schema.data.spec;
|
|
5311
|
+
const live = {};
|
|
5312
|
+
if (p.full) Object.assign(live, await this.fetchJSON_("/object_info"));
|
|
5313
|
+
else for (const m of MODEL_LISTS) if (loaded[m.node] != null) Object.assign(live, await this.fetchJSON_(`/object_info/${m.node}`));
|
|
5314
|
+
return diffSchemas({
|
|
5315
|
+
loaded,
|
|
5316
|
+
live,
|
|
5317
|
+
full: p.full
|
|
5318
|
+
});
|
|
5319
|
+
};
|
|
5228
5320
|
this.fetchJSON_ = async (route) => {
|
|
5229
5321
|
const base = this.getServerHostHTTP();
|
|
5230
5322
|
const res = await this.fetch(route);
|