comfy-ts 2.1.0 → 2.2.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 +65 -225
- package/dist/{DefinedWorkflow-CqNE_kgR.js → DefinedWorkflow-CwHInZgn.js} +4 -3
- package/dist/DefinedWorkflow-CwHInZgn.js.map +1 -0
- package/dist/{DraftsSt-C-gBk9v7.js → DraftsSt-omWuBSej.js} +2 -2
- package/dist/{DraftsSt-C-gBk9v7.js.map → DraftsSt-omWuBSej.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/index.cjs +22 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-CnlN_RFH.js → run-serve-C1oo5ilG.js} +170 -126
- package/dist/run-serve-C1oo5ilG.js.map +1 -0
- package/dist/{run-tui-DXI_Jufu.js → run-tui-CuVst-nc.js} +49 -50
- package/dist/run-tui-CuVst-nc.js.map +1 -0
- package/dist/{state-DC5BcG6d.js → state-CvMt0W1-.js} +23 -7
- package/dist/state-CvMt0W1-.js.map +1 -0
- package/dist/web.d.ts +12 -2
- package/dist/web.js +22 -5
- package/dist/web.js.map +1 -1
- package/examples/README.md +6 -18
- package/examples/images/README.md +2 -6
- package/guide-for-agents.md +25 -84
- package/package.json +1 -1
- package/src/cli/serve/ServeApp.ts +17 -11
- package/src/cli/serve/applyVarPayload.ts +91 -71
- package/src/cli/serve/describeVar.ts +57 -28
- package/src/cli/tui/components/StatusBar.tsx +1 -0
- package/src/cli/tui/components/TextOverlay.tsx +7 -3
- package/src/cli/tui/components/VarsPanel.tsx +2 -2
- package/src/cli/tui/state/ExecSt.ts +47 -52
- package/src/cli/tui/state/TuiSt.ts +11 -6
- package/src/host/ComfyHost.ts +5 -1
- package/src/runner/ComfyExecution.ts +15 -7
- package/src/runner/outputPath.ts +11 -0
- package/src/vars/ComfyVars.ts +12 -2
- package/dist/DefinedWorkflow-CqNE_kgR.js.map +0 -1
- package/dist/run-serve-CnlN_RFH.js.map +0 -1
- package/dist/run-tui-DXI_Jufu.js.map +0 -1
- package/dist/state-DC5BcG6d.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
2
2
|
import { basename, join } from "pathe";
|
|
3
3
|
import { scope, type } from "arktype";
|
|
4
4
|
import { nanoid } from "nanoid";
|
|
@@ -884,7 +884,7 @@ var ComfySchema = class {
|
|
|
884
884
|
};
|
|
885
885
|
//#endregion
|
|
886
886
|
//#region package.json
|
|
887
|
-
var version = "2.
|
|
887
|
+
var version = "2.2.0";
|
|
888
888
|
//#endregion
|
|
889
889
|
//#region src/litegraph/LiteGraphLinkID.ts
|
|
890
890
|
const asLiteGraphLinkID = (id) => id;
|
|
@@ -2232,6 +2232,15 @@ const localOutputPath = (p) => {
|
|
|
2232
2232
|
].filter((x) => x != null).join("_") + ext;
|
|
2233
2233
|
return dir === "" ? name : `${dir}/${name}`;
|
|
2234
2234
|
};
|
|
2235
|
+
/** REPLACE the extension (never append one): a re-encoded save owns its whole
|
|
2236
|
+
* name now that local naming is ours, so `save: {format:'image/webp'}` writes
|
|
2237
|
+
* `shot_20260731-154210_00001.webp`, not `…_00001.png.webp` — appending
|
|
2238
|
+
* described the bytes twice and the first description was a lie */
|
|
2239
|
+
const withExtension = (path, ext) => {
|
|
2240
|
+
const slash = path.lastIndexOf("/");
|
|
2241
|
+
const dot = path.lastIndexOf(".");
|
|
2242
|
+
return `${dot > slash ? path.slice(0, dot) : path}.${ext}`;
|
|
2243
|
+
};
|
|
2235
2244
|
/**
|
|
2236
2245
|
* never-overwrite guard: bump `-2`, `-3`, … while the path exists on disk OR
|
|
2237
2246
|
* was already CLAIMED by a still-downloading retrieval (two same-second runs
|
|
@@ -2619,7 +2628,9 @@ var MediaImage = class MediaImage {
|
|
|
2619
2628
|
//#endregion
|
|
2620
2629
|
//#region src/runner/ComfyExecution.ts
|
|
2621
2630
|
/** paths claimed by in-flight retrievals: two same-second runs on a
|
|
2622
|
-
* counter-resetting cloud host compute the same name before either writes
|
|
2631
|
+
* counter-resetting cloud host compute the same name before either writes.
|
|
2632
|
+
* A claim is released as soon as the write lands (the file itself then holds
|
|
2633
|
+
* the name) or fails (the name is free again) — the set never accumulates */
|
|
2623
2634
|
const CLAIMED_OUTPUT_PATHS = /* @__PURE__ */ new Set();
|
|
2624
2635
|
var ComfyExecution = class {
|
|
2625
2636
|
get host() {
|
|
@@ -2746,14 +2757,18 @@ var ComfyExecution = class {
|
|
|
2746
2757
|
filename: p.filename,
|
|
2747
2758
|
timestamp: runTimestamp(new Date(this.startedAt))
|
|
2748
2759
|
}));
|
|
2749
|
-
if (reencode) absPath
|
|
2760
|
+
if (reencode) absPath = withExtension(absPath, bang(bang(p.sf.format).split("/")[1]));
|
|
2750
2761
|
const storage = getComfyStorage();
|
|
2751
2762
|
absPath = uniquifyOutputPath({
|
|
2752
2763
|
path: absPath,
|
|
2753
2764
|
exists: (x) => storage.exists(x),
|
|
2754
2765
|
claimed: CLAIMED_OUTPUT_PATHS
|
|
2755
2766
|
});
|
|
2756
|
-
|
|
2767
|
+
try {
|
|
2768
|
+
storage.writeBytes(asAbsolutePath(absPath), bytes);
|
|
2769
|
+
} finally {
|
|
2770
|
+
CLAIMED_OUTPUT_PATHS.delete(absPath);
|
|
2771
|
+
}
|
|
2757
2772
|
return {
|
|
2758
2773
|
path: asAbsolutePath(absPath),
|
|
2759
2774
|
bytes
|
|
@@ -4172,6 +4187,7 @@ var ComfyHost = class {
|
|
|
4172
4187
|
mime: frame.mime
|
|
4173
4188
|
});
|
|
4174
4189
|
}
|
|
4190
|
+
if (this.latentPreview != null) URL.revokeObjectURL(this.latentPreview.url);
|
|
4175
4191
|
const imageBlob = new Blob([frame.bytes], { type: frame.mime });
|
|
4176
4192
|
this.latentPreview = {
|
|
4177
4193
|
blob: imageBlob,
|
|
@@ -4882,6 +4898,6 @@ var ComfyTS = class ComfyTS {
|
|
|
4882
4898
|
}
|
|
4883
4899
|
};
|
|
4884
4900
|
//#endregion
|
|
4885
|
-
export {
|
|
4901
|
+
export { importSharp as a, stripAnsi as i, settingsPathFor as n, ComfySchema as o, readableStringify as r, sha1HexOfString as s, ComfyTS as t };
|
|
4886
4902
|
|
|
4887
|
-
//# sourceMappingURL=state-
|
|
4903
|
+
//# sourceMappingURL=state-CvMt0W1-.js.map
|