comfy-ts 2.3.0 → 2.4.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 (53) hide show
  1. package/README.md +13 -0
  2. package/dist/{DefinedWorkflow-CwHInZgn.js → DefinedWorkflow-QrhT6V66.js} +441 -9
  3. package/dist/DefinedWorkflow-QrhT6V66.js.map +1 -0
  4. package/dist/{DraftsSt-omWuBSej.js → DraftsSt-D9Fhk4qR.js} +2 -2
  5. package/dist/{DraftsSt-omWuBSej.js.map → DraftsSt-D9Fhk4qR.js.map} +1 -1
  6. package/dist/cli.js +116 -8
  7. package/dist/cli.js.map +1 -1
  8. package/dist/index.cjs +260 -23
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +132 -9
  11. package/dist/index.d.ts +132 -9
  12. package/dist/index.js +249 -24
  13. package/dist/index.js.map +1 -1
  14. package/dist/{run-serve-CfzOH-AR.js → run-serve-C9E8dyLP.js} +3 -3
  15. package/dist/run-serve-C9E8dyLP.js.map +1 -0
  16. package/dist/{run-tui-_LD0DoGe.js → run-tui-cawSJuuh.js} +60 -121
  17. package/dist/run-tui-cawSJuuh.js.map +1 -0
  18. package/dist/{state-C-OOEcp3.js → state-BbKuSDCV.js} +7 -76
  19. package/dist/state-BbKuSDCV.js.map +1 -0
  20. package/dist/web.d.ts +132 -9
  21. package/dist/web.js +249 -24
  22. package/dist/web.js.map +1 -1
  23. package/guide-for-agents.md +3 -0
  24. package/package.json +2 -1
  25. package/src/cli/comfy-ts-cli.ts +16 -1
  26. package/src/cli/flags.ts +14 -0
  27. package/src/cli/gen.ts +2 -4
  28. package/src/cli/loras.ts +113 -0
  29. package/src/cli/serve/applyVarPayload.ts +1 -1
  30. package/src/cli/tui/components/LorasOverlay.tsx +18 -5
  31. package/src/cli/tui/components/StatusBar.tsx +1 -0
  32. package/src/cli/tui/components/TuiApp.tsx +1 -0
  33. package/src/cli/tui/imageClipboard.ts +3 -3
  34. package/src/cli/tui/protocolImagePainter.ts +1 -1
  35. package/src/cli/tui/run-tui.tsx +2 -2
  36. package/src/cli/tui/state/ExecSt.ts +2 -2
  37. package/src/cli/tui/state/HostSt.ts +1 -1
  38. package/src/cli/tui/state/LorasSt.ts +60 -15
  39. package/src/cli/tui/state/PreviewSt.ts +1 -1
  40. package/src/cli/tui/state/SettingsSt.ts +1 -1
  41. package/src/coreExports.ts +20 -1
  42. package/src/host/ComfyHost.ts +1 -1
  43. package/src/host/loraInfoCache.ts +216 -0
  44. package/src/host/loraManagerApi.ts +131 -27
  45. package/src/runner/ComfyExecution.ts +1 -1
  46. package/src/runner/outputPath.ts +3 -3
  47. package/src/utils/isRecord.ts +4 -0
  48. package/src/vars/ComfyVars.ts +13 -7
  49. package/src/vars/loraKeywords.ts +48 -5
  50. package/dist/DefinedWorkflow-CwHInZgn.js.map +0 -1
  51. package/dist/run-serve-CfzOH-AR.js.map +0 -1
  52. package/dist/run-tui-_LD0DoGe.js.map +0 -1
  53. package/dist/state-C-OOEcp3.js.map +0 -1
@@ -1,77 +1,8 @@
1
- import { c as resolveComfyStorage, d as logInfo, f as logSuccess, l as isQuiet, o as extractErrorMessage, s as getComfyStorage, t as DefinedWorkflow, u as logError } from "./DefinedWorkflow-CwHInZgn.js";
1
+ import { A as sha1HexOfString, C as getComfyStorage, D as logInfo, E as logError, O as logSuccess, S as extractErrorMessage, T as isQuiet, k as sha1Hex, t as DefinedWorkflow, w as resolveComfyStorage } from "./DefinedWorkflow-QrhT6V66.js";
2
2
  import { basename, join } from "pathe";
3
3
  import { scope, type } from "arktype";
4
4
  import { nanoid } from "nanoid";
5
5
  import { imageMeta } from "image-meta";
