comfy-ts 2.22.0 → 2.24.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/dist/{ServeApp-DuxYdaZZ.js → ServeApp-fsHtW5zG.js} +51 -17
- package/dist/ServeApp-fsHtW5zG.js.map +1 -0
- package/dist/cli.js +5 -5
- package/dist/{exampleAssets-1NHndnNB.js → exampleAssets-DZynSkZm.js} +405 -39
- package/dist/exampleAssets-DZynSkZm.js.map +1 -0
- package/dist/{findDefinedWorkflow-CRsBTTJK.js → findDefinedWorkflow-qyqFea7q.js} +2 -2
- package/dist/{findDefinedWorkflow-CRsBTTJK.js.map → findDefinedWorkflow-qyqFea7q.js.map} +1 -1
- package/dist/index.cjs +428 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +147 -1
- package/dist/index.d.ts +147 -1
- package/dist/index.js +428 -47
- package/dist/index.js.map +1 -1
- package/dist/{run-run-Y5ZI48vV.js → run-run-Cn2JzKlE.js} +5 -5
- package/dist/{run-run-Y5ZI48vV.js.map → run-run-Cn2JzKlE.js.map} +1 -1
- package/dist/{run-serve-CICU_wTL.js → run-serve-BhGegaCI.js} +4 -4
- package/dist/{run-serve-CICU_wTL.js.map → run-serve-BhGegaCI.js.map} +1 -1
- package/dist/{run-tui-CViJXsHL.js → run-tui-CrM4ijkH.js} +4 -4
- package/dist/{run-tui-CViJXsHL.js.map → run-tui-CrM4ijkH.js.map} +1 -1
- package/dist/{schemaDrift-CzjaIwZX.js → schemaDrift-BGYJZGMD.js} +18 -3
- package/dist/{schemaDrift-CzjaIwZX.js.map → schemaDrift-BGYJZGMD.js.map} +1 -1
- package/dist/serve-web.js +46 -43
- package/dist/web.d.ts +147 -1
- package/dist/web.js +428 -47
- package/dist/web.js.map +1 -1
- package/examples/README.md +1 -0
- package/examples/comfy-cloud/sdk.d.ts +102 -1
- package/examples/depth-explorer/models.ts +6 -56
- package/examples/depth-explorer/serve.ts +12 -133
- package/examples/depth-explorer/web/App.tsx +20 -91
- package/examples/depth-explorer/web/index.html +1 -0
- package/examples/depth-explorer/web/state.ts +26 -109
- package/examples/depth-explorer/web/styles.css +1 -286
- package/examples/explorer-kit/catalog.ts +80 -0
- package/examples/explorer-kit/server.ts +167 -0
- package/examples/explorer-kit/web/base.css +289 -0
- package/examples/explorer-kit/web/runs.ts +160 -0
- package/examples/explorer-kit/web/ui.tsx +125 -0
- package/examples/rvion/17-relight.cflow.ts +2 -1
- package/examples/rvion/18-world.cflow.ts +101 -0
- package/examples/rvion/19-flythrough.cflow.ts +312 -0
- package/examples/rvion/20-grow-splat.cflow.ts +88 -0
- package/examples/rvion/21-photo-to-model.cflow.ts +191 -0
- package/examples/rvion/flythroughChain.ts +171 -0
- package/examples/rvion/flythroughColmap.ts +157 -0
- package/examples/rvion/flythroughFuse.ts +199 -0
- package/examples/rvion/flythroughGuide.ts +300 -0
- package/examples/rvion/flythroughPalette.ts +310 -0
- package/examples/rvion/flythroughPath.ts +177 -0
- package/examples/rvion/flythroughSplat.ts +73 -0
- package/examples/rvion/grow-splat/align.ts +114 -0
- package/examples/rvion/grow-splat/grow.ts +198 -0
- package/examples/rvion/grow-splat/ply.ts +166 -0
- package/examples/rvion/grow-splat/raster.ts +207 -0
- package/examples/rvion/grow-splat/sharp.ts +45 -0
- package/examples/rvion/splatDataset.ts +80 -0
- package/examples/rvion/splatEval.ts +380 -0
- package/examples/upscale-explorer/models.ts +341 -0
- package/examples/upscale-explorer/serve.ts +19 -0
- package/examples/upscale-explorer/web/App.tsx +250 -0
- package/examples/upscale-explorer/web/compare.tsx +285 -0
- package/examples/upscale-explorer/web/index.html +15 -0
- package/examples/upscale-explorer/web/main.tsx +12 -0
- package/examples/upscale-explorer/web/state.ts +279 -0
- package/examples/upscale-explorer/web/styles.css +241 -0
- package/examples/upscale-explorer/web/tsconfig.json +16 -0
- package/examples/upscale-explorer/web/viewport.tsx +130 -0
- package/examples/world-explorer/serve.ts +171 -0
- package/examples/world-explorer/web/index.html +14 -0
- package/examples/world-explorer/web/main.tsx +200 -0
- package/examples/world-explorer/web/state.ts +212 -0
- package/examples/world-explorer/web/styles.css +131 -0
- package/examples/world-explorer/web/thumb.ts +21 -0
- package/examples/world-explorer/web/tsconfig.json +11 -0
- package/examples/world-explorer/world-state.ts +40 -0
- package/package.json +7 -8
- package/src/cli/serve/ServeApp.ts +27 -2
- package/src/cli/serve/resultHistory.ts +22 -4
- package/src/cli/serve/thumbs.ts +19 -8
- package/src/cli/serve/web/api.ts +4 -0
- package/src/cli/serve/web/components/Gallery.tsx +24 -1
- package/src/cli/serve/web/styles.ts +3 -0
- package/src/coreExports.ts +6 -0
- package/src/graph/ComfyNode.ts +12 -2
- package/src/host/ComfyHost.ts +159 -2
- package/src/host/ResilientWebsocket.ts +10 -0
- package/src/manager/script-update-manager.bun.ts +0 -7
- package/src/runner/ComfyExecution.ts +185 -23
- package/src/runner/ComfyWorkflow.ts +22 -0
- package/src/runner/ComfyWsApi.ts +3 -1
- package/src/runner/comfyOrgApiKey.ts +44 -0
- package/src/runner/historyReplay.ts +53 -0
- package/src/runner/outputs3d.ts +18 -0
- package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +2 -0
- package/src/sdk-generator/comfyui-sdk-codegen.ts +7 -2
- package/src/state.ts +2 -0
- package/src/vars/DefinedWorkflow.ts +1 -0
- package/dist/ServeApp-DuxYdaZZ.js.map +0 -1
- package/dist/exampleAssets-1NHndnNB.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { d as isDraftMetaKey, l as assembleLogChunks, o as draftsDirForFile, s as listDraftsForFile, u as ENHANCE_KEY } from "./findDefinedWorkflow-
|
|
1
|
+
import { $ as MODEL_3D_MIMES, A as reloadLoraInfoCache, B as lmFileSize, C as getLoraTriggers, E as lorasMissingFromMirror, F as fetchLoraList, G as lmTags, I as fetchLoraPreviewBytes, J as loraKey, L as lmBaseModel, M as fetchLoraCivitai, N as fetchLoraDescription, O as recordCivitaiMiss, P as fetchLoraExampleImages, R as lmCivitai, S as getLoraTriggerWords, T as loraMirrorEntries, U as lmNotes, V as lmFolder, W as lmSha256, X as ansi, Y as loraPreviewMapFrom, _ as buildLoraMirror, _t as sha1HexOfString, b as getLoraInfo, c as isLoraLanes, d as isLoraStrength, gt as statelessRegex, i as summarizeDrift, j as writeLoraMirror, k as refreshLoraInfoCacheIfChanged, l as isLorasInput, lt as bang, nt as MEDIA_KINDS, p as getLoraKeyword, r as driftChanged, st as importSharp, tt as DEFAULT_MEDIA_EXTENSIONS, u as isPromptInput, v as getLoraAddedAt, vt as extractErrorMessage, x as getLoraPreviewUrl, y as getLoraDisplayName, z as lmFilePath } from "./schemaDrift-BGYJZGMD.js";
|
|
2
|
+
import { d as isDraftMetaKey, l as assembleLogChunks, o as draftsDirForFile, s as listDraftsForFile, u as ENHANCE_KEY } from "./findDefinedWorkflow-qyqFea7q.js";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -150,6 +150,21 @@ const isHttpUrl = (s) => /^https?:\/\//i.test(s);
|
|
|
150
150
|
function thumbUrl(abs, width = 160) {
|
|
151
151
|
return `/thumb?src=${encodeURIComponent(abs)}&w=${width}`;
|
|
152
152
|
}
|
|
153
|
+
/** Bun's own image pipeline when the server runs on Bun, sharp only under Node (the cli runs on
|
|
154
|
+
* both). Both read the EXIF orientation */
|
|
155
|
+
async function webpThumb(path, width) {
|
|
156
|
+
if (typeof Bun !== "undefined") return new Bun.Image(path).resize(width, width, {
|
|
157
|
+
fit: "inside",
|
|
158
|
+
withoutEnlargement: true
|
|
159
|
+
}).webp({ quality: 78 }).bytes();
|
|
160
|
+
const sharp = await importSharp("a thumbnail");
|
|
161
|
+
return new Uint8Array(await sharp(path).rotate().resize({
|
|
162
|
+
width,
|
|
163
|
+
height: width,
|
|
164
|
+
fit: "inside",
|
|
165
|
+
withoutEnlargement: true
|
|
166
|
+
}).webp({ quality: 78 }).toBuffer());
|
|
167
|
+
}
|
|
153
168
|
const MAX_WIDTH = 640;
|
|
154
169
|
const MAX_CACHED = 400;
|
|
155
170
|
var ThumbStore = class {
|
|
@@ -182,13 +197,7 @@ var ThumbStore = class {
|
|
|
182
197
|
const key = `${p}|${statSync(p).mtimeMs}|${w}`;
|
|
183
198
|
const hit = this.cache.get(key);
|
|
184
199
|
if (hit != null) return hit;
|
|
185
|
-
const
|
|
186
|
-
const bytes = new Uint8Array(await sharp(p).rotate().resize({
|
|
187
|
-
width: w,
|
|
188
|
-
height: w,
|
|
189
|
-
fit: "inside",
|
|
190
|
-
withoutEnlargement: true
|
|
191
|
-
}).webp({ quality: 78 }).toBuffer());
|
|
200
|
+
const bytes = await webpThumb(p, w);
|
|
192
201
|
if (this.cache.size >= MAX_CACHED) {
|
|
193
202
|
const oldest = this.cache.keys().next().value;
|
|
194
203
|
if (oldest != null) this.cache.delete(oldest);
|
|
@@ -754,7 +763,8 @@ var ResultHistory = class {
|
|
|
754
763
|
record: p.record,
|
|
755
764
|
imageKeys: p.imageKeys,
|
|
756
765
|
audioKeys: p.audioKeys,
|
|
757
|
-
videoKeys: p.videoKeys ?? []
|
|
766
|
+
videoKeys: p.videoKeys ?? [],
|
|
767
|
+
model3dKeys: p.model3dKeys ?? []
|
|
758
768
|
};
|
|
759
769
|
this.runs = [kept, ...this.runs];
|
|
760
770
|
for (const dropped of this.runs.slice(50)) this.freeRun(dropped);
|
|
@@ -770,7 +780,8 @@ var ResultHistory = class {
|
|
|
770
780
|
...k.record,
|
|
771
781
|
images: k.record.images.map((img, ix) => this.withLiveUrl(img, k.imageKeys[ix])),
|
|
772
782
|
audios: k.record.audios.map((a, ix) => this.withLiveUrl(a, k.audioKeys[ix])),
|
|
773
|
-
videos: (k.record.videos ?? []).map((a, ix) => this.withLiveUrl(a, k.videoKeys[ix]))
|
|
783
|
+
videos: (k.record.videos ?? []).map((a, ix) => this.withLiveUrl(a, k.videoKeys[ix])),
|
|
784
|
+
models3d: (k.record.models3d ?? []).map((a, ix) => this.withLiveUrl(a, k.model3dKeys[ix]))
|
|
774
785
|
}));
|
|
775
786
|
}
|
|
776
787
|
remove(promptId) {
|
|
@@ -807,7 +818,8 @@ var ResultHistory = class {
|
|
|
807
818
|
for (const key of [
|
|
808
819
|
...k.imageKeys,
|
|
809
820
|
...k.audioKeys,
|
|
810
|
-
...k.videoKeys
|
|
821
|
+
...k.videoKeys,
|
|
822
|
+
...k.model3dKeys
|
|
811
823
|
]) {
|
|
812
824
|
if (key == null) continue;
|
|
813
825
|
const b = this.blobs.get(key);
|
|
@@ -828,8 +840,8 @@ var ResultHistory = class {
|
|
|
828
840
|
this.runs = this.runs.filter((k) => {
|
|
829
841
|
const live = (keys) => keys.some((key) => key == null || this.blobs.has(key));
|
|
830
842
|
const hasText = k.record.texts.length > 0;
|
|
831
|
-
const hasNothing = k.record.images.length === 0 && k.record.audios.length === 0 && (k.record.videos ?? []).length === 0;
|
|
832
|
-
return hasText || hasNothing || live(k.imageKeys) || live(k.audioKeys) || live(k.videoKeys);
|
|
843
|
+
const hasNothing = k.record.images.length === 0 && k.record.audios.length === 0 && (k.record.videos ?? []).length === 0 && (k.record.models3d ?? []).length === 0;
|
|
844
|
+
return hasText || hasNothing || live(k.imageKeys) || live(k.audioKeys) || live(k.videoKeys) || live(k.model3dKeys);
|
|
833
845
|
});
|
|
834
846
|
}
|
|
835
847
|
};
|
|
@@ -1080,7 +1092,8 @@ const CONTENT_TYPES = {
|
|
|
1080
1092
|
".wav": "audio/wav",
|
|
1081
1093
|
".m4a": "audio/mp4",
|
|
1082
1094
|
".json": "application/json",
|
|
1083
|
-
".txt": "text/plain"
|
|
1095
|
+
".txt": "text/plain",
|
|
1096
|
+
...Object.fromEntries(Object.entries(MODEL_3D_MIMES).map(([ext, mime]) => [`.${ext}`, mime]))
|
|
1084
1097
|
};
|
|
1085
1098
|
/** magic-byte sniff for the preview proxy — fetchLoraPreviewBytes already guarantees an image */
|
|
1086
1099
|
function sniffImageContentType(bytes) {
|
|
@@ -1146,7 +1159,7 @@ const USAGE = [
|
|
|
1146
1159
|
"DELETE /drafts/<module>/<draft> — delete that draft file",
|
|
1147
1160
|
"GET /run/<module> — live run status · /run/<module>/preview — latent preview bytes",
|
|
1148
1161
|
"POST /upload with {\"name\",\"dataBase64\"} — store a browser file for an image, audio or video var",
|
|
1149
|
-
"GET /images|audio|video/<promptId>/<ix> — an output kept in memory (saving off)",
|
|
1162
|
+
"GET /images|audio|video|model3d/<promptId>/<ix> — an output kept in memory (saving off)",
|
|
1150
1163
|
"GET /tags/<module>/<var>?q=<text>&limit=<n> — tag completion from the list a prompt var declares (`tags`)",
|
|
1151
1164
|
"GET /hosts/<hostId>/drift[?full=1] — what changed on the host since the schema was loaded (model files; node types with full=1)",
|
|
1152
1165
|
"GET /lora-info/<hostId>/<lora> — display name + trigger words (local mirror)",
|
|
@@ -1273,6 +1286,7 @@ var ServeApp = class {
|
|
|
1273
1286
|
if (segs[0] === "images" && segs.length === 3 && segs[1] != null && segs[2] != null) return this.replyMemoryImage(`${segs[1]}/${segs[2]}`);
|
|
1274
1287
|
if (segs[0] === "audio" && segs.length === 3 && segs[1] != null && segs[2] != null) return this.replyMemoryImage(`audio/${segs[1]}/${segs[2]}`);
|
|
1275
1288
|
if (segs[0] === "video" && segs.length === 3 && segs[1] != null && segs[2] != null) return this.replyMemoryImage(`video/${segs[1]}/${segs[2]}`);
|
|
1289
|
+
if (segs[0] === "model3d" && segs.length === 3 && segs[1] != null && segs[2] != null) return this.replyMemoryImage(`model3d/${segs[1]}/${segs[2]}`);
|
|
1276
1290
|
if (segs[0] === "results" && segs.length === 1) return json(200, {
|
|
1277
1291
|
runs: this.kept.list(),
|
|
1278
1292
|
memory: this.kept.usage()
|
|
@@ -2400,6 +2414,8 @@ var ServeApp = class {
|
|
|
2400
2414
|
if (audios.length > 0) produced.push(`${audios.length} audio(s)`);
|
|
2401
2415
|
const videos = execution.videos ?? [];
|
|
2402
2416
|
if (videos.length > 0) produced.push(`${videos.length} video(s)`);
|
|
2417
|
+
const models3d = execution.models3d ?? [];
|
|
2418
|
+
if (models3d.length > 0) produced.push(`${models3d.length} 3d model(s)`);
|
|
2403
2419
|
if ((execution.texts ?? []).length > 0) produced.push(`${(execution.texts ?? []).length} text(s)`);
|
|
2404
2420
|
console.log(`[serve] 🟢 ${mod.key}/${draft} done in ${(durationMs / 1e3).toFixed(1)}s · ${produced.join(" · ")}`);
|
|
2405
2421
|
const blobs = [];
|
|
@@ -2421,6 +2437,12 @@ var ServeApp = class {
|
|
|
2421
2437
|
blobs.push(this.memoryBlob(key, a.bytes, a.filename));
|
|
2422
2438
|
return key;
|
|
2423
2439
|
});
|
|
2440
|
+
const model3dKeys = models3d.map((m, ix) => {
|
|
2441
|
+
if (m.absPath != null) return null;
|
|
2442
|
+
const key = `model3d/${execution.data.id}/${ix}`;
|
|
2443
|
+
blobs.push(this.memoryBlob(key, m.bytes, m.filename));
|
|
2444
|
+
return key;
|
|
2445
|
+
});
|
|
2424
2446
|
const memoryUrl = (route, key) => `/${route}/${key.split("/").slice(route === "images" ? 0 : 1).map((seg) => encodeURIComponent(seg)).join("/")}`;
|
|
2425
2447
|
const record = {
|
|
2426
2448
|
ok: true,
|
|
@@ -2462,6 +2484,17 @@ var ServeApp = class {
|
|
|
2462
2484
|
absPath: a.absPath
|
|
2463
2485
|
};
|
|
2464
2486
|
}),
|
|
2487
|
+
models3d: models3d.map((m, ix) => {
|
|
2488
|
+
const key = model3dKeys[ix];
|
|
2489
|
+
return {
|
|
2490
|
+
filename: m.filename,
|
|
2491
|
+
mime: m.mime,
|
|
2492
|
+
format: m.format,
|
|
2493
|
+
size: m.bytes.byteLength,
|
|
2494
|
+
url: m.absPath != null ? this.outputUrl(m.absPath) : key != null ? memoryUrl("model3d", key) : null,
|
|
2495
|
+
absPath: m.absPath
|
|
2496
|
+
};
|
|
2497
|
+
}),
|
|
2465
2498
|
...mod.dw.spec.widgets != null && mod.dw.spec.widgets.length > 0 ? { widgets: mod.dw.spec.widgets } : {}
|
|
2466
2499
|
};
|
|
2467
2500
|
this.kept.add({
|
|
@@ -2469,6 +2502,7 @@ var ServeApp = class {
|
|
|
2469
2502
|
imageKeys,
|
|
2470
2503
|
audioKeys,
|
|
2471
2504
|
videoKeys,
|
|
2505
|
+
model3dKeys,
|
|
2472
2506
|
blobs
|
|
2473
2507
|
});
|
|
2474
2508
|
const first = execution.images[0];
|
|
@@ -2652,4 +2686,4 @@ var ServeApp = class {
|
|
|
2652
2686
|
//#endregion
|
|
2653
2687
|
export { describeVar as n, renderDescriptorLine as r, ServeApp as t };
|
|
2654
2688
|
|
|
2655
|
-
//# sourceMappingURL=ServeApp-
|
|
2689
|
+
//# sourceMappingURL=ServeApp-fsHtW5zG.js.map
|