comfy-ts 2.11.0 → 2.13.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.
Files changed (122) hide show
  1. package/README.md +1 -0
  2. package/dist/{LogsSt-qtFzOKpu.js → LogsSt-CUeo843w.js} +51 -7
  3. package/dist/LogsSt-CUeo843w.js.map +1 -0
  4. package/dist/cli.js +4 -4
  5. package/dist/index.cjs +595 -73
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +286 -46
  8. package/dist/index.d.ts +286 -46
  9. package/dist/index.js +591 -74
  10. package/dist/index.js.map +1 -1
  11. package/dist/{run-serve-BK7BA2dn.js → run-serve-DlRBv_Nk.js} +738 -58
  12. package/dist/run-serve-DlRBv_Nk.js.map +1 -0
  13. package/dist/{run-tui-CQyvMf0N.js → run-tui-B5uxm2_l.js} +43 -18
  14. package/dist/run-tui-B5uxm2_l.js.map +1 -0
  15. package/dist/{schemaDrift-DjjEtwfx.js → schemaDrift-E95iTF7E.js} +473 -60
  16. package/dist/schemaDrift-E95iTF7E.js.map +1 -0
  17. package/dist/serve-web.js +710 -174
  18. package/dist/{state--wrz0BQc.js → state-CUp2J1Zy.js} +126 -14
  19. package/dist/state-CUp2J1Zy.js.map +1 -0
  20. package/dist/web.d.ts +286 -46
  21. package/dist/web.js +591 -74
  22. package/dist/web.js.map +1 -1
  23. package/examples/comfy-cloud/sdk.d.ts +163 -163
  24. package/examples/rvion/06-qwen-image-edit.cflow.ts +3 -2
  25. package/examples/rvion/10-anima-t2i.cflow.ts +252 -0
  26. package/examples/rvion/11-yue2-t2a.cflow.ts +105 -0
  27. package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +78 -0
  28. package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +153 -0
  29. package/examples/rvion/stableAudio3Prompts.ts +19 -0
  30. package/extra/README.md +4 -0
  31. package/extra/comfyui-fresh-model-lists/README.md +25 -0
  32. package/extra/comfyui-fresh-model-lists/__init__.py +36 -0
  33. package/extra/comfyui-fresh-model-lists/test_fresh_model_lists.py +97 -0
  34. package/package.json +15 -7
  35. package/src/cli/draftMeta.ts +39 -0
  36. package/src/cli/serve/ServeApp.ts +305 -30
  37. package/src/cli/serve/applyVarPayload.ts +50 -22
  38. package/src/cli/serve/byteRange.ts +48 -0
  39. package/src/cli/serve/describeVar.ts +42 -6
  40. package/src/cli/serve/llmConfigShape.ts +51 -0
  41. package/src/cli/serve/llmConfigs.ts +52 -0
  42. package/src/cli/serve/run-serve.ts +12 -3
  43. package/src/cli/serve/tagList.ts +92 -0
  44. package/src/cli/serve/tagSource.ts +69 -0
  45. package/src/cli/serve/web/api.ts +72 -0
  46. package/src/cli/serve/web/components/App.tsx +485 -44
  47. package/src/cli/serve/web/components/DraftTabs.tsx +167 -0
  48. package/src/cli/serve/web/components/Gallery.tsx +133 -31
  49. package/src/cli/serve/web/components/HistoryPicker.tsx +149 -0
  50. package/src/cli/serve/web/components/Icon.tsx +58 -2
  51. package/src/cli/serve/web/components/MenuButton.tsx +53 -0
  52. package/src/cli/serve/web/components/Omnibox.tsx +135 -0
  53. package/src/cli/serve/web/components/PromptEnhancer.tsx +476 -180
  54. package/src/cli/serve/web/components/SideMenu.tsx +414 -0
  55. package/src/cli/serve/web/components/TooltipLayer.tsx +46 -0
  56. package/src/cli/serve/web/components/VarIcon.tsx +24 -0
  57. package/src/cli/serve/web/components/VarsForm.tsx +223 -351
  58. package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
  59. package/src/cli/serve/web/components/controls/LorasControl.tsx +646 -317
  60. package/src/cli/serve/web/components/controls/PresetPicker.tsx +1 -1
  61. package/src/cli/serve/web/components/controls/PromptControl.tsx +279 -0
  62. package/src/cli/serve/web/components/controls/PromptEditor.tsx +113 -0
  63. package/src/cli/serve/web/components/controls/SeedControl.tsx +17 -10
  64. package/src/cli/serve/web/components/controls/SizeControl.tsx +111 -18
  65. package/src/cli/serve/web/components/modKey.ts +2 -0
  66. package/src/cli/serve/web/llm.ts +23 -12
  67. package/src/cli/serve/web/promptEditor/promptExtensions.ts +284 -0
  68. package/src/cli/serve/web/state/EnhancerSt.ts +431 -101
  69. package/src/cli/serve/web/state/FormSt.ts +214 -30
  70. package/src/cli/serve/web/state/OmniboxSt.ts +59 -0
  71. package/src/cli/serve/web/state/WebSt.ts +364 -80
  72. package/src/cli/serve/web/state/choiceButtons.ts +61 -0
  73. package/src/cli/serve/web/state/draftNames.ts +16 -0
  74. package/src/cli/serve/web/state/draftTabs.ts +75 -0
  75. package/src/cli/serve/web/state/generateButton.ts +16 -0
  76. package/src/cli/serve/web/state/history.ts +54 -0
  77. package/src/cli/serve/web/state/host.ts +5 -2
  78. package/src/cli/serve/web/state/keptLines.ts +53 -0
  79. package/src/cli/serve/web/state/latentMode.ts +20 -0
  80. package/src/cli/serve/web/state/loraSort.ts +18 -0
  81. package/src/cli/serve/web/state/moduleTree.ts +2 -2
  82. package/src/cli/serve/web/state/omnibox.ts +133 -0
  83. package/src/cli/serve/web/state/payload.ts +38 -58
  84. package/src/cli/serve/web/state/shortcuts.ts +103 -0
  85. package/src/cli/serve/web/state/sizeStars.ts +31 -0
  86. package/src/cli/serve/web/state/stableSlots.ts +21 -0
  87. package/src/cli/serve/web/state/varGroups.ts +24 -0
  88. package/src/cli/serve/web/styles.ts +653 -154
  89. package/src/cli/serve/webBundle.ts +54 -10
  90. package/src/cli/serve/workflowTags.ts +42 -0
  91. package/src/cli/serve/workspaceLabels.ts +23 -0
  92. package/src/cli/tui/components/PickerOverlays.tsx +9 -2
  93. package/src/cli/tui/imagePicker/ImagePickerSt.ts +1 -1
  94. package/src/cli/tui/state/DraftsSt.ts +28 -8
  95. package/src/cli/tui/state/EditorSt.ts +1 -1
  96. package/src/cli/tui/state/LorasSt.ts +1 -1
  97. package/src/cli/tui/state/PickerSt.ts +25 -7
  98. package/src/cli/tui/state/SettingsSt.ts +1 -1
  99. package/src/cli/tui/state/TuiSt.ts +10 -0
  100. package/src/coreExports.ts +21 -0
  101. package/src/host/ComfyHost.ts +17 -2
  102. package/src/host/ResilientWebsocket.ts +54 -4
  103. package/src/host/loraInfoCache.ts +6 -0
  104. package/src/runner/ComfyExecution.ts +60 -0
  105. package/src/runner/ComfyWorkflow.ts +4 -0
  106. package/src/runner/ComfyWsApi.ts +2 -0
  107. package/src/runner/MediaImage.ts +2 -2
  108. package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +5 -5
  109. package/src/sdk-generator/comfyui-sdk-codegen.ts +1 -1
  110. package/src/state.ts +5 -0
  111. package/src/utils/copyName.ts +12 -0
  112. package/src/vars/ComfyVars.ts +337 -67
  113. package/src/vars/DefinedWorkflow.ts +47 -20
  114. package/src/vars/lanes.ts +238 -0
  115. package/src/vars/loraEntry.ts +101 -0
  116. package/src/vars/promptSyntax.ts +382 -0
  117. package/dist/LogsSt-qtFzOKpu.js.map +0 -1
  118. package/dist/run-serve-BK7BA2dn.js.map +0 -1
  119. package/dist/run-tui-CQyvMf0N.js.map +0 -1
  120. package/dist/schemaDrift-DjjEtwfx.js.map +0 -1
  121. package/dist/state--wrz0BQc.js.map +0 -1
  122. package/src/cli/serve/web/components/Sidebar.tsx +0 -66
