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.
- package/README.md +13 -0
- package/dist/{DefinedWorkflow-CwHInZgn.js → DefinedWorkflow-QrhT6V66.js} +441 -9
- package/dist/DefinedWorkflow-QrhT6V66.js.map +1 -0
- package/dist/{DraftsSt-omWuBSej.js → DraftsSt-D9Fhk4qR.js} +2 -2
- package/dist/{DraftsSt-omWuBSej.js.map → DraftsSt-D9Fhk4qR.js.map} +1 -1
- package/dist/cli.js +116 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +260 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +132 -9
- package/dist/index.d.ts +132 -9
- package/dist/index.js +249 -24
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-CfzOH-AR.js → run-serve-C9E8dyLP.js} +3 -3
- package/dist/run-serve-C9E8dyLP.js.map +1 -0
- package/dist/{run-tui-_LD0DoGe.js → run-tui-cawSJuuh.js} +60 -121
- package/dist/run-tui-cawSJuuh.js.map +1 -0
- package/dist/{state-C-OOEcp3.js → state-BbKuSDCV.js} +7 -76
- package/dist/state-BbKuSDCV.js.map +1 -0
- package/dist/web.d.ts +132 -9
- package/dist/web.js +249 -24
- package/dist/web.js.map +1 -1
- package/guide-for-agents.md +3 -0
- package/package.json +2 -1
- package/src/cli/comfy-ts-cli.ts +16 -1
- package/src/cli/flags.ts +14 -0
- package/src/cli/gen.ts +2 -4
- package/src/cli/loras.ts +113 -0
- package/src/cli/serve/applyVarPayload.ts +1 -1
- package/src/cli/tui/components/LorasOverlay.tsx +18 -5
- package/src/cli/tui/components/StatusBar.tsx +1 -0
- package/src/cli/tui/components/TuiApp.tsx +1 -0
- package/src/cli/tui/imageClipboard.ts +3 -3
- package/src/cli/tui/protocolImagePainter.ts +1 -1
- package/src/cli/tui/run-tui.tsx +2 -2
- package/src/cli/tui/state/ExecSt.ts +2 -2
- package/src/cli/tui/state/HostSt.ts +1 -1
- package/src/cli/tui/state/LorasSt.ts +60 -15
- package/src/cli/tui/state/PreviewSt.ts +1 -1
- package/src/cli/tui/state/SettingsSt.ts +1 -1
- package/src/coreExports.ts +20 -1
- package/src/host/ComfyHost.ts +1 -1
- package/src/host/loraInfoCache.ts +216 -0
- package/src/host/loraManagerApi.ts +131 -27
- package/src/runner/ComfyExecution.ts +1 -1
- package/src/runner/outputPath.ts +3 -3
- package/src/utils/isRecord.ts +4 -0
- package/src/vars/ComfyVars.ts +13 -7
- package/src/vars/loraKeywords.ts +48 -5
- package/dist/DefinedWorkflow-CwHInZgn.js.map +0 -1
- package/dist/run-serve-CfzOH-AR.js.map +0 -1
- package/dist/run-tui-_LD0DoGe.js.map +0 -1
- package/dist/state-C-OOEcp3.js.map +0 -1
|
@@ -1,77 +1,8 @@
|
|
|
1
|
-
import {
|
|
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.
|
|
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
|
|
2202
|
-
*
|
|
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
|
|
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,
|
|
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-
|
|
4864
|
+
//# sourceMappingURL=state-BbKuSDCV.js.map
|