comfy-ts 2.10.0 → 2.12.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 +1 -0
- package/dist/{LogsSt-DFxzQfDc.js → LogsSt-U1H0mP1m.js} +35 -5
- package/dist/LogsSt-U1H0mP1m.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/index.cjs +565 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +210 -31
- package/dist/index.d.ts +210 -31
- package/dist/index.js +561 -63
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-_nrvJYyt.js → run-serve-BeAznay5.js} +549 -43
- package/dist/run-serve-BeAznay5.js.map +1 -0
- package/dist/{run-tui-Atvf9vb3.js → run-tui-BTGjvnKk.js} +75 -18
- package/dist/run-tui-BTGjvnKk.js.map +1 -0
- package/dist/{DefinedWorkflow-BatWaZO1.js → schemaDrift-Cg39vs53.js} +644 -60
- package/dist/schemaDrift-Cg39vs53.js.map +1 -0
- package/dist/serve-web.js +523 -133
- package/dist/{state-6RFDIQwJ.js → state-C7REnHan.js} +18 -3
- package/dist/{state-6RFDIQwJ.js.map → state-C7REnHan.js.map} +1 -1
- package/dist/web.d.ts +210 -31
- package/dist/web.js +561 -63
- 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/06-qwen-image-edit.cflow.ts +3 -2
- package/examples/rvion/07-local-llm-text-gen.cflow.ts +2 -2
- package/examples/rvion/10-anima-t2i.cflow.ts +229 -0
- package/extra/README.md +4 -0
- package/extra/comfyui-fresh-model-lists/README.md +25 -0
- package/extra/comfyui-fresh-model-lists/__init__.py +36 -0
- package/extra/comfyui-fresh-model-lists/test_fresh_model_lists.py +97 -0
- package/package.json +17 -7
- package/src/cli/draftMeta.ts +39 -0
- package/src/cli/serve/ServeApp.ts +242 -12
- package/src/cli/serve/applyVarPayload.ts +50 -22
- package/src/cli/serve/describeVar.ts +49 -6
- package/src/cli/serve/favicon.ts +3 -0
- package/src/cli/serve/llmConfigShape.ts +51 -0
- package/src/cli/serve/llmConfigs.ts +52 -0
- package/src/cli/serve/tagList.ts +92 -0
- package/src/cli/serve/tagSource.ts +69 -0
- package/src/cli/serve/web/api.ts +60 -0
- package/src/cli/serve/web/components/App.tsx +336 -44
- package/src/cli/serve/web/components/Gallery.tsx +105 -28
- package/src/cli/serve/web/components/HistoryPicker.tsx +149 -0
- package/src/cli/serve/web/components/Icon.tsx +18 -2
- package/src/cli/serve/web/components/MenuButton.tsx +53 -0
- package/src/cli/serve/web/components/Omnibox.tsx +85 -0
- package/src/cli/serve/web/components/PromptEnhancer.tsx +476 -180
- package/src/cli/serve/web/components/TooltipLayer.tsx +45 -0
- package/src/cli/serve/web/components/VarIcon.tsx +24 -0
- package/src/cli/serve/web/components/VarsForm.tsx +341 -177
- package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
- package/src/cli/serve/web/components/controls/LorasControl.tsx +708 -285
- package/src/cli/serve/web/components/controls/PresetPicker.tsx +1 -1
- package/src/cli/serve/web/components/controls/PromptControl.tsx +279 -0
- package/src/cli/serve/web/components/controls/PromptEditor.tsx +113 -0
- package/src/cli/serve/web/components/controls/SeedControl.tsx +17 -10
- package/src/cli/serve/web/components/controls/SizeControl.tsx +111 -18
- package/src/cli/serve/web/components/modKey.ts +2 -0
- package/src/cli/serve/web/llm.ts +23 -12
- package/src/cli/serve/web/promptEditor/promptExtensions.ts +281 -0
- package/src/cli/serve/web/state/EnhancerSt.ts +415 -100
- package/src/cli/serve/web/state/FormSt.ts +193 -29
- package/src/cli/serve/web/state/OmniboxSt.ts +57 -0
- package/src/cli/serve/web/state/WebSt.ts +281 -57
- package/src/cli/serve/web/state/choiceButtons.ts +61 -0
- package/src/cli/serve/web/state/generateButton.ts +16 -0
- package/src/cli/serve/web/state/history.ts +54 -0
- package/src/cli/serve/web/state/host.ts +5 -2
- package/src/cli/serve/web/state/keptLines.ts +53 -0
- package/src/cli/serve/web/state/latentMode.ts +20 -0
- package/src/cli/serve/web/state/loraSort.ts +57 -0
- package/src/cli/serve/web/state/moduleTree.ts +2 -2
- package/src/cli/serve/web/state/omnibox.ts +69 -0
- package/src/cli/serve/web/state/payload.ts +38 -58
- package/src/cli/serve/web/state/shortcuts.ts +54 -0
- package/src/cli/serve/web/state/sizeStars.ts +31 -0
- package/src/cli/serve/web/state/stableSlots.ts +21 -0
- package/src/cli/serve/web/state/varGroups.ts +24 -0
- package/src/cli/serve/web/styles.ts +472 -118
- package/src/cli/serve/webBundle.ts +54 -10
- package/src/cli/tui/components/Header.tsx +2 -0
- package/src/cli/tui/components/PickerOverlays.tsx +9 -2
- package/src/cli/tui/imagePicker/ImagePickerSt.ts +1 -1
- package/src/cli/tui/state/DraftsSt.ts +18 -2
- package/src/cli/tui/state/EditorSt.ts +1 -1
- package/src/cli/tui/state/HostSt.ts +34 -0
- package/src/cli/tui/state/LorasSt.ts +1 -1
- package/src/cli/tui/state/PickerSt.ts +25 -7
- package/src/cli/tui/state/SettingsSt.ts +1 -1
- package/src/cli/tui/state/TuiSt.ts +10 -0
- package/src/coreExports.ts +20 -0
- package/src/host/ComfyHost.ts +15 -0
- package/src/host/loraInfoCache.ts +70 -0
- package/src/host/loraManagerApi.ts +27 -0
- package/src/host/schemaDrift.ts +87 -0
- package/src/state.ts +5 -0
- package/src/vars/ComfyVars.ts +337 -67
- package/src/vars/DefinedWorkflow.ts +40 -19
- package/src/vars/lanes.ts +238 -0
- package/src/vars/loraEntry.ts +101 -0
- package/src/vars/promptSyntax.ts +382 -0
- package/dist/DefinedWorkflow-BatWaZO1.js.map +0 -1
- package/dist/LogsSt-DFxzQfDc.js.map +0 -1
- package/dist/run-serve-_nrvJYyt.js.map +0 -1
- package/dist/run-tui-Atvf9vb3.js.map +0 -1
- package/src/cli/serve/web/components/Sidebar.tsx +0 -66
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as importSharp, n as settingsPathFor } from "./state-
|
|
3
|
-
import {
|
|
1
|
+
import { A as refreshLoraInfoCacheIfChanged, I as fetchLoraList, J as loraBasename, L as fetchLoraPreviewBytes, S as getLoraPreviewUrl, T as loraMatchesFilter, X as loraPreviewMapFrom, Y as loraKey, _ as setLoraKeyword, b as getLoraDisplayName, c as PromptVar, et as extractErrorMessage, g as loraKeywordFromMirror, h as isLoraKeywordFromMirror, i as summarizeDrift, m as getLoraKeyword, ot as logError, p as clearLoraKeywordOverride, s as LorasVar } from "./schemaDrift-Cg39vs53.js";
|
|
2
|
+
import { i as importSharp, n as settingsPathFor } from "./state-C7REnHan.js";
|
|
3
|
+
import { d as familyOf, f as findDefinedWorkflow, i as draftKeyForFile, l as assignFamilyColors, m as scanCflowFiles, o as listDraftsForFile, p as mergeWorkflowSources, r as DraftsSt, t as LogsSt, u as buildFileRows } from "./LogsSt-U1H0mP1m.js";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -656,6 +656,14 @@ const Header = observer((p) => {
|
|
|
656
656
|
color: "yellow",
|
|
657
657
|
children: [" ⇄ overrides ", s.wf.host.data.id]
|
|
658
658
|
}),
|
|
659
|
+
s.host.drift !== "" && /* @__PURE__ */ jsxs(Text, {
|
|
660
|
+
color: "yellow",
|
|
661
|
+
children: [
|
|
662
|
+
" ⚠ changed: ",
|
|
663
|
+
s.host.drift,
|
|
664
|
+
" · a → re-codegen"
|
|
665
|
+
]
|
|
666
|
+
}),
|
|
659
667
|
s.host.status === "down" && /* @__PURE__ */ jsxs(Text, {
|
|
660
668
|
color: "red",
|
|
661
669
|
children: [" ", s.host.probing ? s.host.spinner : `↻ ${s.host.retryInS}s`]
|
|
@@ -855,12 +863,19 @@ const ChoiceOverlay = observer((p) => {
|
|
|
855
863
|
key: opt,
|
|
856
864
|
node: /* @__PURE__ */ jsxs(Text, {
|
|
857
865
|
inverse: ix === pk.ix,
|
|
858
|
-
children: [
|
|
866
|
+
children: [
|
|
867
|
+
ix === pk.ix ? "▸ " : " ",
|
|
868
|
+
pk.isPicked(opt) ? "● " : "○ ",
|
|
869
|
+
opt
|
|
870
|
+
]
|
|
859
871
|
}, opt)
|
|
860
872
|
})),
|
|
861
873
|
footer: options.length === 0 ? /* @__PURE__ */ jsx(Text, {
|
|
862
874
|
color: "red",
|
|
863
875
|
children: "no match"
|
|
876
|
+
}) : pk.choiceIsMany ? /* @__PURE__ */ jsx(Text, {
|
|
877
|
+
color: "gray",
|
|
878
|
+
children: "⏎ toggles · esc done"
|
|
864
879
|
}) : void 0
|
|
865
880
|
});
|
|
866
881
|
});
|
|
@@ -870,7 +885,7 @@ const PresetOverlay = observer((p) => {
|
|
|
870
885
|
const s = p.st;
|
|
871
886
|
const pk = s.picker;
|
|
872
887
|
const options = pk.presetOptions;
|
|
873
|
-
const current = pk.presetVar?.
|
|
888
|
+
const current = pk.presetVar?.toEditBuffer().trim() ?? "";
|
|
874
889
|
return /* @__PURE__ */ jsx(OverlayList, {
|
|
875
890
|
title: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
876
891
|
"presets ",
|
|
@@ -1263,7 +1278,7 @@ var ImagePickerSt = class {
|
|
|
1263
1278
|
this.filter = "";
|
|
1264
1279
|
this._busy = false;
|
|
1265
1280
|
makeAutoObservable(this, { st: false });
|
|
1266
|
-
this.st.disposers.push(reaction(() => this.st.mode === "overlay-image" ? this.highlightedImage : null, () => void this.refreshPreview(), { delay:
|
|
1281
|
+
this.st.disposers.push(reaction(() => this.st.mode === "overlay-image" ? this.highlightedImage : null, () => void this.refreshPreview(), { delay: this.st.timing.previewMs }));
|
|
1267
1282
|
}
|
|
1268
1283
|
/** kind-narrowing cast sanctioned (agent/coding.md), `kind` is the tag */
|
|
1269
1284
|
get selectedVar() {
|
|
@@ -2346,7 +2361,7 @@ var EditorSt = class EditorSt {
|
|
|
2346
2361
|
const sel = this.st.selected?.[1];
|
|
2347
2362
|
if (sel == null) return;
|
|
2348
2363
|
this.st.mode = "overlay-text";
|
|
2349
|
-
this.buffer =
|
|
2364
|
+
this.buffer = sel.toEditBuffer();
|
|
2350
2365
|
this.cursor = [...this.buffer].length;
|
|
2351
2366
|
this.invalid = false;
|
|
2352
2367
|
}
|
|
@@ -2926,6 +2941,8 @@ var ExecSt = class {
|
|
|
2926
2941
|
//#endregion
|
|
2927
2942
|
//#region src/cli/tui/state/HostSt.ts
|
|
2928
2943
|
const PROBE_EVERY_MS = 5e3;
|
|
2944
|
+
/** a light drift check (the loaders only) at most this often while the host is up */
|
|
2945
|
+
const DRIFT_EVERY_MS = 6e4;
|
|
2929
2946
|
const PROBE_TIMEOUT_MS = 3e3;
|
|
2930
2947
|
const SPIN_FRAMES = [
|
|
2931
2948
|
"⠋",
|
|
@@ -2976,6 +2993,8 @@ var HostSt = class {
|
|
|
2976
2993
|
this.loopTimer = null;
|
|
2977
2994
|
this.spinTimer = null;
|
|
2978
2995
|
this.countdownTimer = null;
|
|
2996
|
+
this.drift = "";
|
|
2997
|
+
this.driftAt = 0;
|
|
2979
2998
|
this.ix = 0;
|
|
2980
2999
|
this.running = null;
|
|
2981
3000
|
this.actions = [
|
|
@@ -3010,6 +3029,7 @@ var HostSt = class {
|
|
|
3010
3029
|
this.status = "unknown";
|
|
3011
3030
|
this.statusVia = null;
|
|
3012
3031
|
this.lastProbeError = null;
|
|
3032
|
+
this.drift = "";
|
|
3013
3033
|
});
|
|
3014
3034
|
this.probeGen++;
|
|
3015
3035
|
if (this.loopTimer != null) clearTimeout(this.loopTimer);
|
|
@@ -3077,6 +3097,7 @@ var HostSt = class {
|
|
|
3077
3097
|
}
|
|
3078
3098
|
}
|
|
3079
3099
|
if (this.host !== host) return;
|
|
3100
|
+
const before = this.status;
|
|
3080
3101
|
const verdict = probeVerdict({
|
|
3081
3102
|
httpOk: ok,
|
|
3082
3103
|
wsOpen: host.isConnected,
|
|
@@ -3088,6 +3109,23 @@ var HostSt = class {
|
|
|
3088
3109
|
this.statusVia = verdict.via;
|
|
3089
3110
|
this.lastProbeError = probeError;
|
|
3090
3111
|
});
|
|
3112
|
+
if (verdict.status === "up") {
|
|
3113
|
+
if (before !== "up") this.checkDrift(true);
|
|
3114
|
+
else if (Date.now() - this.driftAt > DRIFT_EVERY_MS) this.checkDrift(false);
|
|
3115
|
+
}
|
|
3116
|
+
}
|
|
3117
|
+
async checkDrift(full) {
|
|
3118
|
+
const host = this.host;
|
|
3119
|
+
if (host.data.sdkAutoWrite === false) return;
|
|
3120
|
+
this.driftAt = Date.now();
|
|
3121
|
+
try {
|
|
3122
|
+
const summary = summarizeDrift(await host.checkSchemaDrift({ full }));
|
|
3123
|
+
if (this.host !== host) return;
|
|
3124
|
+
runInAction(() => {
|
|
3125
|
+
if (summary !== "") this.drift = summary;
|
|
3126
|
+
else if (full) this.drift = "";
|
|
3127
|
+
});
|
|
3128
|
+
} catch {}
|
|
3091
3129
|
}
|
|
3092
3130
|
get host() {
|
|
3093
3131
|
return this.st.runHost;
|
|
@@ -3189,6 +3227,7 @@ var HostSt = class {
|
|
|
3189
3227
|
runInAction(() => {
|
|
3190
3228
|
const schema = this.host.schema;
|
|
3191
3229
|
this.st.exec.notice = `SDK regenerated: ${schema.nodes.length} node types, ${schema.getLoras().length} loras`;
|
|
3230
|
+
this.drift = "";
|
|
3192
3231
|
});
|
|
3193
3232
|
} catch (e) {
|
|
3194
3233
|
runInAction(() => {
|
|
@@ -3233,7 +3272,7 @@ var LorasSt = class {
|
|
|
3233
3272
|
this.previewSweepStatus = null;
|
|
3234
3273
|
this._busy = false;
|
|
3235
3274
|
makeAutoObservable(this, { st: false });
|
|
3236
|
-
this.st.disposers.push(reaction(() => this.st.mode === "overlay-loras" ? this.selectedName : null, () => void this.refreshPreview(), { delay:
|
|
3275
|
+
this.st.disposers.push(reaction(() => this.st.mode === "overlay-loras" ? this.selectedName : null, () => void this.refreshPreview(), { delay: this.st.timing.previewMs }));
|
|
3237
3276
|
}
|
|
3238
3277
|
/** kind-narrowing cast sanctioned (agent/coding.md), `kind` is the tag */
|
|
3239
3278
|
get selectedVar() {
|
|
@@ -3418,6 +3457,16 @@ var PickerSt = class {
|
|
|
3418
3457
|
const sel = this.st.selected?.[1];
|
|
3419
3458
|
return sel?.kind === "choice" ? sel : null;
|
|
3420
3459
|
}
|
|
3460
|
+
/** is this option currently picked (one, one or none, or one of many) */
|
|
3461
|
+
isPicked(option) {
|
|
3462
|
+
const cv = this.choiceVar;
|
|
3463
|
+
if (cv == null) return false;
|
|
3464
|
+
return cv.select === "many" ? cv.value.includes(option) : cv.value === option;
|
|
3465
|
+
}
|
|
3466
|
+
/** a many-choice stays open after ⏎: you toggle several, esc leaves */
|
|
3467
|
+
get choiceIsMany() {
|
|
3468
|
+
return this.choiceVar?.select === "many";
|
|
3469
|
+
}
|
|
3421
3470
|
get sizeVar() {
|
|
3422
3471
|
const sel = this.st.selected?.[1];
|
|
3423
3472
|
return sel?.kind === "size" ? sel : null;
|
|
@@ -3459,7 +3508,8 @@ var PickerSt = class {
|
|
|
3459
3508
|
this.st.mode = "overlay-choice";
|
|
3460
3509
|
this.filter = "";
|
|
3461
3510
|
this.invalid = false;
|
|
3462
|
-
|
|
3511
|
+
const first = cv.select === "many" ? cv.value[0] : cv.value;
|
|
3512
|
+
this.ix = Math.max(0, first == null ? 0 : cv.choices.indexOf(first));
|
|
3463
3513
|
}
|
|
3464
3514
|
/** `P` on a text/prompt var that declares presets. A var without any stays on `nav`:
|
|
3465
3515
|
* the keybar only advertises the key when the row has some */
|
|
@@ -3469,7 +3519,7 @@ var PickerSt = class {
|
|
|
3469
3519
|
this.st.mode = "overlay-preset";
|
|
3470
3520
|
this.filter = "";
|
|
3471
3521
|
this.invalid = false;
|
|
3472
|
-
const value = pv.
|
|
3522
|
+
const value = pv.toEditBuffer().trim();
|
|
3473
3523
|
const ix = pv.presets.findIndex((x) => x.text.trim() === value);
|
|
3474
3524
|
this.ix = ix === -1 ? 0 : ix;
|
|
3475
3525
|
}
|
|
@@ -3516,9 +3566,14 @@ var PickerSt = class {
|
|
|
3516
3566
|
}
|
|
3517
3567
|
const cv = this.choiceVar;
|
|
3518
3568
|
if (cv != null) {
|
|
3519
|
-
const hit = this.options[this.ix];
|
|
3569
|
+
const hit = cv.choices.find((c) => c === this.options[this.ix]);
|
|
3520
3570
|
if (hit == null) return;
|
|
3521
|
-
cv.
|
|
3571
|
+
if (cv.select === "many") {
|
|
3572
|
+
cv.toggle(hit);
|
|
3573
|
+
return;
|
|
3574
|
+
}
|
|
3575
|
+
if (cv.select === "zero-or-one") cv.toggle(hit);
|
|
3576
|
+
else cv.set(hit);
|
|
3522
3577
|
this.st.mode = "nav";
|
|
3523
3578
|
return;
|
|
3524
3579
|
}
|
|
@@ -3896,7 +3951,7 @@ var SettingsSt = class {
|
|
|
3896
3951
|
this.load();
|
|
3897
3952
|
if (this.previewRenderer === "native" && !protocolCapable()) this.previewRenderer = "pixel";
|
|
3898
3953
|
makeAutoObservable(this, { st: false });
|
|
3899
|
-
this.st.disposers.push(reaction(() => this.snapshotJson(), (json) => this.write(json), { delay:
|
|
3954
|
+
this.st.disposers.push(reaction(() => this.snapshotJson(), (json) => this.write(json), { delay: this.st.timing.autosaveMs }));
|
|
3900
3955
|
this.st.disposers.push(() => this.write(this.snapshotJson()));
|
|
3901
3956
|
}
|
|
3902
3957
|
snapshotJson() {
|
|
@@ -4255,10 +4310,10 @@ var WorkflowsSt = class {
|
|
|
4255
4310
|
};
|
|
4256
4311
|
//#endregion
|
|
4257
4312
|
//#region src/cli/tui/state/TuiSt.ts
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4313
|
+
const TUI_TIMING = {
|
|
4314
|
+
previewMs: 120,
|
|
4315
|
+
autosaveMs: 300
|
|
4316
|
+
};
|
|
4262
4317
|
var TuiSt = class {
|
|
4263
4318
|
/** the host runs actually target right now */
|
|
4264
4319
|
get runHost() {
|
|
@@ -4288,10 +4343,12 @@ var TuiSt = class {
|
|
|
4288
4343
|
this.termRows = (process.stdout.rows ?? 24) - 1;
|
|
4289
4344
|
this.varsViewH = 0;
|
|
4290
4345
|
this.wf = wf;
|
|
4346
|
+
this.timing = opts.timing ?? TUI_TIMING;
|
|
4291
4347
|
makeAutoObservable(this, {
|
|
4292
4348
|
wf: observableRef,
|
|
4293
4349
|
hostOverride: observableRef,
|
|
4294
4350
|
onExit: false,
|
|
4351
|
+
timing: false,
|
|
4295
4352
|
editor: false,
|
|
4296
4353
|
picker: false,
|
|
4297
4354
|
loras: false,
|
|
@@ -4540,4 +4597,4 @@ async function runTui(args) {
|
|
|
4540
4597
|
//#endregion
|
|
4541
4598
|
export { runTui };
|
|
4542
4599
|
|
|
4543
|
-
//# sourceMappingURL=run-tui-
|
|
4600
|
+
//# sourceMappingURL=run-tui-BTGjvnKk.js.map
|