@@ -1,6 +1,6 @@
1
- import { G as loraPreviewMapFrom, M as fetchLoraPreviewBytes, T as refreshLoraInfoCacheIfChanged, U as loraBasename, W as loraKey, Y as extractErrorMessage, c as PromptVar, d as isLoraKeywordFromMirror, f as loraKeywordFromMirror, g as getLoraDisplayName, i as summarizeDrift, j as fetchLoraList, l as clearLoraKeywordOverride, p as setLoraKeyword, s as LorasVar, tt as logError, u as getLoraKeyword, v as getLoraPreviewUrl, x as loraMatchesFilter } from "./schemaDrift-DjjEtwfx.js";
2
- import { i as importSharp, n as settingsPathFor } from "./state--wrz0BQc.js";
3
- import { c as buildFileRows, d as mergeWorkflowSources, f as scanCflowFiles, i as draftKeyForFile, l as familyOf, o as listDraftsForFile, r as DraftsSt, s as assignFamilyColors, t as LogsSt, u as findDefinedWorkflow } from "./LogsSt-qtFzOKpu.js";
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-E95iTF7E.js";
2
+ import { i as importSharp, n as settingsPathFor } from "./state-CUp2J1Zy.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-CUeo843w.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";
@@ -863,12 +863,19 @@ const ChoiceOverlay = observer((p) => {
863
863
  key: opt,
864
864
  node: /* @__PURE__ */ jsxs(Text, {
865
865
  inverse: ix === pk.ix,
866
- children: [ix === pk.ix ? "▸ " : " ", opt]
866
+ children: [
867
+ ix === pk.ix ? "▸ " : " ",
868
+ pk.isPicked(opt) ? "● " : "○ ",
869
+ opt
870
+ ]
867
871
  }, opt)
868
872
  })),
