comfy-ts 2.13.0 → 2.15.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 (75) hide show
  1. package/README.md +1 -0
  2. package/dist/{LogsSt-CUeo843w.js → LogsSt-C3UIWR-o.js} +2 -2
  3. package/dist/{LogsSt-CUeo843w.js.map → LogsSt-C3UIWR-o.js.map} +1 -1
  4. package/dist/cli.js +4 -4
  5. package/dist/index.cjs +213 -53
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +123 -21
  8. package/dist/index.d.ts +123 -21
  9. package/dist/index.js +207 -54
  10. package/dist/index.js.map +1 -1
  11. package/dist/{run-serve-DlRBv_Nk.js → run-serve-B5PfIuhK.js} +310 -88
  12. package/dist/run-serve-B5PfIuhK.js.map +1 -0
  13. package/dist/{run-tui-B5uxm2_l.js → run-tui-D-N4_yyX.js} +15 -9
  14. package/dist/run-tui-D-N4_yyX.js.map +1 -0
  15. package/dist/{schemaDrift-E95iTF7E.js → schemaDrift-BkN8rLiZ.js} +163 -25
  16. package/dist/schemaDrift-BkN8rLiZ.js.map +1 -0
  17. package/dist/serve-web.js +160 -71
  18. package/dist/{state-CUp2J1Zy.js → state-CZsYJqB6.js} +45 -35
  19. package/dist/state-CZsYJqB6.js.map +1 -0
  20. package/dist/web.d.ts +120 -21
  21. package/dist/web.js +196 -51
  22. package/dist/web.js.map +1 -1
  23. package/examples/media/README.md +8 -0
  24. package/examples/media/sine_440hz_3s.flac +0 -0
  25. package/examples/media/testsrc_256x256_3s.mp4 +0 -0
  26. package/examples/rvion/14-video-soundtrack.cflow.ts +47 -0
  27. package/guide-for-agents.md +2 -1
  28. package/package.json +2 -2
  29. package/src/cli/serve/ServeApp.ts +189 -110
  30. package/src/cli/serve/applyVarPayload.ts +5 -3
  31. package/src/cli/serve/describeVar.ts +5 -3
  32. package/src/cli/serve/resultHistory.ts +141 -0
  33. package/src/cli/serve/run-serve.ts +4 -1
  34. package/src/cli/serve/runError.ts +23 -0
  35. package/src/cli/serve/serveSettings.ts +17 -1
  36. package/src/cli/serve/web/api.ts +33 -2
  37. package/src/cli/serve/web/components/App.tsx +6 -4
  38. package/src/cli/serve/web/components/Gallery.tsx +116 -11
  39. package/src/cli/serve/web/components/Icon.tsx +4 -0
  40. package/src/cli/serve/web/components/MemoryBudget.tsx +98 -0
  41. package/src/cli/serve/web/components/RunError.tsx +19 -0
  42. package/src/cli/serve/web/components/ShortcutsModal.tsx +54 -0
  43. package/src/cli/serve/web/components/SideMenu.tsx +14 -0
  44. package/src/cli/serve/web/components/VarsForm.tsx +75 -55
  45. package/src/cli/serve/web/components/controls/BasicControls.tsx +8 -1
  46. package/src/cli/serve/web/components/controls/LorasControl.tsx +6 -3
  47. package/src/cli/serve/web/components/controls/MediaControl.tsx +111 -0
  48. package/src/cli/serve/web/promptEditor/promptExtensions.ts +3 -1
  49. package/src/cli/serve/web/state/FormSt.ts +70 -2
  50. package/src/cli/serve/web/state/RunSt.ts +61 -3
  51. package/src/cli/serve/web/state/WebSt.ts +26 -2
  52. package/src/cli/serve/web/state/formRows.ts +9 -0
  53. package/src/cli/serve/web/state/host.ts +2 -0
  54. package/src/cli/serve/web/state/keptResults.ts +26 -0
  55. package/src/cli/serve/web/state/lightbox.ts +17 -0
  56. package/src/cli/serve/web/state/mediaDrop.ts +76 -0
  57. package/src/cli/serve/web/state/shortcutCatalog.ts +100 -0
  58. package/src/cli/serve/web/state/shortcuts.ts +10 -0
  59. package/src/cli/serve/web/styles.ts +112 -24
  60. package/src/cli/tui/imagePicker/ImagePickerOverlay.tsx +4 -1
  61. package/src/cli/tui/imagePicker/ImagePickerSt.ts +15 -6
  62. package/src/cli/tui/state/TuiSt.ts +1 -1
  63. package/src/coreExports.ts +10 -0
  64. package/src/exampleAssets.ts +13 -3
  65. package/src/host/ComfyUploader.ts +34 -27
  66. package/src/index.ts +1 -1
  67. package/src/runner/ComfyExecution.ts +38 -20
  68. package/src/runner/ComfyWsApi.ts +3 -0
  69. package/src/runner/mediaKinds.ts +51 -0
  70. package/src/vars/ComfyVars.ts +96 -22
  71. package/dist/run-serve-DlRBv_Nk.js.map +0 -1
  72. package/dist/run-tui-B5uxm2_l.js.map +0 -1
  73. package/dist/schemaDrift-E95iTF7E.js.map +0 -1
  74. package/dist/state-CUp2J1Zy.js.map +0 -1
  75. package/src/cli/serve/web/components/controls/ImageControl.tsx +0 -72
