comfy-ts 2.14.0 → 2.16.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-CUeo843w.js → LogsSt-Ct7Le0S_.js} +2 -2
- package/dist/{LogsSt-CUeo843w.js.map → LogsSt-Ct7Le0S_.js.map} +1 -1
- package/dist/cli.js +4 -4
- package/dist/index.cjs +268 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +176 -26
- package/dist/index.d.ts +176 -26
- package/dist/index.js +262 -56
- package/dist/index.js.map +1 -1
- package/dist/{run-serve-DUqcn0h3.js → run-serve-C78hD7t9.js} +119 -40
- package/dist/run-serve-C78hD7t9.js.map +1 -0
- package/dist/{run-tui-D-LaSqgB.js → run-tui-nPETFRmk.js} +15 -9
- package/dist/run-tui-nPETFRmk.js.map +1 -0
- package/dist/{schemaDrift-E95iTF7E.js → schemaDrift-wb5XkrHV.js} +218 -27
- package/dist/schemaDrift-wb5XkrHV.js.map +1 -0
- package/dist/serve-web.js +64 -50
- package/dist/{state-BytbdZ8s.js → state-BMW57_M0.js} +45 -35
- package/dist/state-BMW57_M0.js.map +1 -0
- package/dist/web.d.ts +173 -26
- package/dist/web.js +251 -53
- package/dist/web.js.map +1 -1
- package/examples/README.md +1 -0
- package/examples/media/README.md +9 -0
- package/examples/media/sine_440hz_3s.flac +0 -0
- package/examples/media/testsrc_256x256_3s.mp4 +0 -0
- package/examples/media/voice_en_6s.flac +0 -0
- package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +9 -1
- package/examples/rvion/10-anima-t2i.cflow.ts +8 -1
- package/examples/rvion/14-video-soundtrack.cflow.ts +47 -0
- package/examples/rvion/15-tts-voice-clone.cflow.ts +111 -0
- package/guide-for-agents.md +3 -1
- package/package.json +2 -2
- package/src/cli/serve/ServeApp.ts +115 -32
- package/src/cli/serve/applyVarPayload.ts +5 -3
- package/src/cli/serve/describeVar.ts +5 -3
- package/src/cli/serve/resultHistory.ts +22 -6
- package/src/cli/serve/run-serve.ts +4 -1
- package/src/cli/serve/web/api.ts +4 -0
- package/src/cli/serve/web/components/DraftTabs.tsx +2 -1
- package/src/cli/serve/web/components/Gallery.tsx +86 -5
- package/src/cli/serve/web/components/HistoryPicker.tsx +5 -3
- package/src/cli/serve/web/components/MenuButton.tsx +2 -4
- package/src/cli/serve/web/components/Omnibox.tsx +2 -1
- package/src/cli/serve/web/components/PromptEnhancer.tsx +4 -3
- package/src/cli/serve/web/components/ShortcutsModal.tsx +2 -1
- package/src/cli/serve/web/components/SideMenu.tsx +2 -1
- package/src/cli/serve/web/components/VarsForm.tsx +5 -3
- package/src/cli/serve/web/components/controls/LorasControl.tsx +4 -3
- package/src/cli/serve/web/components/controls/MediaControl.tsx +111 -0
- package/src/cli/serve/web/components/controls/PresetPicker.tsx +2 -1
- package/src/cli/serve/web/components/controls/PromptControl.tsx +2 -1
- package/src/cli/serve/web/components/controls/SizeControl.tsx +2 -1
- package/src/cli/serve/web/state/FormSt.ts +70 -2
- package/src/cli/serve/web/state/escape.ts +16 -0
- package/src/cli/serve/web/state/host.ts +2 -0
- package/src/cli/serve/web/state/mediaDrop.ts +76 -0
- package/src/cli/serve/web/styles.ts +16 -2
- package/src/cli/tui/imagePicker/ImagePickerOverlay.tsx +4 -1
- package/src/cli/tui/imagePicker/ImagePickerSt.ts +15 -6
- package/src/cli/tui/state/TuiSt.ts +1 -1
- package/src/coreExports.ts +20 -1
- package/src/exampleAssets.ts +13 -3
- package/src/host/ComfyUploader.ts +34 -27
- package/src/index.ts +1 -1
- package/src/runner/ComfyExecution.ts +38 -20
- package/src/runner/ComfyWsApi.ts +3 -0
- package/src/runner/mediaKinds.ts +51 -0
- package/src/vars/ComfyVars.ts +178 -34
- package/src/vars/DefinedWorkflow.ts +35 -2
- package/dist/run-serve-DUqcn0h3.js.map +0 -1
- package/dist/run-tui-D-LaSqgB.js.map +0 -1
- package/dist/schemaDrift-E95iTF7E.js.map +0 -1
- package/dist/state-BytbdZ8s.js.map +0 -1
- package/src/cli/serve/web/components/controls/ImageControl.tsx +0 -72
package/dist/web.d.ts
CHANGED
|
@@ -11946,6 +11946,16 @@ declare const types$1: import("arktype").Module<{
|
|
|
11946
11946
|
subfolder: string;
|
|
11947
11947
|
type: string;
|
|
11948
11948
|
}[] | undefined;
|
|
11949
|
+
video?: {
|
|
11950
|
+
filename: string;
|
|
11951
|
+
subfolder: string;
|
|
11952
|
+
type: string;
|
|
11953
|
+
}[] | undefined;
|
|
11954
|
+
gifs?: {
|
|
11955
|
+
filename: string;
|
|
11956
|
+
subfolder: string;
|
|
11957
|
+
type: string;
|
|
11958
|
+
}[] | undefined;
|
|
11949
11959
|
text?: unknown[] | undefined;
|
|
11950
11960
|
};
|
|
11951
11961
|
prompt_id: PromptID;
|
|
@@ -12027,6 +12037,16 @@ declare const types$1: import("arktype").Module<{
|
|
|
12027
12037
|
subfolder: string;
|
|
12028
12038
|
type: string;
|
|
12029
12039
|
}[] | undefined;
|
|
12040
|
+
video?: {
|
|
12041
|
+
filename: string;
|
|
12042
|
+
subfolder: string;
|
|
12043
|
+
type: string;
|
|
12044
|
+
}[] | undefined;
|
|
12045
|
+
gifs?: {
|
|
12046
|
+
filename: string;
|
|
12047
|
+
subfolder: string;
|
|
12048
|
+
type: string;
|
|
12049
|
+
}[] | undefined;
|
|
12030
12050
|
text?: unknown[] | undefined;
|
|
12031
12051
|
};
|
|
12032
12052
|
prompt_id: PromptID;
|
|
@@ -12094,6 +12114,16 @@ declare const types$1: import("arktype").Module<{
|
|
|
12094
12114
|
subfolder: string;
|
|
12095
12115
|
type: string;
|
|
12096
12116
|
}[] | undefined;
|
|
12117
|
+
video?: {
|
|
12118
|
+
filename: string;
|
|
12119
|
+
subfolder: string;
|
|
12120
|
+
type: string;
|
|
12121
|
+
}[] | undefined;
|
|
12122
|
+
gifs?: {
|
|
12123
|
+
filename: string;
|
|
12124
|
+
subfolder: string;
|
|
12125
|
+
type: string;
|
|
12126
|
+
}[] | undefined;
|
|
12097
12127
|
text?: unknown[] | undefined;
|
|
12098
12128
|
};
|
|
12099
12129
|
prompt_id: PromptID;
|
|
@@ -12200,6 +12230,16 @@ declare const types$1: import("arktype").Module<{
|
|
|
12200
12230
|
subfolder: string;
|
|
12201
12231
|
type: string;
|
|
12202
12232
|
}[] | undefined;
|
|
12233
|
+
video?: {
|
|
12234
|
+
filename: string;
|
|
12235
|
+
subfolder: string;
|
|
12236
|
+
type: string;
|
|
12237
|
+
}[] | undefined;
|
|
12238
|
+
gifs?: {
|
|
12239
|
+
filename: string;
|
|
12240
|
+
subfolder: string;
|
|
12241
|
+
type: string;
|
|
12242
|
+
}[] | undefined;
|
|
12203
12243
|
text?: unknown[] | undefined;
|
|
12204
12244
|
};
|
|
12205
12245
|
prompt_id: PromptID;
|
|
@@ -12695,6 +12735,9 @@ type ComfyAudioOutput = {
|
|
|
12695
12735
|
bytes: Uint8Array;
|
|
12696
12736
|
absPath: AbsolutePath | null;
|
|
12697
12737
|
};
|
|
12738
|
+
/** one video file an output node published (SaveVideo, SaveWEBM, VHS_VideoCombine), same
|
|
12739
|
+
* shape and same retrieval as an audio file */
|
|
12740
|
+
type ComfyVideoOutput = ComfyAudioOutput;
|
|
12698
12741
|
/** one text output as an output node published it (`nodeKey` is null when the node left the snapshot) */
|
|
12699
12742
|
type ComfyTextOutput = {
|
|
12700
12743
|
nodeId: ComfyNodeId;
|
|
@@ -12766,7 +12809,14 @@ declare class ComfyExecution {
|
|
|
12766
12809
|
}[];
|
|
12767
12810
|
/** audio files retrieved for this execution, in arrival order (final once `done` resolves) */
|
|
12768
12811
|
audios: ComfyAudioOutput[];
|
|
12769
|
-
|
|
12812
|
+
/** video retrievals that failed (their files are missing from `videos`) */
|
|
12813
|
+
videoErrors: {
|
|
12814
|
+
video: ComfyImageInfo;
|
|
12815
|
+
error: unknown;
|
|
12816
|
+
}[];
|
|
12817
|
+
/** video files retrieved for this execution, in arrival order (final once `done` resolves) */
|
|
12818
|
+
videos: ComfyVideoOutput[];
|
|
12819
|
+
private retrieveFile;
|
|
12770
12820
|
/** image retrievals that failed (their images are missing from `images`);
|
|
12771
12821
|
* `image` is null for SaveImageWebsocket frames (no server-side file info exists) */
|
|
12772
12822
|
imageErrors: {
|
|
@@ -15885,12 +15935,29 @@ type ComfyUploadImageResult = {
|
|
|
15885
15935
|
declare class ComfyUploader {
|
|
15886
15936
|
host: ComfyHost;
|
|
15887
15937
|
constructor(host: ComfyHost);
|
|
15888
|
-
/**
|
|
15938
|
+
/** names this process already uploaded to this host: a LoadAudio or LoadVideo list is not
|
|
15939
|
+
* reloaded after an upload, so without it every run re-sent the same file */
|
|
15940
|
+
private uploaded;
|
|
15941
|
+
/** upload an image (hash-named, deduped against the host's LoadImage list) */
|
|
15889
15942
|
uploadImage: (img: MediaImage, p: {
|
|
15890
15943
|
type?: Maybe<'input' | 'temp' | 'output'>;
|
|
15891
15944
|
override?: Maybe<boolean>;
|
|
15892
15945
|
subfolder?: string;
|
|
15893
15946
|
}) => Promise<ComfyImageName>;
|
|
15947
|
+
/**
|
|
15948
|
+
* THE upload path: any file a loader node reads from the host's input folder. ComfyUI routes
|
|
15949
|
+
* audio and video through `/upload/image` too. `slot` is the loader input whose value list
|
|
15950
|
+
* says the file is already there (`LoadImage.image`, `LoadAudio.audio`, `LoadVideo.file`)
|
|
15951
|
+
*/
|
|
15952
|
+
uploadInput: (p: {
|
|
15953
|
+
blob: Blob;
|
|
15954
|
+
/** the name the file should get on the host, hash-derived by callers so reruns dedupe */
|
|
15955
|
+
name: string;
|
|
15956
|
+
slot: string;
|
|
15957
|
+
type?: Maybe<'input' | 'temp' | 'output'>;
|
|
15958
|
+
override?: Maybe<boolean>;
|
|
15959
|
+
subfolder?: string;
|
|
15960
|
+
}) => Promise<string>;
|
|
15894
15961
|
}
|
|
15895
15962
|
//#endregion
|
|
15896
15963
|
//#region src/host/hostUrl.d.ts
|
|
@@ -16078,6 +16145,9 @@ declare function toPresetList(spec: VarPresetSpec | undefined): VarPreset[];
|
|
|
16078
16145
|
/** which preset the value still IS, or null once it was hand-edited (trailing whitespace ignored) */
|
|
16079
16146
|
declare function activePresetLabel(presets: readonly VarPreset[], value: string): string | null;
|
|
16080
16147
|
//#endregion
|
|
16148
|
+
//#region src/runner/mediaKinds.d.ts
|
|
16149
|
+
type MediaKind = 'image' | 'audio' | 'video';
|
|
16150
|
+
//#endregion
|
|
16081
16151
|
//#region src/vars/ComfyVars.d.ts
|
|
16082
16152
|
/**
|
|
16083
16153
|
* the var's CLASS, and the only safe way to discriminate one: `instanceof` compares class
|
|
@@ -16087,7 +16157,7 @@ declare function activePresetLabel(presets: readonly VarPreset[], value: string)
|
|
|
16087
16157
|
* in a consumer app: "var 'prompt' has unsupported kind 'text'", for EVERY kind). A string tag
|
|
16088
16158
|
* crosses bundles; a class identity does not.
|
|
16089
16159
|
*/
|
|
16090
|
-
type VarKind = 'text' | 'prompt' | 'int' | 'float' | 'seed' | 'toggle' | 'choice' | 'loras' | 'size' |
|
|
16160
|
+
type VarKind = 'text' | 'prompt' | 'int' | 'float' | 'seed' | 'toggle' | 'choice' | 'loras' | 'size' | MediaKind;
|
|
16091
16161
|
/**
|
|
16092
16162
|
* full base: T is what's STORED/edited, Out what the GRAPH consumes at build
|
|
16093
16163
|
* time. They usually coincide — extend `ComfyVar<T>` for that. PromptVar is
|
|
@@ -16315,20 +16385,33 @@ declare class ToggleVar extends ComfyVar<boolean> {
|
|
|
16315
16385
|
}
|
|
16316
16386
|
/** how many options a choice holds: exactly one (the default), one or none, or any number */
|
|
16317
16387
|
type ChoiceSelect = 'one' | 'zero-or-one' | 'many';
|
|
16388
|
+
/** where a host-bound choice reads its options: one loader input of the host's live schema,
|
|
16389
|
+
* optionally narrowed (`v.model`) */
|
|
16390
|
+
type HostSlotSource = {
|
|
16391
|
+
slot: string;
|
|
16392
|
+
filter?: RegExp;
|
|
16393
|
+
};
|
|
16318
16394
|
declare class ChoiceVar<T extends string> extends ComfyVar<T> {
|
|
16319
|
-
readonly choices: readonly T[];
|
|
16320
16395
|
readonly kind: 'choice';
|
|
16321
16396
|
readonly select: 'one';
|
|
16322
|
-
|
|
16397
|
+
private list;
|
|
16398
|
+
constructor(choices: readonly T[] | HostSlotSource, defaultValue: T, label?: string);
|
|
16399
|
+
get choices(): readonly T[];
|
|
16400
|
+
/** set for `v.model`: the loader input this choice lists */
|
|
16401
|
+
get hostSlot(): HostSlotSource | null;
|
|
16402
|
+
bindHost(host: LorasHost): void;
|
|
16323
16403
|
next(delta?: number): this;
|
|
16324
16404
|
parse(raw: string): boolean;
|
|
16325
16405
|
}
|
|
16326
16406
|
/** one option or none: `null` is "nothing picked", clicking the lit option clears it */
|
|
16327
16407
|
declare class OptionalChoiceVar<T extends string> extends ComfyVar<T | null> {
|
|
16328
|
-
readonly choices: readonly T[];
|
|
16329
16408
|
readonly kind: 'choice';
|
|
16330
16409
|
readonly select: 'zero-or-one';
|
|
16331
|
-
|
|
16410
|
+
private list;
|
|
16411
|
+
constructor(choices: readonly T[] | HostSlotSource, defaultValue: T | null, label?: string);
|
|
16412
|
+
get choices(): readonly T[];
|
|
16413
|
+
get hostSlot(): HostSlotSource | null;
|
|
16414
|
+
bindHost(host: LorasHost): void;
|
|
16332
16415
|
/** pick `c`, or clear it when it is already the one picked */
|
|
16333
16416
|
toggle(c: T): this;
|
|
16334
16417
|
/** the TUI text form: a choice, or an empty line for none */
|
|
@@ -16365,6 +16448,22 @@ declare function choice<const T extends string>(choices: readonly T[], defaultVa
|
|
|
16365
16448
|
}): ChoiceVar<T>;
|
|
16366
16449
|
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T | null, opts: ChoiceOpts<'zero-or-one'>): OptionalChoiceVar<T>;
|
|
16367
16450
|
declare function choice<const T extends string>(choices: readonly T[], defaultValue: readonly T[], opts: ChoiceOpts<'many'>): MultiChoiceVar<T>;
|
|
16451
|
+
type ModelVarOpts<T extends string> = {
|
|
16452
|
+
/** narrows the host's list: `/krea/i` */
|
|
16453
|
+
filter?: RegExp;
|
|
16454
|
+
label?: string;
|
|
16455
|
+
/** a file name, or null for "the workflow decides" (the build then reads null) */
|
|
16456
|
+
default: T | null;
|
|
16457
|
+
};
|
|
16458
|
+
/** a choice over the host's LIVE file list for one loader input (`'UNETLoader.unet_name'`),
|
|
16459
|
+
* resolved at define time and rebound by serve's refresh-schema: a downloaded model is picked
|
|
16460
|
+
* in the draft, never written into the workflow file */
|
|
16461
|
+
declare function model<T extends string>(slot: string, opts: ModelVarOpts<T> & {
|
|
16462
|
+
default: T;
|
|
16463
|
+
}): ChoiceVar<T>;
|
|
16464
|
+
declare function model<T extends string>(slot: string, opts: ModelVarOpts<T> & {
|
|
16465
|
+
default: null;
|
|
16466
|
+
}): OptionalChoiceVar<T>;
|
|
16368
16467
|
type ActiveLora<T extends string> = {
|
|
16369
16468
|
lora_name: T;
|
|
16370
16469
|
strength_model: number;
|
|
@@ -16379,6 +16478,7 @@ type LorasHost = {
|
|
|
16379
16478
|
};
|
|
16380
16479
|
schema: {
|
|
16381
16480
|
getLoras(filter?: RegExp): string[];
|
|
16481
|
+
stringValues(slot: string): string[];
|
|
16382
16482
|
};
|
|
16383
16483
|
};
|
|
16384
16484
|
/**
|
|
@@ -16477,35 +16577,44 @@ declare class SizeVar extends ComfyVar<SizeValue> {
|
|
|
16477
16577
|
parse(raw: string): boolean;
|
|
16478
16578
|
display(): string;
|
|
16479
16579
|
}
|
|
16480
|
-
type
|
|
16580
|
+
type MediaVarOpts = {
|
|
16481
16581
|
/** where the TUI picker starts browsing AND what relative values resolve against (absPath) */
|
|
16482
16582
|
folder?: string;
|
|
16483
16583
|
/** picker listing filter, lowercase without dots; never affects the value. NOT a security
|
|
16484
|
-
* boundary: `comfy-ts serve` keeps its own floor of
|
|
16584
|
+
* boundary: `comfy-ts serve` keeps its own floor of media types it will read off the disk
|
|
16485
16585
|
* and upload, which this list may NARROW but never widen (emptying it changes the picker,
|
|
16486
16586
|
* not what the api accepts) */
|
|
16487
16587
|
extensions?: readonly string[];
|
|
16488
16588
|
label?: string;
|
|
16489
16589
|
};
|
|
16590
|
+
type ImageVarOpts = MediaVarOpts;
|
|
16591
|
+
type AudioVarOpts = MediaVarOpts;
|
|
16592
|
+
type VideoVarOpts = MediaVarOpts;
|
|
16490
16593
|
declare const DEFAULT_IMAGE_EXTENSIONS: readonly string[];
|
|
16491
|
-
|
|
16492
|
-
declare
|
|
16594
|
+
declare const DEFAULT_AUDIO_EXTENSIONS: readonly string[];
|
|
16595
|
+
declare const DEFAULT_VIDEO_EXTENSIONS: readonly string[];
|
|
16596
|
+
/** empty media var consumed at build time — typed so drivers surface it apart from real crashes */
|
|
16597
|
+
declare class MediaVarEmptyError extends Error {
|
|
16493
16598
|
readonly varName: string;
|
|
16599
|
+
readonly media: MediaKind;
|
|
16494
16600
|
/** name, not instanceof: the cli bundle and dist/index.js each define this class */
|
|
16495
|
-
readonly name
|
|
16496
|
-
constructor(varName: string);
|
|
16601
|
+
readonly name: string;
|
|
16602
|
+
constructor(varName: string, media?: MediaKind);
|
|
16497
16603
|
}
|
|
16604
|
+
/** the image-only name this error had first; the same class */
|
|
16605
|
+
declare const ImageVarEmptyError: typeof MediaVarEmptyError;
|
|
16606
|
+
type ImageVarEmptyError = MediaVarEmptyError;
|
|
16498
16607
|
/**
|
|
16499
|
-
* a local
|
|
16608
|
+
* a local media file path. The VALUE is a PLAIN PATH STRING — text-encodable,
|
|
16500
16609
|
* drafts persist it verbatim (toJSON = the string), hand-editable in the
|
|
16501
|
-
* draft json. Empty = unset: outValue()/absPath() throw
|
|
16502
|
-
* so a build never runs on a silent placeholder. The TUI opens the
|
|
16503
|
-
* picker overlay for kind
|
|
16504
|
-
*/
|
|
16505
|
-
declare class
|
|
16506
|
-
opts:
|
|
16507
|
-
readonly kind:
|
|
16508
|
-
constructor(defaultValue: string, opts?:
|
|
16610
|
+
* draft json. Empty = unset: outValue()/absPath() throw MediaVarEmptyError,
|
|
16611
|
+
* so a build never runs on a silent placeholder. The TUI opens the file
|
|
16612
|
+
* picker overlay for every media kind.
|
|
16613
|
+
*/
|
|
16614
|
+
declare abstract class MediaVar extends ComfyVar<string> {
|
|
16615
|
+
opts: MediaVarOpts;
|
|
16616
|
+
abstract readonly kind: MediaKind;
|
|
16617
|
+
constructor(defaultValue: string, opts?: MediaVarOpts);
|
|
16509
16618
|
/** what the picker lists (lowercase, no dots) */
|
|
16510
16619
|
get extensions(): readonly string[];
|
|
16511
16620
|
set(value: string): this;
|
|
@@ -16517,8 +16626,26 @@ declare class ImageVar extends ComfyVar<string> {
|
|
|
16517
16626
|
/** empty = unset: the build fails LOUD here (varValues calls outValue) */
|
|
16518
16627
|
outValue(): string;
|
|
16519
16628
|
display(): string;
|
|
16629
|
+
/** upload the file hash-named (reruns dedupe) and add this medium's loader node. A dry
|
|
16630
|
+
* build names the file by its hash and uploads nothing */
|
|
16631
|
+
protected loadVia(wf: ComfyWorkflow<string>): Promise<unknown>;
|
|
16632
|
+
}
|
|
16633
|
+
/** a local image path, loaded through LoadImage */
|
|
16634
|
+
declare class ImageVar extends MediaVar {
|
|
16635
|
+
readonly kind: 'image';
|
|
16636
|
+
loadInWorkflow<WID extends string>(wf: ComfyWorkflow<WID>): Promise<NodeOf<WID, 'LoadImage'>>;
|
|
16520
16637
|
}
|
|
16521
|
-
/**
|
|
16638
|
+
/** a local audio path, loaded through LoadAudio */
|
|
16639
|
+
declare class AudioVar extends MediaVar {
|
|
16640
|
+
readonly kind: 'audio';
|
|
16641
|
+
loadInWorkflow<WID extends string>(wf: ComfyWorkflow<WID>): Promise<NodeOf<WID, 'LoadAudio'>>;
|
|
16642
|
+
}
|
|
16643
|
+
/** a local video path, loaded through LoadVideo */
|
|
16644
|
+
declare class VideoVar extends MediaVar {
|
|
16645
|
+
readonly kind: 'video';
|
|
16646
|
+
loadInWorkflow<WID extends string>(wf: ComfyWorkflow<WID>): Promise<NodeOf<WID, 'LoadVideo'>>;
|
|
16647
|
+
}
|
|
16648
|
+
/** the var constructors: v.text / v.prompt / v.int / v.float / v.seed / v.toggle / v.choice / v.model / v.loras / v.size / v.image / v.audio / v.video */
|
|
16522
16649
|
declare const v: {
|
|
16523
16650
|
text: (defaultValue: string, opts?: TextVarOpts | string) => TextVar;
|
|
16524
16651
|
prompt: (
|
|
@@ -16553,7 +16680,11 @@ declare const v: {
|
|
|
16553
16680
|
label?: string;
|
|
16554
16681
|
image?: ImageVar;
|
|
16555
16682
|
}) => SizeVar;
|
|
16556
|
-
|
|
16683
|
+
/** host-bound: only inside defineWorkflow({ vars: (v) => … }), typed per slot there */
|
|
16684
|
+
model: typeof model;
|
|
16685
|
+
image: (defaultValue: string, opts?: MediaVarOpts) => ImageVar;
|
|
16686
|
+
audio: (defaultValue: string, opts?: MediaVarOpts) => AudioVar;
|
|
16687
|
+
video: (defaultValue: string, opts?: MediaVarOpts) => VideoVar;
|
|
16557
16688
|
};
|
|
16558
16689
|
/**
|
|
16559
16690
|
* structural face of any var: readonly `value` keeps ComfyVar<T> assignable
|
|
@@ -16593,10 +16724,26 @@ type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['
|
|
|
16593
16724
|
* the `v` handed to a vars LAMBDA: the global factory, host-typed —
|
|
16594
16725
|
* `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
|
|
16595
16726
|
*/
|
|
16596
|
-
type BoundVars<ID extends string> = Omit<typeof v, 'loras'> & {
|
|
16727
|
+
type BoundVars<ID extends string> = Omit<typeof v, 'loras' | 'model'> & {
|
|
16597
16728
|
loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
|
|
16598
16729
|
loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
|
|
16730
|
+
/** the host's file list for one loader input: the slot autocompletes, the value is its union */
|
|
16731
|
+
model: ModelFactory<SdkForHost<ID>['Slots']>;
|
|
16599
16732
|
};
|
|
16733
|
+
/** `v.model` typed by a host's slot table S (`Slots`): its own interface, so the host id's
|
|
16734
|
+
* variance stays measurable (inlined into BoundVars, ComfyHost<ID> stopped being a ComfyHost<string>) */
|
|
16735
|
+
interface ModelFactory<S> {
|
|
16736
|
+
<K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
|
|
16737
|
+
default: S[K] & string;
|
|
16738
|
+
}): ChoiceVar<S[K] & string>;
|
|
16739
|
+
<K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
|
|
16740
|
+
default: null;
|
|
16741
|
+
}): OptionalChoiceVar<S[K] & string>;
|
|
16742
|
+
}
|
|
16743
|
+
/** every `Node.input` slot of the host's generated sdk (any string without one) */
|
|
16744
|
+
type SlotNameOf<ID extends string> = keyof SdkForHost<ID>['Slots'] & string;
|
|
16745
|
+
/** the value union of one slot, strings only (a loader file list) */
|
|
16746
|
+
type SlotValueOf<ID extends string, K extends string> = K extends keyof SdkForHost<ID>['Slots'] ? SdkForHost<ID>['Slots'][K] & string : string;
|
|
16600
16747
|
type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
16601
16748
|
/** short id; also names the workflow instances */
|
|
16602
16749
|
id?: string;
|
|
@@ -17944,5 +18091,5 @@ type HostToPanel = {
|
|
|
17944
18091
|
comfyTs: 'get-state';
|
|
17945
18092
|
};
|
|
17946
18093
|
//#endregion
|
|
17947
|
-
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, 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, MultiChoiceVar, type NodeMode, NodeOf, OptionalChoiceVar, type PanelError, type PanelHostAction, type PanelRequest, type PanelResultAction, type PanelState, type PanelToHost, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type ProgressReport, 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, getComfyStorage, getLoraDisplayName, getLoraInfo, getLoraKeyword, getLoraPreviewUrl, getLoraTriggerWords, hostIdToNamespace, isLoraKeywordFromMirror, loraKey, loraKeywordFromMirror, loraMatchesFilter, loraSearchNames, loraSearchText, loraTag, normalizeWorkflow, number_Timestamp, parseHostBase, parseWorkflowJson, refreshLoraInfoCacheIfChanged, reloadLoraInfoCache, renderHttpBase, renderWsUrl, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v };
|
|
18094
|
+
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 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 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 PanelError, type PanelHostAction, type PanelRequest, type PanelResultAction, type PanelState, type PanelToHost, type ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type ProgressReport, 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, 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, resultFailure, resultSuccess, setDefaultComfyStorage, setLoraKeyword, sizePresetsFor, toPresetList, v };
|
|
17948
18095
|
//# sourceMappingURL=web.d.ts.map
|