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
package/dist/web.d.ts
CHANGED
|
@@ -12234,6 +12234,7 @@ declare const types$1: import("arktype").Module<{
|
|
|
12234
12234
|
client_id: string;
|
|
12235
12235
|
extra_data: {
|
|
12236
12236
|
extra_pnginfo: unknown;
|
|
12237
|
+
api_key_comfy_org?: string | undefined;
|
|
12237
12238
|
};
|
|
12238
12239
|
prompt: unknown;
|
|
12239
12240
|
};
|
|
@@ -12318,6 +12319,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12318
12319
|
subfolder: string;
|
|
12319
12320
|
type: string;
|
|
12320
12321
|
}[] | undefined;
|
|
12322
|
+
'3d'?: {
|
|
12323
|
+
filename: string;
|
|
12324
|
+
subfolder: string;
|
|
12325
|
+
type: string;
|
|
12326
|
+
}[] | undefined;
|
|
12321
12327
|
text?: unknown[] | undefined;
|
|
12322
12328
|
} | null;
|
|
12323
12329
|
prompt_id: PromptID;
|
|
@@ -12417,6 +12423,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12417
12423
|
subfolder: string;
|
|
12418
12424
|
type: string;
|
|
12419
12425
|
}[] | undefined;
|
|
12426
|
+
'3d'?: {
|
|
12427
|
+
filename: string;
|
|
12428
|
+
subfolder: string;
|
|
12429
|
+
type: string;
|
|
12430
|
+
}[] | undefined;
|
|
12420
12431
|
text?: unknown[] | undefined;
|
|
12421
12432
|
} | null;
|
|
12422
12433
|
prompt_id: PromptID;
|
|
@@ -12502,6 +12513,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12502
12513
|
subfolder: string;
|
|
12503
12514
|
type: string;
|
|
12504
12515
|
}[] | undefined;
|
|
12516
|
+
'3d'?: {
|
|
12517
|
+
filename: string;
|
|
12518
|
+
subfolder: string;
|
|
12519
|
+
type: string;
|
|
12520
|
+
}[] | undefined;
|
|
12505
12521
|
text?: unknown[] | undefined;
|
|
12506
12522
|
} | null;
|
|
12507
12523
|
prompt_id: PromptID;
|
|
@@ -12627,6 +12643,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12627
12643
|
subfolder: string;
|
|
12628
12644
|
type: string;
|
|
12629
12645
|
}[] | undefined;
|
|
12646
|
+
'3d'?: {
|
|
12647
|
+
filename: string;
|
|
12648
|
+
subfolder: string;
|
|
12649
|
+
type: string;
|
|
12650
|
+
}[] | undefined;
|
|
12630
12651
|
text?: unknown[] | undefined;
|
|
12631
12652
|
} | null;
|
|
12632
12653
|
prompt_id: PromptID;
|
|
@@ -12655,6 +12676,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12655
12676
|
subfolder: string;
|
|
12656
12677
|
type: string;
|
|
12657
12678
|
}[] | undefined;
|
|
12679
|
+
'3d'?: {
|
|
12680
|
+
filename: string;
|
|
12681
|
+
subfolder: string;
|
|
12682
|
+
type: string;
|
|
12683
|
+
}[] | undefined;
|
|
12658
12684
|
text?: unknown[] | undefined;
|
|
12659
12685
|
};
|
|
12660
12686
|
_WsMsgExecutionCachedData: {
|
|
@@ -12970,6 +12996,7 @@ declare const types: import("arktype").Module<{
|
|
|
12970
12996
|
output_tooltips?: (string | null)[] | undefined;
|
|
12971
12997
|
deprecated?: boolean | undefined;
|
|
12972
12998
|
experimental?: boolean | undefined;
|
|
12999
|
+
api_node?: boolean | undefined;
|
|
12973
13000
|
};
|
|
12974
13001
|
ComfySchemaJSON: {
|
|
12975
13002
|
[x: string]: {
|
|
@@ -13078,6 +13105,7 @@ declare const types: import("arktype").Module<{
|
|
|
13078
13105
|
output_tooltips?: (string | null)[] | undefined;
|
|
13079
13106
|
deprecated?: boolean | undefined;
|
|
13080
13107
|
experimental?: boolean | undefined;
|
|
13108
|
+
api_node?: boolean | undefined;
|
|
13081
13109
|
};
|
|
13082
13110
|
};
|
|
13083
13111
|
}>;
|
|
@@ -13248,6 +13276,8 @@ type ComfyExecutionData = {
|
|
|
13248
13276
|
graphID: ComfyWorkflowID;
|
|
13249
13277
|
executed: boolean;
|
|
13250
13278
|
error?: WsMsgExecutionError | WsMsgExecutionInterrupted | null;
|
|
13279
|
+
/** why comfy-ts failed the run itself, when no ComfyUI message says it (the host lost the prompt) */
|
|
13280
|
+
reason?: string | null;
|
|
13251
13281
|
status?: ComfyExecutionStatus | null;
|
|
13252
13282
|
};
|
|
13253
13283
|
/** one audio file an output node published, downloaded as the server wrote it.
|
|
@@ -13258,10 +13288,17 @@ type ComfyAudioOutput = {
|
|
|
13258
13288
|
mime: string;
|
|
13259
13289
|
bytes: Uint8Array;
|
|
13260
13290
|
absPath: AbsolutePath | null;
|
|
13291
|
+
/** the `tag` / `tags` of the output node's metadata, as on images */
|
|
13292
|
+
tags: string[];
|
|
13261
13293
|
};
|
|
13262
13294
|
/** one video file an output node published (SaveVideo, SaveWEBM, VHS_VideoCombine), same
|
|
13263
13295
|
* shape and same retrieval as an audio file */
|
|
13264
13296
|
type ComfyVideoOutput = ComfyAudioOutput;
|
|
13297
|
+
/** one 3D file an output node published (SaveGLB, SaveGaussianSplat, SavePointCloud): a mesh, a point
|
|
13298
|
+
* cloud or a splat, same retrieval as an audio file. `format` is the lowercase extension (glb, ply, spz…) */
|
|
13299
|
+
type Comfy3DOutput = ComfyAudioOutput & {
|
|
13300
|
+
format: string;
|
|
13301
|
+
};
|
|
13265
13302
|
/** one text output as an output node published it (`nodeKey` is null when the node left the snapshot) */
|
|
13266
13303
|
type ComfyTextOutput = {
|
|
13267
13304
|
nodeId: ComfyNodeId;
|
|
@@ -13348,6 +13385,36 @@ declare class ComfyExecution {
|
|
|
13348
13385
|
/** update execution list */
|
|
13349
13386
|
private onExecuted;
|
|
13350
13387
|
private pendingPromises;
|
|
13388
|
+
/** an end message arrived (or was replayed): every later message is ignored */
|
|
13389
|
+
private ended;
|
|
13390
|
+
/** the output nodes whose `executed` reached us, so a /history replay never retrieves one twice */
|
|
13391
|
+
private heardExecuted;
|
|
13392
|
+
/** the run lived through a reconnect and may have lost events: its end reads /history for them */
|
|
13393
|
+
private mayHaveMissedEvents;
|
|
13394
|
+
private replayUnheardOutputs;
|
|
13395
|
+
/** the history entry is written right after the end message is queued, so it may lag by a moment */
|
|
13396
|
+
historyRetry: {
|
|
13397
|
+
tries: number;
|
|
13398
|
+
ms: number;
|
|
13399
|
+
};
|
|
13400
|
+
/** a run that lived through a reconnect: an output node that ended in the gap is only in /history */
|
|
13401
|
+
private retrieveMissedOutputs;
|
|
13402
|
+
/** @internal the last event of this run: the watchdog checks only runs quiet for host.runSilenceMs */
|
|
13403
|
+
lastHeardAt: number;
|
|
13404
|
+
/** @internal a check is in flight: never two at once */
|
|
13405
|
+
reconciling: boolean;
|
|
13406
|
+
private loggedReconcileProblems;
|
|
13407
|
+
private heard;
|
|
13408
|
+
private logReconcileOnce;
|
|
13409
|
+
/** @internal called before the host reads its queue. After a reconnect the run may have lost events,
|
|
13410
|
+
* so its end reads /history for them; the flag is set before any await, so a live end that lands
|
|
13411
|
+
* during the reads still looks. A check for silence alone does not set it: a quiet run lost nothing */
|
|
13412
|
+
beginReconcile(why: 'reconnect' | 'silence'): void;
|
|
13413
|
+
/** @internal ask the host where this run stands. `queued` is the host's queue read BEFORE this
|
|
13414
|
+
* history read (the server moves a prompt from one to the other under one lock, so this order never
|
|
13415
|
+
* misses a run that ended between the two reads); null when it did not answer, and then the run is
|
|
13416
|
+
* never declared lost. A queued run needs no history read. Says how the check ended */
|
|
13417
|
+
reconcile: (queued: Set<string> | null) => Promise<'history' | 'waiting' | 'lost'>;
|
|
13351
13418
|
/** audio retrievals that failed (their files are missing from `audios`) */
|
|
13352
13419
|
audioErrors: {
|
|
13353
13420
|
audio: ComfyImageInfo;
|
|
@@ -13362,6 +13429,14 @@ declare class ComfyExecution {
|
|
|
13362
13429
|
}[];
|
|
13363
13430
|
/** video files retrieved for this execution, in arrival order (final once `done` resolves) */
|
|
13364
13431
|
videos: ComfyVideoOutput[];
|
|
13432
|
+
/** 3D retrievals that failed (their files are missing from `models3d`) */
|
|
13433
|
+
models3dErrors: {
|
|
13434
|
+
model3d: ComfyImageInfo;
|
|
13435
|
+
error: unknown;
|
|
13436
|
+
}[];
|
|
13437
|
+
/** 3D files retrieved for this execution, in arrival order (final once `done` resolves) */
|
|
13438
|
+
models3d: Comfy3DOutput[];
|
|
13439
|
+
/** one non-image file through /view, its bytes as the server wrote them; the caller files it */
|
|
13365
13440
|
private retrieveFile;
|
|
13366
13441
|
/** image retrievals that failed (their images are missing from `images`);
|
|
13367
13442
|
* `image` is null for SaveImageWebsocket frames (no server-side file info exists) */
|
|
@@ -13376,6 +13451,10 @@ declare class ComfyExecution {
|
|
|
13376
13451
|
private encodeAndWrite;
|
|
13377
13452
|
/** accumulate an output on the prompt; tags from node metadata ride along */
|
|
13378
13453
|
private pushImage;
|
|
13454
|
+
/** the tags an output node was built with (`{ tag }` / `{ tags }` metadata) */
|
|
13455
|
+
private tagsOf;
|
|
13456
|
+
/** the sent graph saves through SaveImageWebsocket: those outputs exist only as ws frames */
|
|
13457
|
+
private get sendsWsFrames();
|
|
13379
13458
|
/** true while the currently executing node is a SaveImageWebsocket in the
|
|
13380
13459
|
* SENT snapshot (the ephemeral rewrite only touches the snapshot, so the
|
|
13381
13460
|
* live graph may still say SaveImage) — binary frames are then OUTPUTS */
|
|
@@ -16813,6 +16892,7 @@ type WsDebugMessage = {
|
|
|
16813
16892
|
};
|
|
16814
16893
|
declare class ResilientWebSocketClient {
|
|
16815
16894
|
options: {
|
|
16895
|
+
/** re-read on every connect */
|
|
16816
16896
|
url: () => string;
|
|
16817
16897
|
/** upgrade-request headers (auth: X-API-Key & co) — a thunk, re-read on every reconnect.
|
|
16818
16898
|
* On a headerless transport (browser) X-API-Key rides `?token=` instead
|
|
@@ -16849,6 +16929,7 @@ declare class ResilientWebSocketClient {
|
|
|
16849
16929
|
private addInfo;
|
|
16850
16930
|
private addError;
|
|
16851
16931
|
constructor(options: {
|
|
16932
|
+
/** re-read on every connect */
|
|
16852
16933
|
url: () => string;
|
|
16853
16934
|
/** upgrade-request headers (auth: X-API-Key & co) — a thunk, re-read on every reconnect.
|
|
16854
16935
|
* On a headerless transport (browser) X-API-Key rides `?token=` instead
|
|
@@ -16885,6 +16966,8 @@ declare class ResilientWebSocketClient {
|
|
|
16885
16966
|
private stopHeartbeat;
|
|
16886
16967
|
/** ping on a timer; no pong since the previous ping = the peer is gone, drop the socket */
|
|
16887
16968
|
private startHeartbeat;
|
|
16969
|
+
/** close the socket cleanly, then reconnect as after any close: the server ends its handler first */
|
|
16970
|
+
reconnect(): void;
|
|
16888
16971
|
/** close and stop reconnecting (lets a script exit cleanly) */
|
|
16889
16972
|
disconnectPermanently(): void;
|
|
16890
16973
|
/** headerless transports carry the api key as ?token= — everything else is refused loud */
|
|
@@ -17685,6 +17768,23 @@ type SchemaDrift = {
|
|
|
17685
17768
|
} & Delta)[];
|
|
17686
17769
|
};
|
|
17687
17770
|
//#endregion
|
|
17771
|
+
//#region src/runner/comfyOrgApiKey.d.ts
|
|
17772
|
+
/** a Comfy account key, or a thunk read only when a run with a partner node starts */
|
|
17773
|
+
type ComfyOrgApiKeySource = string | (() => string | undefined | Promise<string | undefined>);
|
|
17774
|
+
/** a partner API node of a prompt: what the error names */
|
|
17775
|
+
type PartnerApiNode = {
|
|
17776
|
+
id: string;
|
|
17777
|
+
classType: string;
|
|
17778
|
+
};
|
|
17779
|
+
/** the prompt holds a paid partner node and no Comfy account key was set */
|
|
17780
|
+
declare class ComfyOrgApiKeyMissingError extends Error {
|
|
17781
|
+
hostId: string;
|
|
17782
|
+
nodes: PartnerApiNode[];
|
|
17783
|
+
/** name, not instanceof: the cli bundle and dist/index.js each define this class */
|
|
17784
|
+
readonly name = "ComfyOrgApiKeyMissingError";
|
|
17785
|
+
constructor(hostId: string, nodes: PartnerApiNode[]);
|
|
17786
|
+
}
|
|
17787
|
+
//#endregion
|
|
17688
17788
|
//#region src/host/ComfyHost.d.ts
|
|
17689
17789
|
type ComfyHostID = Tagged<string, {
|
|
17690
17790
|
HostID: true;
|
|
@@ -17701,6 +17801,11 @@ type ComfyHostData = {
|
|
|
17701
17801
|
/** sent as X-API-Key on every request AND the ws upgrade.
|
|
17702
17802
|
* NEVER persist the value: read it from an env var (e.g. COMFY_CLOUD_API_KEY) */
|
|
17703
17803
|
apiKey?: string;
|
|
17804
|
+
/** the Comfy account key (platform.comfy.org) that paid partner API nodes bill to, sent as
|
|
17805
|
+
* `extra_data.api_key_comfy_org` with a prompt that holds one. A thunk is read only when such
|
|
17806
|
+
* a run starts. `RunSettings.comfyOrgApiKey` overrides it for one run; a cloud.comfy.org host
|
|
17807
|
+
* falls back to its apiKey. NEVER persist the value (architecture.md, Partner API nodes) */
|
|
17808
|
+
comfyOrgApiKey?: ComfyOrgApiKeySource;
|
|
17704
17809
|
/** default true. false = never write sdk.d.ts to .comfy-ts/hosts/<id>/ —
|
|
17705
17810
|
* schema updates stay in-memory. The comfy-cloud example sets false: its sdk
|
|
17706
17811
|
* home is the COMMITTED examples/comfy-cloud/sdk.d.ts (gen:sdk:cloud), and a
|
|
@@ -17901,6 +18006,42 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17901
18006
|
loadSchemaFromCache(): Promise<void>;
|
|
17902
18007
|
/** POST a JSON route through host.fetch (/api preferred, bare fallback) */
|
|
17903
18008
|
private postJSON_;
|
|
18009
|
+
/** GET a json route for the run checks: an answer that is not json (a 404, a 405, a page) means the
|
|
18010
|
+
* host has no such route, a HostRouteUnusableError; a network failure stays a plain error */
|
|
18011
|
+
private fetchReconcileJSON_;
|
|
18012
|
+
/** one prompt's `GET /history/<id>` reply, `{}` while the host has no entry for it */
|
|
18013
|
+
fetchHistory: (promptId: PromptID) => Promise<unknown>;
|
|
18014
|
+
/** the ids of the prompts waiting or running on this host, every client counted (`GET /queue`) */
|
|
18015
|
+
fetchQueuedPromptIds: () => Promise<Set<string>>;
|
|
18016
|
+
/** why runs on this host are never checked over http: its /queue or /history is not ComfyUI's
|
|
18017
|
+
* (a cloud host). Null while both answered as ComfyUI does, or were never asked */
|
|
18018
|
+
reconcileOff: string | null;
|
|
18019
|
+
/** @internal a failed run check: true when it proved the host has no usable route (the checks then
|
|
18020
|
+
* stop for good, said once), false for a passing failure the caller reports */
|
|
18021
|
+
noteReconcileFailure(e: unknown): boolean;
|
|
18022
|
+
/** fetchQueuedPromptIds, null when the queue did not answer (logged once per message) or has another
|
|
18023
|
+
* shape: a run is then never declared lost */
|
|
18024
|
+
fetchQueuedPromptIdsOrNull: () => Promise<Set<string> | null>;
|
|
18025
|
+
private _loggedQueueProblems;
|
|
18026
|
+
/** a check needs the WHOLE socket quiet this long, and the run itself too */
|
|
18027
|
+
runSilenceMs: number;
|
|
18028
|
+
/** the wait doubles after each check that ends no run, up to this; any ws message resets it */
|
|
18029
|
+
runSilenceMaxMs: number;
|
|
18030
|
+
private _silenceWaitMs;
|
|
18031
|
+
private _lastCheckAt;
|
|
18032
|
+
private _checking;
|
|
18033
|
+
private _watchdog;
|
|
18034
|
+
/** @internal a new run routes its ws messages here, and the watchdog watches it */
|
|
18035
|
+
trackExecution(execution: ComfyExecution): void;
|
|
18036
|
+
private stopWatchdog;
|
|
18037
|
+
/** a socket that hears no broadcast and no event for a while is deaf, or the host runs one long
|
|
18038
|
+
* quiet node: ask. A run queued behind a talking host is never asked about */
|
|
18039
|
+
private watchdogTick;
|
|
18040
|
+
/** @internal one queue read for all the runs, then the history of each run not in it. A run that
|
|
18041
|
+
* ends from its history while the socket looked fine means the socket hears nothing: ComfyUI removes
|
|
18042
|
+
* a session BY KEY when a socket's handler ends, so an old handler that ends after a reconnect evicts
|
|
18043
|
+
* the new socket of the same session. A clean close lets the server end that handler first */
|
|
18044
|
+
reconcileRuns(runs: ComfyExecution[], why: 'reconnect' | 'silence'): Promise<void>;
|
|
17904
18045
|
/** drop every PENDING prompt from the server queue (the running one keeps going) */
|
|
17905
18046
|
clearQueue: () => Promise<void>;
|
|
17906
18047
|
/** a repeat interrupt for the same running prompt inside this window reuses the first request */
|
|
@@ -17987,6 +18128,8 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17987
18128
|
* spam); both sets clear when the server assigns a new session id */
|
|
17988
18129
|
private _unknownBinaryFrameTypes;
|
|
17989
18130
|
private _unknownWsEventTypes;
|
|
18131
|
+
/** the socket opened and its first 'status' has not come yet */
|
|
18132
|
+
private _socketIsNew;
|
|
17990
18133
|
/** handy to keep around */
|
|
17991
18134
|
status: ComfyStatusData['status'] | null;
|
|
17992
18135
|
/** last time ANY ws message arrived — proof-of-life for the TUI probe: a
|
|
@@ -18199,6 +18342,9 @@ type RunSettings = {
|
|
|
18199
18342
|
* without it no frame is decoded for the run. ComfyUI sends frames only when launched with
|
|
18200
18343
|
* `--preview-method`, see `host.fetchPreviewMethod()` */
|
|
18201
18344
|
onPreview?: (p: ExecutionPreview) => void;
|
|
18345
|
+
/** the Comfy account key for this run's paid partner API nodes; overrides the host's
|
|
18346
|
+
* `comfyOrgApiKey`. Sent only when the prompt holds one, never saved */
|
|
18347
|
+
comfyOrgApiKey?: ComfyOrgApiKeySource;
|
|
18202
18348
|
};
|
|
18203
18349
|
/** exactly what was sent to the host for one execution, frozen at send time */
|
|
18204
18350
|
type ExecutionSnapshot = {
|
|
@@ -19010,5 +19156,5 @@ type HostToPanel = {
|
|
|
19010
19156
|
comfyTs: 'get-state';
|
|
19011
19157
|
};
|
|
19012
19158
|
//#endregion
|
|
19013
|
-
export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, AudioVar, type AudioVarOpts, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceOptionLook, type ChoiceSelect, ChoiceVar, type CodegenOptions, type ComfyApiJson, type ComfyApiNodeJson, type ComfyAudioOutput, ComfyExecution, type ComfyExecutionData, type ComfyExecutionStatus, ComfyHost, ComfyHostAuthError, type ComfyHostData, type ComfyHostID, ComfyHostUnreachableError, type ComfyImageName, ComfyManager, ComfyNode, type ComfyNodeId, type ComfyNodeIdMode, type ComfyNodeMetadata, ComfyNodeOutput, type ComfyNodeSchemaJSON, ComfySchema, type ComfySchemaJSON, ComfySdkBase, ComfySdkShape, type ComfyStorage, ComfyTS, type ComfyTextOutput, type ComfyUnionValue, type ComfyUploadImageResult, ComfyUploader, ComfyVar, ComfyVarBase, type ComfyVideoOutput, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, type HostToPanel, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraEntry, type LoraLane, type LoraLanes, type LoraMirror, type LoraNameOf, type LoraRecord, type LoraStrength, type LoraSweep, type LorasHost, type LorasInput, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, MediaVar, MediaVarEmptyError, type MediaVarOpts, type ModelVarOpts, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type OutputWidget, type OutputWidgetKind, type PanelError, type PanelHostAction, type PanelRequest, type PanelResultAction, type PanelState, type PanelToHost, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, type ProgressReport, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type RelightRoles, type RelightWidget, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, type SlotNameOf, type SlotValueOf, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, VideoVar, type VideoVarOpts, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
|
|
19159
|
+
export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, AudioVar, type AudioVarOpts, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, type ChoiceOptionLook, type ChoiceSelect, ChoiceVar, type CodegenOptions, type Comfy3DOutput, type ComfyApiJson, type ComfyApiNodeJson, type ComfyAudioOutput, ComfyExecution, type ComfyExecutionData, type ComfyExecutionStatus, ComfyHost, ComfyHostAuthError, type ComfyHostData, type ComfyHostID, ComfyHostUnreachableError, type ComfyImageName, ComfyManager, ComfyNode, type ComfyNodeId, type ComfyNodeIdMode, type ComfyNodeMetadata, ComfyNodeOutput, type ComfyNodeSchemaJSON, ComfyOrgApiKeyMissingError, type ComfyOrgApiKeySource, ComfySchema, type ComfySchemaJSON, ComfySdkBase, ComfySdkShape, type ComfyStorage, ComfyTS, type ComfyTextOutput, type ComfyUnionValue, type ComfyUploadImageResult, ComfyUploader, ComfyVar, ComfyVarBase, type ComfyVideoOutput, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_AUDIO_EXTENSIONS, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, DEFAULT_VIDEO_EXTENSIONS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, type HostToPanel, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraEntry, type LoraLane, type LoraLanes, type LoraMirror, type LoraNameOf, type LoraRecord, type LoraStrength, type LoraSweep, type LorasHost, type LorasInput, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, MediaVar, MediaVarEmptyError, type MediaVarOpts, type ModelVarOpts, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type OutputWidget, type OutputWidgetKind, type PanelError, type PanelHostAction, type PanelRequest, type PanelResultAction, type PanelState, type PanelToHost, type ParsedHostBase, PartialOmit, type PartnerApiNode, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, type ProgressReport, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type RelightRoles, type RelightWidget, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, type SlotNameOf, type SlotValueOf, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, VideoVar, type VideoVarOpts, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resolveWidgetRoles, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v, widget };
|
|
19014
19160
|
//# sourceMappingURL=web.d.ts.map
|