@@ -1,6 +1,6 @@
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";
1
+ import { F as fetchLoraList, I as fetchLoraPreviewBytes, J as loraKey, Y as loraPreviewMapFrom, at as extractErrorMessage, dt as logError, f as clearLoraKeywordOverride, g as setLoraKeyword, h as loraKeywordFromMirror, i as summarizeDrift, k as refreshLoraInfoCacheIfChanged, m as isLoraKeywordFromMirror, o as LorasVar, p as getLoraKeyword, q as loraBasename, s as PromptVar, tt as extensionOf, w as loraMatchesFilter, x as getLoraPreviewUrl, y as getLoraDisplayName } from "./schemaDrift-BkN8rLiZ.js";
2
+ import { i as importSharp, n as settingsPathFor } from "./state-CZsYJqB6.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-C3UIWR-o.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";
@@ -1283,7 +1283,7 @@ var ImagePickerSt = class {
1283
1283
  /** kind-narrowing cast sanctioned (agent/coding.md), `kind` is the tag */
1284
1284
  get selectedVar() {
1285
1285
  const sel = this.st.selected?.[1];
1286
- return sel?.kind === "image" ? sel : null;
1286
+ return sel?.kind === "image" || sel?.kind === "audio" || sel?.kind === "video" ? sel : null;
1287
1287
  }
1288
1288
  get folderDisplay() {
1289
1289
  return contractHome(this.folder);
@@ -1326,7 +1326,7 @@ var ImagePickerSt = class {
1326
1326
  error: null
1327
1327
  };
1328
1328
  if (this.pane === "recents") return {
1329
- rows: pickerPrefs().recents.map((img) => ({
1329
+ rows: this.recentsForVar().map((img) => ({
1330
1330
  kind: "image",
1331
1331
  name: contractHome(img),
1332
1332
  path: img,
@@ -1361,6 +1361,10 @@ var ImagePickerSt = class {
1361
1361
  };
1362
1362
  }
1363
1363
  }
1364
+ recentsForVar() {
1365
+ const exts = this.selectedVar?.extensions ?? [];
1366
+ return pickerPrefs().recents.filter((f) => exts.includes(extensionOf(f)));
1367
+ }
1364
1368
  get listingError() {
1365
1369
  return this.paneListing.error;
1366
1370
  }
@@ -1373,8 +1377,10 @@ var ImagePickerSt = class {
1373
1377
  get current() {
1374
1378
  return this.rows[this.ix] ?? null;
1375
1379
  }
1376
- /** feeds the preview reaction: only a real, present image highlights */
1380
+ /** feeds the preview reaction: only a real, present image highlights (an audio or video
1381
+ * row has nothing to paint) */
1377
1382
  get highlightedImage() {
1383
+ if (this.selectedVar?.kind !== "image") return null;
1378
1384
  const row = this.current;
1379
1385
  return row?.kind === "image" && !row.missing ? row.path : null;
1380
1386
  }
@@ -1555,7 +1561,7 @@ const ImagePickerOverlay = observer((p) => {
1555
1561
  }),
1556
1562
  footer: rows.length === 0 ? /* @__PURE__ */ jsx(Text, {
1557
1563
  color: "red",
1558
- children: ip.listingError ?? (ip.filter !== "" ? "no match" : "no images here")
1564
+ children: ip.listingError ?? (ip.filter !== "" ? "no match" : `no ${ip.selectedVar?.kind ?? "image"} files here`)
1559
1565
  }) : void 0
1560
1566
  });
1561
1567
  });
@@ -4498,7 +4504,7 @@ var TuiSt = class {
4498
4504
  else if (sel.kind === "choice") this.picker.beginChoice();
4499
4505
  else if (sel.kind === "size") this.picker.beginSize();
4500
4506
  else if (sel.kind === "loras") this.loras.begin();
4501
- else if (sel.kind === "image") this.imagePicker.begin();
4507
+ else if (sel.kind === "image" || sel.kind === "audio" || sel.kind === "video") this.imagePicker.begin();
4502
4508
  else this.editor.beginInline();
4503
4509
  }
4504
4510
  /** kind-specific nav keys (documented in the keybar): seed `+`/`-`/`=`/`?` mode, `*` reroll */
@@ -4597,4 +4603,4 @@ async function runTui(args) {
4597
4603
  //#endregion
4598
4604
  export { runTui };
4599
4605
 
4600
- //# sourceMappingURL=run-tui-B5uxm2_l.js.map
4606
+ //# sourceMappingURL=run-tui-D-N4_yyX.js.map