869
873
  footer: options.length === 0 ? /* @__PURE__ */ jsx(Text, {
870
874
  color: "red",
871
875
  children: "no match"
876
+ }) : pk.choiceIsMany ? /* @__PURE__ */ jsx(Text, {
877
+ color: "gray",
878
+ children: "⏎ toggles · esc done"
872
879
  }) : void 0
873
880
  });
874
881
  });
@@ -878,7 +885,7 @@ const PresetOverlay = observer((p) => {
878
885
  const s = p.st;
879
886
  const pk = s.picker;
880
887
  const options = pk.presetOptions;
881
- const current = pk.presetVar?.value.trim() ?? "";
888
+ const current = pk.presetVar?.toEditBuffer().trim() ?? "";
882
889
  return /* @__PURE__ */ jsx(OverlayList, {
883
890
  title: /* @__PURE__ */ jsxs(Fragment, { children: [
884
891
  "presets ",
@@ -1271,7 +1278,7 @@ var ImagePickerSt = class {
1271
1278
  this.filter = "";
1272
1279
  this._busy = false;
1273
1280
  makeAutoObservable(this, { st: false });
1274
- this.st.disposers.push(reaction(() => this.st.mode === "overlay-image" ? this.highlightedImage : null, () => void this.refreshPreview(), { delay: 120 }));
1281
+ this.st.disposers.push(reaction(() => this.st.mode === "overlay-image" ? this.highlightedImage : null, () => void this.refreshPreview(), { delay: this.st.timing.previewMs }));
1275
1282
  }
1276
1283
  /** kind-narrowing cast sanctioned (agent/coding.md), `kind` is the tag */
1277
1284
  get selectedVar() {
@@ -2354,7 +2361,7 @@ var EditorSt = class EditorSt {
2354
2361
  const sel = this.st.selected?.[1];
2355
2362
  if (sel == null) return;
2356
2363
  this.st.mode = "overlay-text";
2357
- this.buffer = String(sel.value);
2364
+ this.buffer = sel.toEditBuffer();
2358
2365
  this.cursor = [...this.buffer].length;
2359
2366
  this.invalid = false;
2360
2367
  }
@@ -3265,7 +3272,7 @@ var LorasSt = class {
3265
3272
  this.previewSweepStatus = null;
3266
3273
  this._busy = false;
3267
3274
  makeAutoObservable(this, { st: false });
3268
- this.st.disposers.push(reaction(() => this.st.mode === "overlay-loras" ? this.selectedName : null, () => void this.refreshPreview(), { delay: 120 }));
3275
+ this.st.disposers.push(reaction(() => this.st.mode === "overlay-loras" ? this.selectedName : null, () => void this.refreshPreview(), { delay: this.st.timing.previewMs }));
3269
3276
  }
3270
3277
  /** kind-narrowing cast sanctioned (agent/coding.md), `kind` is the tag */
3271
3278
  get selectedVar() {
@@ -3450,6 +3457,16 @@ var PickerSt = class {
3450
3457
  const sel = this.st.selected?.[1];
3451
3458
  return sel?.kind === "choice" ? sel : null;
3452
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
+ }
3453
3470
  get sizeVar() {
3454
3471
  const sel = this.st.selected?.[1];
3455
3472
  return sel?.kind === "size" ? sel : null;
@@ -3491,7 +3508,8 @@ var PickerSt = class {
3491
3508
  this.st.mode = "overlay-choice";
3492
3509
  this.filter = "";
3493
3510
  this.invalid = false;
3494
- this.ix = Math.max(0, cv.choices.indexOf(cv.value));
3511
+ const first = cv.select === "many" ? cv.value[0] : cv.value;
3512
+ this.ix = Math.max(0, first == null ? 0 : cv.choices.indexOf(first));
3495
3513
  }
3496
3514
  /** `P` on a text/prompt var that declares presets. A var without any stays on `nav`:
3497
3515
  * the keybar only advertises the key when the row has some */
@@ -3501,7 +3519,7 @@ var PickerSt = class {
3501
3519
  this.st.mode = "overlay-preset";
3502
3520
  this.filter = "";
3503
3521
  this.invalid = false;
3504
- const value = pv.value.trim();
3522
+ const value = pv.toEditBuffer().trim();
3505
3523
  const ix = pv.presets.findIndex((x) => x.text.trim() === value);
3506
3524
  this.ix = ix === -1 ? 0 : ix;
3507
3525
  }
@@ -3548,9 +3566,14 @@ var PickerSt = class {
3548
3566
  }
3549
3567
  const cv = this.choiceVar;
3550
3568
  if (cv != null) {
3551
- const hit = this.options[this.ix];
3569
+ const hit = cv.choices.find((c) => c === this.options[this.ix]);
3552
3570
  if (hit == null) return;
3553
- cv.set(hit);
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);
3554
3577
  this.st.mode = "nav";
3555
3578
  return;
3556
3579
  }
@@ -3928,7 +3951,7 @@ var SettingsSt = class {
3928
3951
  this.load();
3929
3952
  if (this.previewRenderer === "native" && !protocolCapable()) this.previewRenderer = "pixel";
3930
3953
  makeAutoObservable(this, { st: false });
3931
- this.st.disposers.push(reaction(() => this.snapshotJson(), (json) => this.write(json), { delay: 300 }));
3954
+ this.st.disposers.push(reaction(() => this.snapshotJson(), (json) => this.write(json), { delay: this.st.timing.autosaveMs }));
3932
3955
  this.st.disposers.push(() => this.write(this.snapshotJson()));
3933
3956
  }
3934
3957
  snapshotJson() {
@@ -4287,10 +4310,10 @@ var WorkflowsSt = class {
4287
4310
  };
4288
4311
  //#endregion
4289
4312
  //#region src/cli/tui/state/TuiSt.ts
4290
- /**
4291
- * ROOT of the TUI state tree (one instance per run). Children are service
4292
- * classes with an `st` backref; components are stateless views over this.
4293
- */
4313
+ const TUI_TIMING = {
4314
+ previewMs: 120,
4315
+ autosaveMs: 300
4316
+ };
4294
4317
  var TuiSt = class {
4295
4318
  /** the host runs actually target right now */
4296
4319
  get runHost() {
@@ -4320,10 +4343,12 @@ var TuiSt = class {
4320
4343
  this.termRows = (process.stdout.rows ?? 24) - 1;
4321
4344
  this.varsViewH = 0;
4322
4345
  this.wf = wf;
4346
+ this.timing = opts.timing ?? TUI_TIMING;
4323
4347
  makeAutoObservable(this, {
4324
4348
  wf: observableRef,
4325
4349
  hostOverride: observableRef,
4326
4350
  onExit: false,
4351
+ timing: false,
4327
4352
  editor: false,
4328
4353
  picker: false,
4329
4354
  loras: false,
@@ -4572,4 +4597,4 @@ async function runTui(args) {
4572
4597
  //#endregion
4573
4598
  export { runTui };
4574
4599
 
4575
- //# sourceMappingURL=run-tui-CQyvMf0N.js.map
4600
+ //# sourceMappingURL=run-tui-B5uxm2_l.js.map