6
- //#region src/utils/sha1.ts
7
- function sha1Hex(data) {
8
- const ml = data.length;
9
- const total = Math.ceil((ml + 1 + 8) / 64) * 64;
10
- const bytes = new Uint8Array(total);
11
- bytes.set(data);
12
- bytes[ml] = 128;
13
- const dv = new DataView(bytes.buffer);
14
- const bitLen = ml * 8;
15
- dv.setUint32(total - 8, Math.floor(bitLen / 2 ** 32));
16
- dv.setUint32(total - 4, bitLen >>> 0);
17
- let h0 = 1732584193;
18
- let h1 = 4023233417;
19
- let h2 = 2562383102;
20
- let h3 = 271733878;
21
- let h4 = 3285377520;
22
- const w = /* @__PURE__ */ new Uint32Array(80);
23
- for (let i = 0; i < total; i += 64) {
24
- for (let j = 0; j < 16; j++) w[j] = dv.getUint32(i + j * 4);
25
- for (let j = 16; j < 80; j++) {
26
- const n = (w[j - 3] ?? 0) ^ (w[j - 8] ?? 0) ^ (w[j - 14] ?? 0) ^ (w[j - 16] ?? 0);
27
- w[j] = n << 1 | n >>> 31;
28
- }
29
- let a = h0;
30
- let b = h1;
31
- let c = h2;
32
- let d = h3;
33
- let e = h4;
34
- for (let j = 0; j < 80; j++) {
35
- let f;
36
- let k;
37
- if (j < 20) {
38
- f = b & c | ~b & d;
39
- k = 1518500249;
40
- } else if (j < 40) {
41
- f = b ^ c ^ d;
42
- k = 1859775393;
43
- } else if (j < 60) {
44
- f = b & c | b & d | c & d;
45
- k = 2400959708;
46
- } else {
47
- f = b ^ c ^ d;
48
- k = 3395469782;
49
- }
50
- const temp = (a << 5 | a >>> 27) + f + e + k + (w[j] ?? 0) >>> 0;
51
- e = d;
52
- d = c;
53
- c = b << 30 | b >>> 2;
54
- b = a;
55
- a = temp;
56
- }
57
- h0 = h0 + a >>> 0;
58
- h1 = h1 + b >>> 0;
59
- h2 = h2 + c >>> 0;
60
- h3 = h3 + d >>> 0;
61
- h4 = h4 + e >>> 0;
62
- }
63
- return [
64
- h0,
65
- h1,
66
- h2,
67
- h3,
68
- h4
69
- ].map((x) => x.toString(16).padStart(8, "0")).join("");
70
- }
71
- function sha1HexOfString(s) {
72
- return sha1Hex(new TextEncoder().encode(s));
73
- }
74
- //#endregion
75
6
  //#region src/sdk-generator/_getUnionNameBasedOnFirstFoundEnumName.ts
76
7
  /** having a bunch of sensible default will help slightly */
77
8
  function getUnionNameBasedOnFirstFoundEnumName(enumName, hash, hashContent) {
@@ -884,7 +815,7 @@ var ComfySchema = class {
884
815
  };
885
816
  //#endregion
886
817
  //#region package.json
887
- var version = "2.3.0";
818
+ var version = "2.4.0";
888
819
  //#endregion
889
820
  //#region src/litegraph/LiteGraphLinkID.ts
890
821
  const asLiteGraphLinkID = (id) => id;
@@ -2198,8 +2129,8 @@ var LiteGraphCtx = class {
2198
2129
  //#endregion
2199
2130
  //#region src/runner/outputPath.ts
2200
2131
  /**
2201
- * local output naming, relative to `.comfy-ts/outputs/` (his repro
2202
- * 2026-07-31): the server filename is NOT unique — cloud hosts reset the
2132
+ * local output naming, relative to `.comfy-ts/outputs/`:
2133
+ * the server filename is NOT unique — cloud hosts reset the
2203
2134
  * `_00001_` counter every run, so trusting it overwrote the same file — and
2204
2135
  * a `foo/krea/` prefix means the DIRECTORY foo/krea/, not a `krea_` name
2205
2136
  * prefix. Local names are ours: dir from the prompt's own filename_prefix
@@ -2244,7 +2175,7 @@ const withExtension = (path, ext) => {
2244
2175
  /**
2245
2176
  * never-overwrite guard: bump `-2`, `-3`, … while the path exists on disk OR
2246
2177
  * was already CLAIMED by a still-downloading retrieval (two same-second runs
2247
- * on a counter-resetting cloud host compute the same name — reviewer catch).
2178
+ * on a counter-resetting cloud host compute the same name).
2248
2179
  * The chosen path is claimed before returning.
2249
2180
  */
2250
2181
  const uniquifyOutputPath = (p) => {
@@ -4928,6 +4859,6 @@ var ComfyTS = class ComfyTS {
4928
4859
  }
4929
4860
  };
4930
4861
  //#endregion
4931
- export { importSharp as a, stripAnsi as i, settingsPathFor as n, ComfySchema as o, readableStringify as r, sha1HexOfString as s, ComfyTS as t };
4862
+ export { importSharp as a, stripAnsi as i, settingsPathFor as n, ComfySchema as o, readableStringify as r, ComfyTS as t };
4932
4863
 
4933
- //# sourceMappingURL=state-C-OOEcp3.js.map
4864
+ //# sourceMappingURL=state-BbKuSDCV.js.map