comfy-ts 2.11.0 → 2.13.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 +1 -0
- package/dist/{LogsSt-qtFzOKpu.js → LogsSt-CUeo843w.js} +51 -7
- package/dist/LogsSt-CUeo843w.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/index.cjs +595 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +286 -46
- package/dist/index.d.ts +286 -46
- package/dist/index.js +591 -74
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-BK7BA2dn.js → run-serve-DlRBv_Nk.js} +738 -58
- package/dist/run-serve-DlRBv_Nk.js.map +1 -0
- package/dist/{run-tui-CQyvMf0N.js → run-tui-B5uxm2_l.js} +43 -18
- package/dist/run-tui-B5uxm2_l.js.map +1 -0
- package/dist/{schemaDrift-DjjEtwfx.js → schemaDrift-E95iTF7E.js} +473 -60
- package/dist/schemaDrift-E95iTF7E.js.map +1 -0
- package/dist/serve-web.js +710 -174
- package/dist/{state--wrz0BQc.js → state-CUp2J1Zy.js} +126 -14
- package/dist/state-CUp2J1Zy.js.map +1 -0
- package/dist/web.d.ts +286 -46
- package/dist/web.js +591 -74
- package/dist/web.js.map +1 -1
- package/examples/comfy-cloud/sdk.d.ts +163 -163
- package/examples/rvion/06-qwen-image-edit.cflow.ts +3 -2
- package/examples/rvion/10-anima-t2i.cflow.ts +252 -0
- package/examples/rvion/11-yue2-t2a.cflow.ts +105 -0
- package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +78 -0
- package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +153 -0
- package/examples/rvion/stableAudio3Prompts.ts +19 -0
- package/extra/README.md +4 -0
- package/extra/comfyui-fresh-model-lists/README.md +25 -0
- package/extra/comfyui-fresh-model-lists/__init__.py +36 -0
- package/extra/comfyui-fresh-model-lists/test_fresh_model_lists.py +97 -0
- package/package.json +15 -7
- package/src/cli/draftMeta.ts +39 -0
- package/src/cli/serve/ServeApp.ts +305 -30
- package/src/cli/serve/applyVarPayload.ts +50 -22
- package/src/cli/serve/byteRange.ts +48 -0
- package/src/cli/serve/describeVar.ts +42 -6
- package/src/cli/serve/llmConfigShape.ts +51 -0
- package/src/cli/serve/llmConfigs.ts +52 -0
- package/src/cli/serve/run-serve.ts +12 -3
- package/src/cli/serve/tagList.ts +92 -0
- package/src/cli/serve/tagSource.ts +69 -0
- package/src/cli/serve/web/api.ts +72 -0
- package/src/cli/serve/web/components/App.tsx +485 -44
- package/src/cli/serve/web/components/DraftTabs.tsx +167 -0
- package/src/cli/serve/web/components/Gallery.tsx +133 -31
- package/src/cli/serve/web/components/HistoryPicker.tsx +149 -0
- package/src/cli/serve/web/components/Icon.tsx +58 -2
- package/src/cli/serve/web/components/MenuButton.tsx +53 -0
- package/src/cli/serve/web/components/Omnibox.tsx +135 -0
- package/src/cli/serve/web/components/PromptEnhancer.tsx +476 -180
- package/src/cli/serve/web/components/SideMenu.tsx +414 -0
- package/src/cli/serve/web/components/TooltipLayer.tsx +46 -0
- package/src/cli/serve/web/components/VarIcon.tsx +24 -0
- package/src/cli/serve/web/components/VarsForm.tsx +223 -351
- package/src/cli/serve/web/components/controls/BasicControls.tsx +57 -32
- package/src/cli/serve/web/components/controls/LorasControl.tsx +646 -317
- package/src/cli/serve/web/components/controls/PresetPicker.tsx +1 -1
- package/src/cli/serve/web/components/controls/PromptControl.tsx +279 -0
- package/src/cli/serve/web/components/controls/PromptEditor.tsx +113 -0
- package/src/cli/serve/web/components/controls/SeedControl.tsx +17 -10
- package/src/cli/serve/web/components/controls/SizeControl.tsx +111 -18
- package/src/cli/serve/web/components/modKey.ts +2 -0
- package/src/cli/serve/web/llm.ts +23 -12
- package/src/cli/serve/web/promptEditor/promptExtensions.ts +284 -0
- package/src/cli/serve/web/state/EnhancerSt.ts +431 -101
- package/src/cli/serve/web/state/FormSt.ts +214 -30
- package/src/cli/serve/web/state/OmniboxSt.ts +59 -0
- package/src/cli/serve/web/state/WebSt.ts +364 -80
- package/src/cli/serve/web/state/choiceButtons.ts +61 -0
- package/src/cli/serve/web/state/draftNames.ts +16 -0
- package/src/cli/serve/web/state/draftTabs.ts +75 -0
- package/src/cli/serve/web/state/generateButton.ts +16 -0
- package/src/cli/serve/web/state/history.ts +54 -0
- package/src/cli/serve/web/state/host.ts +5 -2
- package/src/cli/serve/web/state/keptLines.ts +53 -0
- package/src/cli/serve/web/state/latentMode.ts +20 -0
- package/src/cli/serve/web/state/loraSort.ts +18 -0
- package/src/cli/serve/web/state/moduleTree.ts +2 -2
- package/src/cli/serve/web/state/omnibox.ts +133 -0
- package/src/cli/serve/web/state/payload.ts +38 -58
- package/src/cli/serve/web/state/shortcuts.ts +103 -0
- package/src/cli/serve/web/state/sizeStars.ts +31 -0
- package/src/cli/serve/web/state/stableSlots.ts +21 -0
- package/src/cli/serve/web/state/varGroups.ts +24 -0
- package/src/cli/serve/web/styles.ts +653 -154
- package/src/cli/serve/webBundle.ts +54 -10
- package/src/cli/serve/workflowTags.ts +42 -0
- package/src/cli/serve/workspaceLabels.ts +23 -0
- package/src/cli/tui/components/PickerOverlays.tsx +9 -2
- package/src/cli/tui/imagePicker/ImagePickerSt.ts +1 -1
- package/src/cli/tui/state/DraftsSt.ts +28 -8
- package/src/cli/tui/state/EditorSt.ts +1 -1
- package/src/cli/tui/state/LorasSt.ts +1 -1
- package/src/cli/tui/state/PickerSt.ts +25 -7
- package/src/cli/tui/state/SettingsSt.ts +1 -1
- package/src/cli/tui/state/TuiSt.ts +10 -0
- package/src/coreExports.ts +21 -0
- package/src/host/ComfyHost.ts +17 -2
- package/src/host/ResilientWebsocket.ts +54 -4
- package/src/host/loraInfoCache.ts +6 -0
- package/src/runner/ComfyExecution.ts +60 -0
- package/src/runner/ComfyWorkflow.ts +4 -0
- package/src/runner/ComfyWsApi.ts +2 -0
- package/src/runner/MediaImage.ts +2 -2
- package/src/sdk-generator/ComfyUIObjectInfoTypes.ts +5 -5
- package/src/sdk-generator/comfyui-sdk-codegen.ts +1 -1
- package/src/state.ts +5 -0
- package/src/utils/copyName.ts +12 -0
- package/src/vars/ComfyVars.ts +337 -67
- package/src/vars/DefinedWorkflow.ts +47 -20
- package/src/vars/lanes.ts +238 -0
- package/src/vars/loraEntry.ts +101 -0
- package/src/vars/promptSyntax.ts +382 -0
- package/dist/LogsSt-qtFzOKpu.js.map +0 -1
- package/dist/run-serve-BK7BA2dn.js.map +0 -1
- package/dist/run-tui-CQyvMf0N.js.map +0 -1
- package/dist/schemaDrift-DjjEtwfx.js.map +0 -1
- package/dist/state--wrz0BQc.js.map +0 -1
- package/src/cli/serve/web/components/Sidebar.tsx +0 -66
package/dist/index.d.ts
CHANGED
|
@@ -11941,6 +11941,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
11941
11941
|
subfolder: string;
|
|
11942
11942
|
type: string;
|
|
11943
11943
|
}[] | undefined;
|
|
11944
|
+
audio?: {
|
|
11945
|
+
filename: string;
|
|
11946
|
+
subfolder: string;
|
|
11947
|
+
type: string;
|
|
11948
|
+
}[] | undefined;
|
|
11944
11949
|
text?: unknown[] | undefined;
|
|
11945
11950
|
};
|
|
11946
11951
|
prompt_id: PromptID;
|
|
@@ -12017,6 +12022,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12017
12022
|
subfolder: string;
|
|
12018
12023
|
type: string;
|
|
12019
12024
|
}[] | undefined;
|
|
12025
|
+
audio?: {
|
|
12026
|
+
filename: string;
|
|
12027
|
+
subfolder: string;
|
|
12028
|
+
type: string;
|
|
12029
|
+
}[] | undefined;
|
|
12020
12030
|
text?: unknown[] | undefined;
|
|
12021
12031
|
};
|
|
12022
12032
|
prompt_id: PromptID;
|
|
@@ -12079,6 +12089,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12079
12089
|
subfolder: string;
|
|
12080
12090
|
type: string;
|
|
12081
12091
|
}[] | undefined;
|
|
12092
|
+
audio?: {
|
|
12093
|
+
filename: string;
|
|
12094
|
+
subfolder: string;
|
|
12095
|
+
type: string;
|
|
12096
|
+
}[] | undefined;
|
|
12082
12097
|
text?: unknown[] | undefined;
|
|
12083
12098
|
};
|
|
12084
12099
|
prompt_id: PromptID;
|
|
@@ -12180,6 +12195,11 @@ declare const types$1: import("arktype").Module<{
|
|
|
12180
12195
|
subfolder: string;
|
|
12181
12196
|
type: string;
|
|
12182
12197
|
}[] | undefined;
|
|
12198
|
+
audio?: {
|
|
12199
|
+
filename: string;
|
|
12200
|
+
subfolder: string;
|
|
12201
|
+
type: string;
|
|
12202
|
+
}[] | undefined;
|
|
12183
12203
|
text?: unknown[] | undefined;
|
|
12184
12204
|
};
|
|
12185
12205
|
prompt_id: PromptID;
|
|
@@ -12272,7 +12292,7 @@ declare const types: import("arktype").Module<{
|
|
|
12272
12292
|
ComfyInputOpts: string | {
|
|
12273
12293
|
tooltip?: string | /*elided*/ any | null | undefined;
|
|
12274
12294
|
multiline?: boolean | null | undefined;
|
|
12275
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12295
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12276
12296
|
forceInput?: boolean | null | undefined;
|
|
12277
12297
|
min?: number | null | undefined;
|
|
12278
12298
|
round?: number | boolean | null | undefined;
|
|
@@ -12287,7 +12307,7 @@ declare const types: import("arktype").Module<{
|
|
|
12287
12307
|
ComfyInputOpts_advanced: {
|
|
12288
12308
|
tooltip?: string | any | null | undefined;
|
|
12289
12309
|
multiline?: boolean | null | undefined;
|
|
12290
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12310
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12291
12311
|
forceInput?: boolean | null | undefined;
|
|
12292
12312
|
min?: number | null | undefined;
|
|
12293
12313
|
round?: number | boolean | null | undefined;
|
|
@@ -12309,7 +12329,7 @@ declare const types: import("arktype").Module<{
|
|
|
12309
12329
|
})[], string | {
|
|
12310
12330
|
tooltip?: string | any | null | undefined;
|
|
12311
12331
|
multiline?: boolean | null | undefined;
|
|
12312
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12332
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12313
12333
|
forceInput?: boolean | null | undefined;
|
|
12314
12334
|
min?: number | null | undefined;
|
|
12315
12335
|
round?: number | boolean | null | undefined;
|
|
@@ -12327,7 +12347,7 @@ declare const types: import("arktype").Module<{
|
|
|
12327
12347
|
})[], string | {
|
|
12328
12348
|
tooltip?: string | any | null | undefined;
|
|
12329
12349
|
multiline?: boolean | null | undefined;
|
|
12330
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12350
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12331
12351
|
forceInput?: boolean | null | undefined;
|
|
12332
12352
|
min?: number | null | undefined;
|
|
12333
12353
|
round?: number | boolean | null | undefined;
|
|
@@ -12360,7 +12380,7 @@ declare const types: import("arktype").Module<{
|
|
|
12360
12380
|
})[], string | {
|
|
12361
12381
|
tooltip?: string | any | null | undefined;
|
|
12362
12382
|
multiline?: boolean | null | undefined;
|
|
12363
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12383
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12364
12384
|
forceInput?: boolean | null | undefined;
|
|
12365
12385
|
min?: number | null | undefined;
|
|
12366
12386
|
round?: number | boolean | null | undefined;
|
|
@@ -12383,7 +12403,7 @@ declare const types: import("arktype").Module<{
|
|
|
12383
12403
|
})[], string | {
|
|
12384
12404
|
tooltip?: string | any | null | undefined;
|
|
12385
12405
|
multiline?: boolean | null | undefined;
|
|
12386
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12406
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12387
12407
|
forceInput?: boolean | null | undefined;
|
|
12388
12408
|
min?: number | null | undefined;
|
|
12389
12409
|
round?: number | boolean | null | undefined;
|
|
@@ -12409,15 +12429,15 @@ declare const types: import("arktype").Module<{
|
|
|
12409
12429
|
content: string;
|
|
12410
12430
|
image?: string | null | undefined;
|
|
12411
12431
|
})[])[];
|
|
12412
|
-
output_is_list: boolean[];
|
|
12432
|
+
output_is_list: (boolean | null)[];
|
|
12413
12433
|
output_name: string[];
|
|
12414
12434
|
name: string;
|
|
12415
|
-
display_name: string;
|
|
12435
|
+
display_name: string | null;
|
|
12416
12436
|
description: string;
|
|
12417
12437
|
python_module: string;
|
|
12418
12438
|
category: string;
|
|
12419
12439
|
output_node: boolean;
|
|
12420
|
-
output_tooltips?: string[] | undefined;
|
|
12440
|
+
output_tooltips?: (string | null)[] | undefined;
|
|
12421
12441
|
deprecated?: boolean | undefined;
|
|
12422
12442
|
experimental?: boolean | undefined;
|
|
12423
12443
|
};
|
|
@@ -12434,7 +12454,7 @@ declare const types: import("arktype").Module<{
|
|
|
12434
12454
|
})[], string | {
|
|
12435
12455
|
tooltip?: string | any | null | undefined;
|
|
12436
12456
|
multiline?: boolean | null | undefined;
|
|
12437
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12457
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12438
12458
|
forceInput?: boolean | null | undefined;
|
|
12439
12459
|
min?: number | null | undefined;
|
|
12440
12460
|
round?: number | boolean | null | undefined;
|
|
@@ -12457,7 +12477,7 @@ declare const types: import("arktype").Module<{
|
|
|
12457
12477
|
})[], string | {
|
|
12458
12478
|
tooltip?: string | any | null | undefined;
|
|
12459
12479
|
multiline?: boolean | null | undefined;
|
|
12460
|
-
default?: string | number | boolean | number[] | null | undefined;
|
|
12480
|
+
default?: string | number | boolean | object | number[] | null | undefined;
|
|
12461
12481
|
forceInput?: boolean | null | undefined;
|
|
12462
12482
|
min?: number | null | undefined;
|
|
12463
12483
|
round?: number | boolean | null | undefined;
|
|
@@ -12483,15 +12503,15 @@ declare const types: import("arktype").Module<{
|
|
|
12483
12503
|
content: string;
|
|
12484
12504
|
image?: string | null | undefined;
|
|
12485
12505
|
})[])[];
|
|
12486
|
-
output_is_list: boolean[];
|
|
12506
|
+
output_is_list: (boolean | null)[];
|
|
12487
12507
|
output_name: string[];
|
|
12488
12508
|
name: string;
|
|
12489
|
-
display_name: string;
|
|
12509
|
+
display_name: string | null;
|
|
12490
12510
|
description: string;
|
|
12491
12511
|
python_module: string;
|
|
12492
12512
|
category: string;
|
|
12493
12513
|
output_node: boolean;
|
|
12494
|
-
output_tooltips?: string[] | undefined;
|
|
12514
|
+
output_tooltips?: (string | null)[] | undefined;
|
|
12495
12515
|
deprecated?: boolean | undefined;
|
|
12496
12516
|
experimental?: boolean | undefined;
|
|
12497
12517
|
};
|
|
@@ -12666,6 +12686,15 @@ type ComfyExecutionData = {
|
|
|
12666
12686
|
error?: WsMsgExecutionError | null;
|
|
12667
12687
|
status?: ComfyExecutionStatus | null;
|
|
12668
12688
|
};
|
|
12689
|
+
/** one audio file an output node published, downloaded as the server wrote it.
|
|
12690
|
+
* `absPath` is null when saving is off: `bytes` is then the only copy */
|
|
12691
|
+
type ComfyAudioOutput = {
|
|
12692
|
+
nodeId: ComfyNodeId;
|
|
12693
|
+
filename: string;
|
|
12694
|
+
mime: string;
|
|
12695
|
+
bytes: Uint8Array;
|
|
12696
|
+
absPath: AbsolutePath | null;
|
|
12697
|
+
};
|
|
12669
12698
|
/** one text output as an output node published it (`nodeKey` is null when the node left the snapshot) */
|
|
12670
12699
|
type ComfyTextOutput = {
|
|
12671
12700
|
nodeId: ComfyNodeId;
|
|
@@ -12730,6 +12759,14 @@ declare class ComfyExecution {
|
|
|
12730
12759
|
/** update execution list */
|
|
12731
12760
|
private onExecuted;
|
|
12732
12761
|
private pendingPromises;
|
|
12762
|
+
/** audio retrievals that failed (their files are missing from `audios`) */
|
|
12763
|
+
audioErrors: {
|
|
12764
|
+
audio: ComfyImageInfo;
|
|
12765
|
+
error: unknown;
|
|
12766
|
+
}[];
|
|
12767
|
+
/** audio files retrieved for this execution, in arrival order (final once `done` resolves) */
|
|
12768
|
+
audios: ComfyAudioOutput[];
|
|
12769
|
+
private retrieveAudio;
|
|
12733
12770
|
/** image retrievals that failed (their images are missing from `images`);
|
|
12734
12771
|
* `image` is null for SaveImageWebsocket frames (no server-side file info exists) */
|
|
12735
12772
|
imageErrors: {
|
|
@@ -15891,6 +15928,10 @@ type WsLike = {
|
|
|
15891
15928
|
onerror: ((event: unknown) => void) | null;
|
|
15892
15929
|
send(data: Message): void;
|
|
15893
15930
|
close(): void;
|
|
15931
|
+
/** the `ws` package only (a browser answers pings by itself and exposes none of these) */
|
|
15932
|
+
ping?(): void;
|
|
15933
|
+
on?(event: 'pong', cb: () => void): void;
|
|
15934
|
+
terminate?(): void;
|
|
15894
15935
|
};
|
|
15895
15936
|
/** what both transports deliver with binaryType 'arraybuffer': string or ArrayBuffer in `data` */
|
|
15896
15937
|
type WsMessageEvent = {
|
|
@@ -15900,6 +15941,13 @@ type WsCloseEvent = {
|
|
|
15900
15941
|
code: number;
|
|
15901
15942
|
reason: string;
|
|
15902
15943
|
};
|
|
15944
|
+
type WsCtor = new (url: string, opts?: {
|
|
15945
|
+
headers?: Record<string, string>;
|
|
15946
|
+
}) => WsLike;
|
|
15947
|
+
type WsTransport = {
|
|
15948
|
+
ctor: WsCtor;
|
|
15949
|
+
supportsHeaders: boolean;
|
|
15950
|
+
};
|
|
15903
15951
|
type WsDebugMessage = {
|
|
15904
15952
|
type: 'info' | 'error';
|
|
15905
15953
|
timestamp: number;
|
|
@@ -15926,6 +15974,14 @@ declare class ResilientWebSocketClient {
|
|
|
15926
15974
|
* waiter sit for the full connect deadline. No callback = retry as before.
|
|
15927
15975
|
*/
|
|
15928
15976
|
onFirstConnectFailed?: (error: unknown) => void;
|
|
15977
|
+
/** tests only: a fake socket instead of the ws package / browser WebSocket */
|
|
15978
|
+
transport?: WsTransport;
|
|
15979
|
+
/** a host that vanishes (power loss, hard reboot) never sends a close frame, so the
|
|
15980
|
+
* socket would look open forever: every `heartbeatMs` it is pinged, and one without a
|
|
15981
|
+
* pong since the last ping is dropped, which starts the reconnect. Default 15s */
|
|
15982
|
+
heartbeatMs?: number;
|
|
15983
|
+
/** pause before a reconnect. Default 2s */
|
|
15984
|
+
reconnectMs?: number;
|
|
15929
15985
|
};
|
|
15930
15986
|
private url;
|
|
15931
15987
|
private currentWS?;
|
|
@@ -15954,11 +16010,23 @@ declare class ResilientWebSocketClient {
|
|
|
15954
16010
|
* waiter sit for the full connect deadline. No callback = retry as before.
|
|
15955
16011
|
*/
|
|
15956
16012
|
onFirstConnectFailed?: (error: unknown) => void;
|
|
16013
|
+
/** tests only: a fake socket instead of the ws package / browser WebSocket */
|
|
16014
|
+
transport?: WsTransport;
|
|
16015
|
+
/** a host that vanishes (power loss, hard reboot) never sends a close frame, so the
|
|
16016
|
+
* socket would look open forever: every `heartbeatMs` it is pinged, and one without a
|
|
16017
|
+
* pong since the last ping is dropped, which starts the reconnect. Default 15s */
|
|
16018
|
+
heartbeatMs?: number;
|
|
16019
|
+
/** pause before a reconnect. Default 2s */
|
|
16020
|
+
reconnectMs?: number;
|
|
15957
16021
|
});
|
|
15958
16022
|
/** an established session heals by retrying; a first connect that never opened does not */
|
|
15959
16023
|
private hasEverOpened;
|
|
15960
16024
|
private reconnectTimeout?;
|
|
16025
|
+
private heartbeat;
|
|
15961
16026
|
private permanentlyClosed;
|
|
16027
|
+
private stopHeartbeat;
|
|
16028
|
+
/** ping on a timer; no pong since the previous ping = the peer is gone, drop the socket */
|
|
16029
|
+
private startHeartbeat;
|
|
15962
16030
|
/** close and stop reconnecting (lets a script exit cleanly) */
|
|
15963
16031
|
disconnectPermanently(): void;
|
|
15964
16032
|
/** headerless transports carry the api key as ?token= — everything else is refused loud */
|
|
@@ -15968,6 +16036,37 @@ declare class ResilientWebSocketClient {
|
|
|
15968
16036
|
private flushMessageBuffer;
|
|
15969
16037
|
}
|
|
15970
16038
|
//#endregion
|
|
16039
|
+
//#region src/vars/loraEntry.d.ts
|
|
16040
|
+
type LoraEntry = {
|
|
16041
|
+
strength: [strengthModel: number, strengthClip: number];
|
|
16042
|
+
off?: boolean;
|
|
16043
|
+
mute?: string[];
|
|
16044
|
+
};
|
|
16045
|
+
type LoraStrength = boolean | number | [strengthModel: number, strengthClip: number] | LoraEntry;
|
|
16046
|
+
//#endregion
|
|
16047
|
+
//#region src/vars/lanes.d.ts
|
|
16048
|
+
type PromptLane = {
|
|
16049
|
+
name: string;
|
|
16050
|
+
prompt: string;
|
|
16051
|
+
active: boolean;
|
|
16052
|
+
};
|
|
16053
|
+
type PromptLanes = {
|
|
16054
|
+
lanes: PromptLane[];
|
|
16055
|
+
};
|
|
16056
|
+
type PromptInput = string | PromptLanes;
|
|
16057
|
+
type LoraRecord<T extends string = string> = Partial<Record<T, LoraStrength>>;
|
|
16058
|
+
type LoraLane<T extends string = string> = {
|
|
16059
|
+
name: string;
|
|
16060
|
+
active: boolean;
|
|
16061
|
+
loras: LoraRecord<T>;
|
|
16062
|
+
};
|
|
16063
|
+
type LoraLanes<T extends string = string> = {
|
|
16064
|
+
lanes: LoraLane<T>[];
|
|
16065
|
+
};
|
|
16066
|
+
/** a lora file is never named `lanes` (options end in .safetensors), so the plain record and the
|
|
16067
|
+
* lanes object can never be mistaken for each other */
|
|
16068
|
+
type LorasInput<T extends string = string> = LoraRecord<T> | LoraLanes<T>;
|
|
16069
|
+
//#endregion
|
|
15971
16070
|
//#region src/vars/presets.d.ts
|
|
15972
16071
|
type VarPreset = {
|
|
15973
16072
|
label: string;
|
|
@@ -15995,15 +16094,47 @@ type VarKind = 'text' | 'prompt' | 'int' | 'float' | 'seed' | 'toggle' | 'choice
|
|
|
15995
16094
|
* the one Out-specialized var (string in, PromptValue out); the split keeps
|
|
15996
16095
|
* outValue() cast-free.
|
|
15997
16096
|
*/
|
|
16097
|
+
/** how a var LOOKS in the panel, set by the workflow: `v.int(8).ui({ icon, color, description })`.
|
|
16098
|
+
* Every slot is optional, a color is any css color */
|
|
16099
|
+
type VarUi = {
|
|
16100
|
+
/** shown as a (?) after the label, the text is its tooltip */
|
|
16101
|
+
description?: string;
|
|
16102
|
+
/** a 24×24 svg path drawn in the icon color, or a whole `<svg …>` string */
|
|
16103
|
+
icon?: string;
|
|
16104
|
+
/** the icon's color */
|
|
16105
|
+
color?: string;
|
|
16106
|
+
labelColor?: string;
|
|
16107
|
+
/** the whole row, drawn without moving anything in it */
|
|
16108
|
+
background?: string;
|
|
16109
|
+
/** vars that go together: consecutive vars with the same group share one tinted block */
|
|
16110
|
+
group?: string;
|
|
16111
|
+
/** the block's tint, read from the first var of the group that sets it */
|
|
16112
|
+
groupColor?: string;
|
|
16113
|
+
border?: string;
|
|
16114
|
+
/** choice vars: a look per option, keyed by the option value. The lit option is filled
|
|
16115
|
+
* with its own color */
|
|
16116
|
+
options?: Record<string, {
|
|
16117
|
+
icon?: string;
|
|
16118
|
+
color?: string;
|
|
16119
|
+
}>;
|
|
16120
|
+
/** the field is shown but disabled unless every named var holds one of the listed values:
|
|
16121
|
+
* `{ model: ['aesthetic', 'base'] }`. Checked against the var names when the workflow loads.
|
|
16122
|
+
* Display only: a disabled var's value still reaches the build */
|
|
16123
|
+
activeWhen?: Record<string, readonly (string | number | boolean)[]>;
|
|
16124
|
+
};
|
|
15998
16125
|
declare abstract class ComfyVarBase<T, Out> {
|
|
15999
16126
|
readonly defaultValue: T;
|
|
16000
16127
|
label?: string | undefined;
|
|
16001
16128
|
abstract readonly kind: VarKind;
|
|
16002
16129
|
/** the vars-spec key, stamped by DefinedWorkflow at define time — error messages name the var with it */
|
|
16003
16130
|
name?: string;
|
|
16131
|
+
/** panel looks, see VarUi. Never part of the value, never in a draft */
|
|
16132
|
+
uiOpts: VarUi;
|
|
16004
16133
|
value: T;
|
|
16005
16134
|
constructor(defaultValue: T, label?: string | undefined);
|
|
16006
16135
|
set(value: T): this;
|
|
16136
|
+
/** chainable: `v.choice([...], 'a').ui({ icon: 'M4 12h16', color: '#e0af68' })` */
|
|
16137
|
+
ui(p: VarUi): this;
|
|
16007
16138
|
/** what drafts persist for this var (subclasses may add fields, e.g. seed mode) */
|
|
16008
16139
|
toJSON(): unknown;
|
|
16009
16140
|
/** what the GRAPH consumes at build time (varValues maps these return types) */
|
|
@@ -16053,6 +16184,26 @@ declare class TextVar extends ComfyVar<string> {
|
|
|
16053
16184
|
type ActiveLoraSource = {
|
|
16054
16185
|
activeNames(): string[];
|
|
16055
16186
|
hostId?: string;
|
|
16187
|
+
/** the parts of a lora's keyword left out of the prompt (LorasVar: the `mute` list) */
|
|
16188
|
+
mutedWords?(name: string): string[];
|
|
16189
|
+
};
|
|
16190
|
+
/** where a prompt's tag completion comes from (the serve web editor). The list is never shipped:
|
|
16191
|
+
* `url` is a local path (relative to the workflow file, `~/`, `file://`) or an http(s) url */
|
|
16192
|
+
type PromptTagsOpts = {
|
|
16193
|
+
url: string;
|
|
16194
|
+
/** insert `long_hair` as written in the list; default inserts `long hair` */
|
|
16195
|
+
underscores?: boolean;
|
|
16196
|
+
/** put in front of an artist tag on insert (Anima: `@`) */
|
|
16197
|
+
artistPrefix?: string;
|
|
16198
|
+
};
|
|
16199
|
+
type PromptVarOpts = {
|
|
16200
|
+
label?: string;
|
|
16201
|
+
loraKeywordsFrom?: ActiveLoraSource;
|
|
16202
|
+
presets?: VarPresetSpec;
|
|
16203
|
+
/** booru tag completion for this prompt: a tag list url, or the url with its insert rules */
|
|
16204
|
+
tags?: string | PromptTagsOpts;
|
|
16205
|
+
/** false when the model's encoder ignores `(text:1.2)`: the editor then flags every weight */
|
|
16206
|
+
weights?: boolean;
|
|
16056
16207
|
};
|
|
16057
16208
|
/** what a prompt CONTRIBUTES to build: `vars.prompt.positive` / `.negative` */
|
|
16058
16209
|
type PromptValue = {
|
|
@@ -16062,28 +16213,28 @@ type PromptValue = {
|
|
|
16062
16213
|
/**
|
|
16063
16214
|
* prompt text with editor comforts, all resolved at BUILD time (the editor and
|
|
16064
16215
|
* drafts keep the raw text):
|
|
16065
|
-
* - `//`
|
|
16216
|
+
* - `//` starts a COMMENT to the end of the line (src/vars/promptSyntax.ts) — stripped
|
|
16066
16217
|
* - `- ` lines are NEGATIVE prompt lines — removed from `.positive`,
|
|
16067
16218
|
* comma-joined into `.negative`
|
|
16068
16219
|
* - with `loraKeywordsFrom`, the ACTIVE loras' hand-assigned keywords
|
|
16069
16220
|
* (src/vars/loraKeywords.ts, ⌃K in the TUI) prefix `.positive` —
|
|
16070
16221
|
* `injectedKeywords()` is public so the TUI can PREVIEW the injection.
|
|
16071
16222
|
*/
|
|
16072
|
-
declare class PromptVar extends ComfyVarBase<
|
|
16073
|
-
promptOpts:
|
|
16074
|
-
label?: string;
|
|
16075
|
-
loraKeywordsFrom?: ActiveLoraSource;
|
|
16076
|
-
presets?: VarPresetSpec;
|
|
16077
|
-
};
|
|
16223
|
+
declare class PromptVar extends ComfyVarBase<PromptInput, PromptValue> {
|
|
16224
|
+
promptOpts: PromptVarOpts;
|
|
16078
16225
|
readonly kind: 'prompt';
|
|
16079
16226
|
/** normalized `promptOpts.presets`, in authored order (TextVarOpts.presets owns the WHY) */
|
|
16080
16227
|
readonly presets: VarPreset[];
|
|
16081
|
-
constructor(defaultValue:
|
|
16082
|
-
|
|
16083
|
-
loraKeywordsFrom?: ActiveLoraSource;
|
|
16084
|
-
presets?: VarPresetSpec;
|
|
16085
|
-
});
|
|
16228
|
+
constructor(defaultValue: PromptInput, promptOpts?: PromptVarOpts);
|
|
16229
|
+
/** in lanes mode the text carries `# name` headers, so a lane survives a round trip */
|
|
16086
16230
|
parse(raw: string): boolean;
|
|
16231
|
+
toEditBuffer(): string;
|
|
16232
|
+
/** a var list shows the lanes by name, the inactive ones in parentheses */
|
|
16233
|
+
display(): string;
|
|
16234
|
+
/** the text the build reads: the plain string, or the active lanes joined in order */
|
|
16235
|
+
get text(): string;
|
|
16236
|
+
/** the tag list options in their one object form, null when this prompt has no completion */
|
|
16237
|
+
get tags(): PromptTagsOpts | null;
|
|
16087
16238
|
static isCommentLine(line: string): boolean;
|
|
16088
16239
|
static isNegativeLine(line: string): boolean;
|
|
16089
16240
|
/** the keyword prefix the flag will inject (deduped, lora-list order) — the TUI previews this */
|
|
@@ -16162,25 +16313,65 @@ declare class ToggleVar extends ComfyVar<boolean> {
|
|
|
16162
16313
|
parse(raw: string): boolean;
|
|
16163
16314
|
display(): string;
|
|
16164
16315
|
}
|
|
16316
|
+
/** how many options a choice holds: exactly one (the default), one or none, or any number */
|
|
16317
|
+
type ChoiceSelect = 'one' | 'zero-or-one' | 'many';
|
|
16165
16318
|
declare class ChoiceVar<T extends string> extends ComfyVar<T> {
|
|
16166
16319
|
readonly choices: readonly T[];
|
|
16167
16320
|
readonly kind: 'choice';
|
|
16321
|
+
readonly select: 'one';
|
|
16168
16322
|
constructor(choices: readonly T[], defaultValue: T, label?: string);
|
|
16169
16323
|
next(delta?: number): this;
|
|
16170
16324
|
parse(raw: string): boolean;
|
|
16171
16325
|
}
|
|
16172
|
-
/**
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16326
|
+
/** one option or none: `null` is "nothing picked", clicking the lit option clears it */
|
|
16327
|
+
declare class OptionalChoiceVar<T extends string> extends ComfyVar<T | null> {
|
|
16328
|
+
readonly choices: readonly T[];
|
|
16329
|
+
readonly kind: 'choice';
|
|
16330
|
+
readonly select: 'zero-or-one';
|
|
16331
|
+
constructor(choices: readonly T[], defaultValue: T | null, label?: string);
|
|
16332
|
+
/** pick `c`, or clear it when it is already the one picked */
|
|
16333
|
+
toggle(c: T): this;
|
|
16334
|
+
/** the TUI text form: a choice, or an empty line for none */
|
|
16335
|
+
parse(raw: string): boolean;
|
|
16336
|
+
toEditBuffer(): string;
|
|
16337
|
+
/** a draft from when this was a many choice holds a list: its first known option */
|
|
16338
|
+
loadJSON(value: unknown): this;
|
|
16339
|
+
display(): string;
|
|
16340
|
+
}
|
|
16341
|
+
/** any number of options, kept in the order the choices list them */
|
|
16342
|
+
declare class MultiChoiceVar<T extends string> extends ComfyVar<T[]> {
|
|
16343
|
+
readonly choices: readonly T[];
|
|
16344
|
+
readonly kind: 'choice';
|
|
16345
|
+
readonly select: 'many';
|
|
16346
|
+
constructor(choices: readonly T[], defaultValue: readonly T[], label?: string);
|
|
16347
|
+
toggle(c: T): this;
|
|
16348
|
+
/** the TUI text form: `a, b` */
|
|
16349
|
+
parse(raw: string): boolean;
|
|
16350
|
+
toEditBuffer(): string;
|
|
16351
|
+
/** a draft from when this was a single choice holds one value: a list of one. Unknown
|
|
16352
|
+
* options are dropped, the list comes back in the choices order */
|
|
16353
|
+
loadJSON(value: unknown): this;
|
|
16354
|
+
display(): string;
|
|
16355
|
+
}
|
|
16356
|
+
/** the three choice shapes, told apart by `select` */
|
|
16357
|
+
type AnyChoiceVar<T extends string = string> = ChoiceVar<T> | OptionalChoiceVar<T> | MultiChoiceVar<T>;
|
|
16358
|
+
type ChoiceOpts<S extends ChoiceSelect> = {
|
|
16359
|
+
label?: string;
|
|
16360
|
+
select: S;
|
|
16361
|
+
};
|
|
16362
|
+
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T, label?: string | {
|
|
16363
|
+
label?: string;
|
|
16364
|
+
select?: 'one';
|
|
16365
|
+
}): ChoiceVar<T>;
|
|
16366
|
+
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T | null, opts: ChoiceOpts<'zero-or-one'>): OptionalChoiceVar<T>;
|
|
16367
|
+
declare function choice<const T extends string>(choices: readonly T[], defaultValue: readonly T[], opts: ChoiceOpts<'many'>): MultiChoiceVar<T>;
|
|
16177
16368
|
type ActiveLora<T extends string> = {
|
|
16178
16369
|
lora_name: T;
|
|
16179
16370
|
strength_model: number;
|
|
16180
16371
|
strength_clip: number;
|
|
16181
16372
|
};
|
|
16182
16373
|
/** normalize a loras record into what a standard LoraLoader chain consumes */
|
|
16183
|
-
declare function activeLoras<T extends string>(loras:
|
|
16374
|
+
declare function activeLoras<T extends string>(loras: LorasInput<T>): ActiveLora<T>[];
|
|
16184
16375
|
/** what LorasVar.bindHost needs — structural, so ComfyVars never imports ComfyHost */
|
|
16185
16376
|
type LorasHost = {
|
|
16186
16377
|
data?: {
|
|
@@ -16196,7 +16387,12 @@ type LorasHost = {
|
|
|
16196
16387
|
* or feed it host discovery (`host.schema.getLoras(regex?)`) directly; never
|
|
16197
16388
|
* a hardcoded inventory. Selection is empty by default.
|
|
16198
16389
|
*/
|
|
16199
|
-
|
|
16390
|
+
/**
|
|
16391
|
+
* the value is EITHER a plain record OR `{ lanes: [...] }` (src/vars/lanes.ts): named groups the
|
|
16392
|
+
* build merges in listed order, skipping inactive ones. Every method reads the merged record and
|
|
16393
|
+
* writes into the lane that holds the lora, so the TUI never needs to know lanes exist
|
|
16394
|
+
*/
|
|
16395
|
+
declare class LorasVar<T extends string> extends ComfyVarBase<LorasInput<T>, LoraRecord<T>> {
|
|
16200
16396
|
private readonly optionsSource;
|
|
16201
16397
|
readonly kind: 'loras';
|
|
16202
16398
|
/** last non-false strength per lora, so untick → re-tick restores it */
|
|
@@ -16205,7 +16401,7 @@ declare class LorasVar<T extends string> extends ComfyVar<Partial<Record<T, Lora
|
|
|
16205
16401
|
private resolvedOptions;
|
|
16206
16402
|
/** which host these loras live on, so their metadata is read from ITS mirror */
|
|
16207
16403
|
hostId: string | undefined;
|
|
16208
|
-
constructor(optionsSource: readonly T[] | RegExp, initial?:
|
|
16404
|
+
constructor(optionsSource: readonly T[] | RegExp, initial?: LorasInput<T>, label?: string);
|
|
16209
16405
|
/** the filter the workflow declared, when it declared one (`v.loras(/krea-?2/i)`). Public so
|
|
16210
16406
|
* a UI can SHOW it, and so serve applies the same narrowing to loras only its lora-manager
|
|
16211
16407
|
* mirror knows, an unfiltered union would put the whole catalog back in a filtered picker */
|
|
@@ -16216,6 +16412,14 @@ declare class LorasVar<T extends string> extends ComfyVar<Partial<Record<T, Lora
|
|
|
16216
16412
|
* values of the SAME object_info enum the generated E_LoraName union comes from */
|
|
16217
16413
|
bindHost(host: LorasHost): void;
|
|
16218
16414
|
get names(): T[];
|
|
16415
|
+
/** the loras the build reads: the plain record, or the active lanes merged in order */
|
|
16416
|
+
get record(): LoraRecord<T>;
|
|
16417
|
+
/** what the graph consumes. A lora in two active lanes runs once, with its FIRST setting */
|
|
16418
|
+
outValue(): LoraRecord<T>;
|
|
16419
|
+
/** rewrite one lora wherever it lives: the plain record, or the lane that holds it */
|
|
16420
|
+
private write;
|
|
16421
|
+
/** the parts of this lora's prompt keyword left out of the prompt */
|
|
16422
|
+
mutedWords(name: string): string[];
|
|
16219
16423
|
/** loras currently ON (PromptVar keyword prefixing consumes this) */
|
|
16220
16424
|
activeNames(): T[];
|
|
16221
16425
|
isOn(name: T): boolean;
|
|
@@ -16242,14 +16446,25 @@ type SizePreset = {
|
|
|
16242
16446
|
};
|
|
16243
16447
|
/** SDXL-style ~1MP buckets, multiples of 64 — safe for most latent models */
|
|
16244
16448
|
declare const DEFAULT_SIZE_PRESETS: SizePreset[];
|
|
16449
|
+
/** the same aspect ratios around 512, for SD1.5-era models trained at ~0.25MP */
|
|
16450
|
+
declare const SD15_SIZE_PRESETS: SizePreset[];
|
|
16451
|
+
/** starred presets are one click away in the panel, before the full list */
|
|
16452
|
+
declare const DEFAULT_STARRED_SIZES: string[];
|
|
16453
|
+
/** the family that matches a workflow's own default: a 512×512 workflow is an SD1.5-era one,
|
|
16454
|
+
* and offering it 1024 buckets would be offering sizes it was never trained at */
|
|
16455
|
+
declare function sizePresetsFor(defaultValue: SizeValue | undefined): SizePreset[];
|
|
16245
16456
|
/** width/height picker: presets + free `WxH` entry + optionally the LIVE
|
|
16246
16457
|
* size of a linked image var (the widget shows
|
|
16247
16458
|
* `WxH size of image '<name>'` as a pickable row) */
|
|
16248
16459
|
declare class SizeVar extends ComfyVar<SizeValue> {
|
|
16249
16460
|
readonly presets: SizePreset[];
|
|
16250
16461
|
readonly imageVar?: ImageVar | undefined;
|
|
16462
|
+
/** preset LABELS starred by default; a user's own stars live in the panel */
|
|
16463
|
+
readonly starred: readonly string[];
|
|
16251
16464
|
readonly kind: 'size';
|
|
16252
|
-
constructor(defaultValue?: SizeValue, presets?: SizePreset[], label?: string, imageVar?: ImageVar | undefined
|
|
16465
|
+
constructor(defaultValue?: SizeValue, presets?: SizePreset[], label?: string, imageVar?: ImageVar | undefined,
|
|
16466
|
+
/** preset LABELS starred by default; a user's own stars live in the panel */
|
|
16467
|
+
starred?: readonly string[]);
|
|
16253
16468
|
/** current dimensions of the linked image var — null when no link, unset
|
|
16254
16469
|
* path, or an unreadable/undecodable file (those errors belong to the
|
|
16255
16470
|
* image var itself, the size row simply disappears) */
|
|
@@ -16306,11 +16521,9 @@ declare class ImageVar extends ComfyVar<string> {
|
|
|
16306
16521
|
/** the var constructors: v.text / v.prompt / v.int / v.float / v.seed / v.toggle / v.choice / v.loras / v.size / v.image */
|
|
16307
16522
|
declare const v: {
|
|
16308
16523
|
text: (defaultValue: string, opts?: TextVarOpts | string) => TextVar;
|
|
16309
|
-
prompt: (
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
presets?: VarPresetSpec;
|
|
16313
|
-
}) => PromptVar;
|
|
16524
|
+
prompt: (
|
|
16525
|
+
/** a string, or `{ lanes: [{ name, prompt, active }] }` merged in listed order */
|
|
16526
|
+
defaultValue: PromptInput, opts?: PromptVarOpts) => PromptVar;
|
|
16314
16527
|
int: (defaultValue: number, opts?: {
|
|
16315
16528
|
min?: number;
|
|
16316
16529
|
max?: number;
|
|
@@ -16328,10 +16541,15 @@ declare const v: {
|
|
|
16328
16541
|
mode?: SeedMode;
|
|
16329
16542
|
}) => SeedVar;
|
|
16330
16543
|
toggle: (defaultValue: boolean, label?: string) => ToggleVar;
|
|
16331
|
-
|
|
16332
|
-
|
|
16544
|
+
/** exactly one option (the default), `{ select: 'zero-or-one' }` for one or none (value
|
|
16545
|
+
* `T | null`), `{ select: 'many' }` for any number (value `T[]`) */
|
|
16546
|
+
choice: typeof choice;
|
|
16547
|
+
loras: <T extends string = string>(options: readonly T[] | RegExp,
|
|
16548
|
+
/** a record, or `{ lanes: [{ name, active, loras }] }` merged in listed order */
|
|
16549
|
+
initial?: LorasInput<T>, label?: string) => LorasVar<T>;
|
|
16333
16550
|
size: (defaultValue?: SizeValue, opts?: {
|
|
16334
16551
|
presets?: SizePreset[];
|
|
16552
|
+
starred?: readonly string[];
|
|
16335
16553
|
label?: string;
|
|
16336
16554
|
image?: ImageVar;
|
|
16337
16555
|
}) => SizeVar;
|
|
@@ -16349,6 +16567,7 @@ type AnyVar = {
|
|
|
16349
16567
|
readonly label?: string;
|
|
16350
16568
|
/** the vars-spec key — DefinedWorkflow writes it at define time */
|
|
16351
16569
|
name?: string;
|
|
16570
|
+
readonly uiOpts: VarUi;
|
|
16352
16571
|
parse(raw: string): boolean;
|
|
16353
16572
|
loadJSON(value: unknown): unknown;
|
|
16354
16573
|
reset(): unknown;
|
|
@@ -16375,8 +16594,8 @@ type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['
|
|
|
16375
16594
|
* `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
|
|
16376
16595
|
*/
|
|
16377
16596
|
type BoundVars<ID extends string> = Omit<typeof v, 'loras'> & {
|
|
16378
|
-
loras(options: RegExp, initial?:
|
|
16379
|
-
loras<T extends string>(options: readonly T[], initial?:
|
|
16597
|
+
loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
|
|
16598
|
+
loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
|
|
16380
16599
|
};
|
|
16381
16600
|
type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
16382
16601
|
/** short id; also names the workflow instances */
|
|
@@ -16392,6 +16611,13 @@ type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
|
16392
16611
|
/** builds the graph from the CURRENT var values; re-executed on every run().
|
|
16393
16612
|
* may be async (e.g. image uploads through the wf param) */
|
|
16394
16613
|
build: (b: SdkForHost<ID>['Builder'], vars: VarValues<V>, wf: ComfyWorkflow<ID>) => void | Promise<void>;
|
|
16614
|
+
/** named texts computed from the CURRENT var values, the same `vars` build receives, shown
|
|
16615
|
+
* live while the vars are edited (the serve panel: a foldable block under generate). Use the
|
|
16616
|
+
* function build uses, so a preview is what the run sends, never a paraphrase of it */
|
|
16617
|
+
previews?: Record<string, (vars: VarValues<V>) => string>;
|
|
16618
|
+
/** free search tags for the serve omnibox, added to the ones read from the graph
|
|
16619
|
+
* (`image`, `audio`, `video`, `text`, `llm`, `edit`) */
|
|
16620
|
+
tags?: string[];
|
|
16395
16621
|
};
|
|
16396
16622
|
/**
|
|
16397
16623
|
* a re-runnable workflow definition: `build` re-executes per run with the
|
|
@@ -16403,6 +16629,9 @@ declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = V
|
|
|
16403
16629
|
/** spec.vars resolved once (may be given as a thunk) — the SAME instances for the workflow's lifetime */
|
|
16404
16630
|
readonly vars: V;
|
|
16405
16631
|
constructor(host: ComfyHost<ID>, spec: DefineWorkflowSpec<ID, V>);
|
|
16632
|
+
/** every preview for the current var values. A preview that throws, or vars that cannot be
|
|
16633
|
+
* read yet (an image var still empty), give a line saying so instead of failing the others */
|
|
16634
|
+
computePreviews(): Record<string, string>;
|
|
16406
16635
|
/** [name, var] pairs, for drivers that enumerate the knobs */
|
|
16407
16636
|
entries(): [string, AnyVar][];
|
|
16408
16637
|
/** the workflow built by the latest run() (null before the first run) */
|
|
@@ -16417,10 +16646,12 @@ declare class DefinedWorkflow<ID extends string = string, V extends VarsSpec = V
|
|
|
16417
16646
|
* build() for copy/export never advances). `p.host` substitutes the host
|
|
16418
16647
|
* the graph is built against (TUI host override): node/model availability
|
|
16419
16648
|
* there surfaces as workflow.problems / server validation, by design.
|
|
16649
|
+
* `p.dry` builds a graph only to read it: nothing is uploaded, lastWorkflow is left alone.
|
|
16420
16650
|
*/
|
|
16421
16651
|
build(p?: {
|
|
16422
16652
|
advance?: boolean;
|
|
16423
16653
|
host?: ComfyHost<ID>;
|
|
16654
|
+
dry?: boolean;
|
|
16424
16655
|
}): Promise<ComfyWorkflow<ID>>;
|
|
16425
16656
|
/** build a fresh graph from the current var values, send it, wait for outputs.
|
|
16426
16657
|
* connects first (idempotent) — modules can import offline from the schema cache.
|
|
@@ -16640,7 +16871,11 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
16640
16871
|
private postJSON_;
|
|
16641
16872
|
/** drop every PENDING prompt from the server queue (the running one keeps going) */
|
|
16642
16873
|
clearQueue: () => Promise<void>;
|
|
16643
|
-
/** interrupt the
|
|
16874
|
+
/** a repeat interrupt for the same running prompt inside this window reuses the first request */
|
|
16875
|
+
interruptCoalesceMs: number;
|
|
16876
|
+
private _lastInterrupt;
|
|
16877
|
+
/** interrupt the CURRENTLY RUNNING prompt. A burst of /interrupt posts can make the ComfyUI
|
|
16878
|
+
* python process quit, so repeats for the same prompt are coalesced into one request */
|
|
16644
16879
|
interrupt: () => Promise<void>;
|
|
16645
16880
|
/** delete ONE prompt's server history entry */
|
|
16646
16881
|
deleteHistory: (promptId: string) => Promise<void>;
|
|
@@ -16942,6 +17177,9 @@ declare class ComfyWorkflow<ID extends string = string> {
|
|
|
16942
17177
|
apiJson: ComfyApiJson;
|
|
16943
17178
|
outputFolder: AbsolutePath;
|
|
16944
17179
|
constructor(host: ComfyHost<ID>, data: ComfyWorkflowData);
|
|
17180
|
+
/** a dry build: media loads name the local file by its hash and upload nothing, so a graph
|
|
17181
|
+
* can be built only to be read (serve derives workflow tags this way) */
|
|
17182
|
+
dry: boolean;
|
|
16945
17183
|
/** nodes, in creation order */
|
|
16946
17184
|
nodes: ComfyNode[];
|
|
16947
17185
|
/** @internal every node constructor must call this */
|
|
@@ -17293,6 +17531,8 @@ declare class ComfyTS {
|
|
|
17293
17531
|
resolveFromDrafts(relativePath: string): AbsolutePath;
|
|
17294
17532
|
/** master prompts of the serve web ui's prompt enhancer — hand-editable markdown */
|
|
17295
17533
|
resolveFromPromptEnhancers(relativePath: string): AbsolutePath;
|
|
17534
|
+
/** the serve web ui's LLM configs (prompt enhancer), one json per config */
|
|
17535
|
+
resolveFromLlmConfigs(relativePath: string): AbsolutePath;
|
|
17296
17536
|
resolveFromCache(relativePath: string): AbsolutePath;
|
|
17297
17537
|
/** local TUI settings (preview mode, last draft per workflow) — gitignored */
|
|
17298
17538
|
get settingsPath(): AbsolutePath;
|
|
@@ -17657,5 +17897,5 @@ declare function promptEnhancerPresets(): VarPresetSpec;
|
|
|
17657
17897
|
//#region src/cli/tui-env.d.ts
|
|
17658
17898
|
declare function isTuiActive(): boolean;
|
|
17659
17899
|
//#endregion
|
|
17660
|
-
export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyVar, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, ChoiceVar, type CodegenOptions, type ComfyApiJson, type ComfyApiNodeJson, 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, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, ImageVar, ImageVarEmptyError, type ImageVarOpts, IntVar, InvalidPromptError, IsEqual, type LiteGraphJSON, type LmLoraItem, type LoraMirror, type LoraNameOf, type LoraStrength, type LoraSweep, type LorasHost, LorasVar, MDContent, Maybe, MediaImage, type MediaImageData, type NodeMode, NodeOf, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type ProgressReport, type PromptEnhancer, type PromptID, type PromptRelated_WsMsg, type PromptValue, PromptVar, type QualifiedNodeKey, RelativePath, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarValues, type VarsSpec, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, toPresetList, v };
|
|
17900
|
+
export { AbsolutePath, type ActiveLora, type ActiveLoraSource, type AnyChoiceVar, type AnyVar, BaseNode, BaseNodeFactory, BaseNodeInputs, BaseNodeOutputs, type BoundVars, Branded, type CanonicalGroup, type CanonicalInput, type CanonicalLink, type CanonicalNode, type CanonicalOutput, type CanonicalWidgetValues, type CanonicalWorkflow, 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, ComfyWorkflow, ComfyWorkflowBuilder, type ComfyWorkflowData, type ComfyWorkflowID, type ConnectOptions, ConvertibleImageFormat, DEFAULT_IMAGE_EXTENSIONS, DEFAULT_SIZE_PRESETS, DEFAULT_STARRED_SIZES, type DefineWorkflowSpec, DefinedWorkflow, Either, EmptyRecord, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, 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, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type ProgressReport, type PromptEnhancer, type PromptID, type PromptInput, type PromptLane, type PromptLanes, type PromptRelated_WsMsg, type PromptTagsOpts, type PromptValue, PromptVar, type PromptVarOpts, type QualifiedNodeKey, RelativePath, type Requirements, ResilientWebSocketClient, Result, ResultFailure, type RunSettings, SD15_SIZE_PRESETS, SaveOptions, SdkForHost, SeedVar, type SizePreset, type SizeValue, SizeVar, Tagged, TextVar, type TextVarOpts, ToggleVar, type VarKind, type VarPreset, type VarPresetSpec, type VarUi, type VarValues, type VarsSpec, WorkflowConvertError, WorkflowNormalizeError, type WsLike, type WsMessageEvent, type WsMsg, __FAIL, __OK, activeLoras, activePresetLabel, asAbsolutePath, asHTMLContent, asMDContent, asRelativePath, auto, auto_, clearLoraKeywordOverride, codegenSDK, convertFlowToLiteGraphJSON, convertLiteGraphToPrompt, createMemoryStorage, exampleImagePath, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, isTuiActive, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, promptEnhancerPresets, readPromptEnhancers, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v };
|
|
17661
17901
|
//# sourceMappingURL=index.d.ts.map
|