comfy-ts 2.15.0 → 2.17.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 +23 -0
- package/dist/{run-serve-B5PfIuhK.js → ServeApp-BSA5yzxZ.js} +28 -446
- package/dist/ServeApp-BSA5yzxZ.js.map +1 -0
- package/dist/cli.js +18 -5
- package/dist/cli.js.map +1 -1
- package/dist/exampleAssets-BfWzygoM.js +38 -0
- package/dist/exampleAssets-BfWzygoM.js.map +1 -0
- package/dist/{LogsSt-C3UIWR-o.js → findDefinedWorkflow-0lG-VTEd.js} +201 -201
- package/dist/findDefinedWorkflow-0lG-VTEd.js.map +1 -0
- package/dist/index.cjs +202 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -14
- package/dist/index.d.ts +115 -14
- package/dist/index.js +202 -62
- package/dist/index.js.map +1 -1
- package/dist/run-run-DnaMLCFn.js +450 -0
- package/dist/run-run-DnaMLCFn.js.map +1 -0
- package/dist/run-serve-CbKxIu6i.js +418 -0
- package/dist/run-serve-CbKxIu6i.js.map +1 -0
- package/dist/{run-tui-D-N4_yyX.js → run-tui-B0AQWbad.js} +6 -37
- package/dist/run-tui-B0AQWbad.js.map +1 -0
- package/dist/{schemaDrift-BkN8rLiZ.js → schemaDrift-CbsABBuk.js} +59 -5
- package/dist/schemaDrift-CbsABBuk.js.map +1 -0
- package/dist/serve-web.js +48 -48
- package/dist/{state-CZsYJqB6.js → state-C2oDiQ26.js} +146 -60
- package/dist/state-C2oDiQ26.js.map +1 -0
- package/dist/web.d.ts +115 -14
- package/dist/web.js +202 -62
- package/dist/web.js.map +1 -1
- package/examples/README.md +2 -0
- package/examples/media/README.md +6 -5
- 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/15-tts-voice-clone.cflow.ts +111 -0
- package/examples/rvion/16-tts-voice-design.cflow.ts +71 -0
- package/guide-for-agents.md +5 -1
- package/package.json +2 -2
- package/src/cli/comfy-ts-cli.ts +14 -1
- package/src/cli/run/findModules.ts +36 -0
- package/src/cli/run/flagValue.ts +61 -0
- package/src/cli/run/outputPaths.ts +41 -0
- package/src/cli/run/pickModule.ts +41 -0
- package/src/cli/run/run-run.ts +250 -0
- package/src/cli/run/runArgs.ts +61 -0
- package/src/cli/run/sidecar.ts +27 -0
- package/src/cli/serve/ServeApp.ts +28 -42
- package/src/cli/serve/web/components/DraftTabs.tsx +10 -3
- package/src/cli/serve/web/components/Gallery.tsx +2 -1
- 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/controls/LorasControl.tsx +4 -3
- 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/draftTabs.ts +12 -0
- package/src/cli/serve/web/state/escape.ts +16 -0
- package/src/cli/serve/web/state/shortcutCatalog.ts +1 -0
- package/src/coreExports.ts +12 -1
- package/src/host/ComfyHost.ts +73 -40
- package/src/host/previewMethod.ts +29 -0
- package/src/runner/ComfyExecution.ts +45 -1
- package/src/runner/ComfyWorkflow.ts +6 -1
- package/src/runner/ComfyWsApi.ts +1 -1
- package/src/runner/wsBinaryFrame.ts +48 -25
- package/src/vars/ComfyVars.ts +86 -13
- package/src/vars/DefinedWorkflow.ts +36 -2
- package/dist/LogsSt-C3UIWR-o.js.map +0 -1
- package/dist/run-serve-B5PfIuhK.js.map +0 -1
- package/dist/run-tui-D-N4_yyX.js.map +0 -1
- package/dist/schemaDrift-BkN8rLiZ.js.map +0 -1
- package/dist/state-CZsYJqB6.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -12283,6 +12283,7 @@ type PendingBinaryFrame = {
|
|
|
12283
12283
|
type: 'binary_preview_frame';
|
|
12284
12284
|
bytes: Uint8Array;
|
|
12285
12285
|
mime: string;
|
|
12286
|
+
metadata: unknown;
|
|
12286
12287
|
};
|
|
12287
12288
|
type PendingWsItem = PromptRelated_WsMsg | PendingBinaryFrame;
|
|
12288
12289
|
type WsMsg = typeof types$1.WsMsg.infer;
|
|
@@ -12759,6 +12760,25 @@ type ExecutionProgress = ProgressReport & {
|
|
|
12759
12760
|
* puts its partial answer here every few tokens */
|
|
12760
12761
|
progressText: string | null;
|
|
12761
12762
|
};
|
|
12763
|
+
/** one live preview frame of a run: the image a sampler is forming, once per step */
|
|
12764
|
+
type ExecutionPreview = {
|
|
12765
|
+
promptId: PromptID;
|
|
12766
|
+
/** the image as ComfyUI encoded it, jpeg or png */
|
|
12767
|
+
bytes: Uint8Array;
|
|
12768
|
+
mime: string;
|
|
12769
|
+
/** the node that sent the frame: the frame's own metadata when it names one (type 4 frames),
|
|
12770
|
+
* else the node executing when it arrived. Null when neither is known */
|
|
12771
|
+
nodeId: ComfyNodeId | null;
|
|
12772
|
+
/** that node's class name in the sent prompt (`KSampler`), null when unknown */
|
|
12773
|
+
nodeName: string | null;
|
|
12774
|
+
/** that node's own counter when the frame arrived (sampler step of total), null when unknown */
|
|
12775
|
+
step: {
|
|
12776
|
+
value: number;
|
|
12777
|
+
max: number;
|
|
12778
|
+
} | null;
|
|
12779
|
+
/** the raw metadata json of a type 4 frame (`node_id`, `prompt_id`, …), null on a type 1 frame */
|
|
12780
|
+
metadata: unknown;
|
|
12781
|
+
};
|
|
12762
12782
|
declare class ComfyExecution {
|
|
12763
12783
|
workflow: ComfyWorkflow;
|
|
12764
12784
|
data: ComfyExecutionData;
|
|
@@ -12769,6 +12789,7 @@ declare class ComfyExecution {
|
|
|
12769
12789
|
scrubHistory?: boolean;
|
|
12770
12790
|
ephemeral?: boolean;
|
|
12771
12791
|
onProgress?: Maybe<(p: ExecutionProgress) => void>;
|
|
12792
|
+
onPreview?: Maybe<(p: ExecutionPreview) => void>;
|
|
12772
12793
|
logProgress?: boolean;
|
|
12773
12794
|
});
|
|
12774
12795
|
/** local disk saving, OPT-IN (architecture.md item 14); null = outputs stay in memory */
|
|
@@ -12781,6 +12802,8 @@ declare class ComfyExecution {
|
|
|
12781
12802
|
snapshot: Maybe<ExecutionSnapshot>;
|
|
12782
12803
|
/** called on every progress-relevant websocket message */
|
|
12783
12804
|
onProgress: Maybe<(p: ExecutionProgress) => void>;
|
|
12805
|
+
/** called on every live preview frame of this run. Null = frames are never decoded for it */
|
|
12806
|
+
onPreview: Maybe<(p: ExecutionPreview) => void>;
|
|
12784
12807
|
/** render a live single-line progress report to the console */
|
|
12785
12808
|
logProgress: boolean;
|
|
12786
12809
|
readonly startedAt: number;
|
|
@@ -12834,6 +12857,13 @@ declare class ComfyExecution {
|
|
|
12834
12857
|
* SENT snapshot (the ephemeral rewrite only touches the snapshot, so the
|
|
12835
12858
|
* live graph may still say SaveImage) — binary frames are then OUTPUTS */
|
|
12836
12859
|
get wsOutputNodeExecuting(): boolean;
|
|
12860
|
+
/** @internal a live preview frame of this run; never an output (the host routes ws saver frames
|
|
12861
|
+
* to onWsImageOutput before they get here) */
|
|
12862
|
+
onPreviewFrame(p: {
|
|
12863
|
+
bytes: Uint8Array;
|
|
12864
|
+
mime: string;
|
|
12865
|
+
metadata: unknown;
|
|
12866
|
+
}): void;
|
|
12837
12867
|
/** one binary ws frame = one output image of the executing SaveImageWebsocket
|
|
12838
12868
|
* node (architecture.md item 14 — the zero-server-disk path) */
|
|
12839
12869
|
onWsImageOutput: (p: {
|
|
@@ -12863,6 +12893,9 @@ declare class ComfyExecution {
|
|
|
12863
12893
|
private _finish;
|
|
12864
12894
|
}
|
|
12865
12895
|
//#endregion
|
|
12896
|
+
//#region src/host/previewMethod.d.ts
|
|
12897
|
+
type PreviewMethod = 'none' | 'auto' | 'latent2rgb' | 'taesd';
|
|
12898
|
+
//#endregion
|
|
12866
12899
|
//#region src/sdk-generator/comfyui-sdk-codegen.d.ts
|
|
12867
12900
|
/**
|
|
12868
12901
|
* convert a host id to the namespace name it gets inside the global `Comfy` namespace
|
|
@@ -16385,20 +16418,33 @@ declare class ToggleVar extends ComfyVar<boolean> {
|
|
|
16385
16418
|
}
|
|
16386
16419
|
/** how many options a choice holds: exactly one (the default), one or none, or any number */
|
|
16387
16420
|
type ChoiceSelect = 'one' | 'zero-or-one' | 'many';
|
|
16421
|
+
/** where a host-bound choice reads its options: one loader input of the host's live schema,
|
|
16422
|
+
* optionally narrowed (`v.model`) */
|
|
16423
|
+
type HostSlotSource = {
|
|
16424
|
+
slot: string;
|
|
16425
|
+
filter?: RegExp;
|
|
16426
|
+
};
|
|
16388
16427
|
declare class ChoiceVar<T extends string> extends ComfyVar<T> {
|
|
16389
|
-
readonly choices: readonly T[];
|
|
16390
16428
|
readonly kind: 'choice';
|
|
16391
16429
|
readonly select: 'one';
|
|
16392
|
-
|
|
16430
|
+
private list;
|
|
16431
|
+
constructor(choices: readonly T[] | HostSlotSource, defaultValue: T, label?: string);
|
|
16432
|
+
get choices(): readonly T[];
|
|
16433
|
+
/** set for `v.model`: the loader input this choice lists */
|
|
16434
|
+
get hostSlot(): HostSlotSource | null;
|
|
16435
|
+
bindHost(host: LorasHost): void;
|
|
16393
16436
|
next(delta?: number): this;
|
|
16394
16437
|
parse(raw: string): boolean;
|
|
16395
16438
|
}
|
|
16396
16439
|
/** one option or none: `null` is "nothing picked", clicking the lit option clears it */
|
|
16397
16440
|
declare class OptionalChoiceVar<T extends string> extends ComfyVar<T | null> {
|
|
16398
|
-
readonly choices: readonly T[];
|
|
16399
16441
|
readonly kind: 'choice';
|
|
16400
16442
|
readonly select: 'zero-or-one';
|
|
16401
|
-
|
|
16443
|
+
private list;
|
|
16444
|
+
constructor(choices: readonly T[] | HostSlotSource, defaultValue: T | null, label?: string);
|
|
16445
|
+
get choices(): readonly T[];
|
|
16446
|
+
get hostSlot(): HostSlotSource | null;
|
|
16447
|
+
bindHost(host: LorasHost): void;
|
|
16402
16448
|
/** pick `c`, or clear it when it is already the one picked */
|
|
16403
16449
|
toggle(c: T): this;
|
|
16404
16450
|
/** the TUI text form: a choice, or an empty line for none */
|
|
@@ -16435,6 +16481,22 @@ declare function choice<const T extends string>(choices: readonly T[], defaultVa
|
|
|
16435
16481
|
}): ChoiceVar<T>;
|
|
16436
16482
|
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T | null, opts: ChoiceOpts<'zero-or-one'>): OptionalChoiceVar<T>;
|
|
16437
16483
|
declare function choice<const T extends string>(choices: readonly T[], defaultValue: readonly T[], opts: ChoiceOpts<'many'>): MultiChoiceVar<T>;
|
|
16484
|
+
type ModelVarOpts<T extends string> = {
|
|
16485
|
+
/** narrows the host's list: `/krea/i` */
|
|
16486
|
+
filter?: RegExp;
|
|
16487
|
+
label?: string;
|
|
16488
|
+
/** a file name, or null for "the workflow decides" (the build then reads null) */
|
|
16489
|
+
default: T | null;
|
|
16490
|
+
};
|
|
16491
|
+
/** a choice over the host's LIVE file list for one loader input (`'UNETLoader.unet_name'`),
|
|
16492
|
+
* resolved at define time and rebound by serve's refresh-schema: a downloaded model is picked
|
|
16493
|
+
* in the draft, never written into the workflow file */
|
|
16494
|
+
declare function model<T extends string>(slot: string, opts: ModelVarOpts<T> & {
|
|
16495
|
+
default: T;
|
|
16496
|
+
}): ChoiceVar<T>;
|
|
16497
|
+
declare function model<T extends string>(slot: string, opts: ModelVarOpts<T> & {
|
|
16498
|
+
default: null;
|
|
16499
|
+
}): OptionalChoiceVar<T>;
|
|
16438
16500
|
type ActiveLora<T extends string> = {
|
|
16439
16501
|
lora_name: T;
|
|
16440
16502
|
strength_model: number;
|
|
@@ -16449,6 +16511,7 @@ type LorasHost = {
|
|
|
16449
16511
|
};
|
|
16450
16512
|
schema: {
|
|
16451
16513
|
getLoras(filter?: RegExp): string[];
|
|
16514
|
+
stringValues(slot: string): string[];
|
|
16452
16515
|
};
|
|
16453
16516
|
};
|
|
16454
16517
|
/**
|
|
@@ -16556,6 +16619,9 @@ type MediaVarOpts = {
|
|
|
16556
16619
|
* not what the api accepts) */
|
|
16557
16620
|
extensions?: readonly string[];
|
|
16558
16621
|
label?: string;
|
|
16622
|
+
/** the text var a file's `<name>.txt` sidecar fills, when a driver sets this var from a file
|
|
16623
|
+
* and leaves that one unset: a voice clip's transcript (`comfy-ts run`) */
|
|
16624
|
+
sidecarText?: TextVar;
|
|
16559
16625
|
};
|
|
16560
16626
|
type ImageVarOpts = MediaVarOpts;
|
|
16561
16627
|
type AudioVarOpts = MediaVarOpts;
|
|
@@ -16615,7 +16681,7 @@ declare class VideoVar extends MediaVar {
|
|
|
16615
16681
|
readonly kind: 'video';
|
|
16616
16682
|
loadInWorkflow<WID extends string>(wf: ComfyWorkflow<WID>): Promise<NodeOf<WID, 'LoadVideo'>>;
|
|
16617
16683
|
}
|
|
16618
|
-
/** the var constructors: v.text / v.prompt / v.int / v.float / v.seed / v.toggle / v.choice / v.loras / v.size / v.image / v.audio / v.video */
|
|
16684
|
+
/** 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 */
|
|
16619
16685
|
declare const v: {
|
|
16620
16686
|
text: (defaultValue: string, opts?: TextVarOpts | string) => TextVar;
|
|
16621
16687
|
prompt: (
|
|
@@ -16650,6 +16716,8 @@ declare const v: {
|
|
|
16650
16716
|
label?: string;
|
|
16651
16717
|
image?: ImageVar;
|
|
16652
16718
|
}) => SizeVar;
|
|
16719
|
+
/** host-bound: only inside defineWorkflow({ vars: (v) => … }), typed per slot there */
|
|
16720
|
+
model: typeof model;
|
|
16653
16721
|
image: (defaultValue: string, opts?: MediaVarOpts) => ImageVar;
|
|
16654
16722
|
audio: (defaultValue: string, opts?: MediaVarOpts) => AudioVar;
|
|
16655
16723
|
video: (defaultValue: string, opts?: MediaVarOpts) => VideoVar;
|
|
@@ -16692,10 +16760,26 @@ type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['
|
|
|
16692
16760
|
* the `v` handed to a vars LAMBDA: the global factory, host-typed —
|
|
16693
16761
|
* `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
|
|
16694
16762
|
*/
|
|
16695
|
-
type BoundVars<ID extends string> = Omit<typeof v, 'loras'> & {
|
|
16763
|
+
type BoundVars<ID extends string> = Omit<typeof v, 'loras' | 'model'> & {
|
|
16696
16764
|
loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
|
|
16697
16765
|
loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
|
|
16766
|
+
/** the host's file list for one loader input: the slot autocompletes, the value is its union */
|
|
16767
|
+
model: ModelFactory<SdkForHost<ID>['Slots']>;
|
|
16698
16768
|
};
|
|
16769
|
+
/** `v.model` typed by a host's slot table S (`Slots`): its own interface, so the host id's
|
|
16770
|
+
* variance stays measurable (inlined into BoundVars, ComfyHost<ID> stopped being a ComfyHost<string>) */
|
|
16771
|
+
interface ModelFactory<S> {
|
|
16772
|
+
<K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
|
|
16773
|
+
default: S[K] & string;
|
|
16774
|
+
}): ChoiceVar<S[K] & string>;
|
|
16775
|
+
<K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
|
|
16776
|
+
default: null;
|
|
16777
|
+
}): OptionalChoiceVar<S[K] & string>;
|
|
16778
|
+
}
|
|
16779
|
+
/** every `Node.input` slot of the host's generated sdk (any string without one) */
|
|
16780
|
+
type SlotNameOf<ID extends string> = keyof SdkForHost<ID>['Slots'] & string;
|
|
16781
|
+
/** the value union of one slot, strings only (a loader file list) */
|
|
16782
|
+
type SlotValueOf<ID extends string, K extends string> = K extends keyof SdkForHost<ID>['Slots'] ? SdkForHost<ID>['Slots'][K] & string : string;
|
|
16699
16783
|
type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
16700
16784
|
/** short id; also names the workflow instances */
|
|
16701
16785
|
id?: string;
|
|
@@ -16839,6 +16923,12 @@ declare class ComfyHostAuthError extends Error {
|
|
|
16839
16923
|
hostId: string;
|
|
16840
16924
|
constructor(code: 401 | 402 | 429, hostId: string, message: string);
|
|
16841
16925
|
}
|
|
16926
|
+
type LatentPreview = {
|
|
16927
|
+
promptID: Maybe<PromptID>;
|
|
16928
|
+
receivedAt: number_Timestamp;
|
|
16929
|
+
blob: Blob;
|
|
16930
|
+
url: string;
|
|
16931
|
+
};
|
|
16842
16932
|
declare class ComfyHost<ID extends string = string> {
|
|
16843
16933
|
data: ComfyHostData & {
|
|
16844
16934
|
id: ID;
|
|
@@ -16980,6 +17070,10 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
16980
17070
|
deleteHistory: (promptId: string) => Promise<void>;
|
|
16981
17071
|
/** wipe the server's WHOLE prompt history (every user of that server) */
|
|
16982
17072
|
clearHistory: () => Promise<void>;
|
|
17073
|
+
/** the `--preview-method` this host was launched with, read from `GET /system_stats`.
|
|
17074
|
+
* `'none'` (ComfyUI's default) means no live preview frame will ever arrive; null = the host
|
|
17075
|
+
* does not publish its launch flags (a cloud host), so only a run can tell */
|
|
17076
|
+
fetchPreviewMethod: () => Promise<PreviewMethod | null>;
|
|
16983
17077
|
/** the server's recent console buffer (entries are write CHUNKS, not lines) */
|
|
16984
17078
|
fetchRawLogs: () => Promise<{
|
|
16985
17079
|
entries: LogEntry[];
|
|
@@ -17008,13 +17102,12 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17008
17102
|
private activePromptID;
|
|
17009
17103
|
/** method to either execute or buffer the incoming message */
|
|
17010
17104
|
routeOrBuffer(prompt_id: PromptID, msg: PromptRelated_WsMsg): void;
|
|
17011
|
-
/** the
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
}>;
|
|
17105
|
+
/** the last raw preview frame; `latentPreview` decodes it only when read */
|
|
17106
|
+
private _latentFrame;
|
|
17107
|
+
private _latentPreview;
|
|
17108
|
+
/** the latent image beeing generated, in case you want to display it. Built on read: a
|
|
17109
|
+
* session that never reads it never decodes a frame nor holds an object url */
|
|
17110
|
+
get latentPreview(): Maybe<LatentPreview>;
|
|
17018
17111
|
/** byte-level latent-preview hook (e.g. TUI live preview panel) */
|
|
17019
17112
|
onLatentPreview: Maybe<(p: {
|
|
17020
17113
|
bytes: Uint8Array;
|
|
@@ -17049,6 +17142,10 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17049
17142
|
* sockets keep streaming (a half-open socket receives nothing, so this
|
|
17050
17143
|
* never revives one) */
|
|
17051
17144
|
lastWsMessageAt: number | null;
|
|
17145
|
+
/** a type 1 or 4 frame. Parsed only when someone wants it, in this order (architecture.md,
|
|
17146
|
+
* Live previews): the ws saver's output, the pre-registration buffer, the run's onPreview,
|
|
17147
|
+
* the host hook. Nobody listening = the frame is kept by reference and never copied */
|
|
17148
|
+
private onPreviewFrame;
|
|
17052
17149
|
onMessage(e: WsMessageEvent): void;
|
|
17053
17150
|
}
|
|
17054
17151
|
//#endregion
|
|
@@ -17246,6 +17343,10 @@ type RunSettings = {
|
|
|
17246
17343
|
log?: boolean;
|
|
17247
17344
|
/** called on every progress-relevant websocket message */
|
|
17248
17345
|
onProgress?: (p: ExecutionProgress) => void;
|
|
17346
|
+
/** called on every live preview frame of this run (the image a sampler is forming). Opt in:
|
|
17347
|
+
* without it no frame is decoded for the run. ComfyUI sends frames only when launched with
|
|
17348
|
+
* `--preview-method`, see `host.fetchPreviewMethod()` */
|
|
17349
|
+
onPreview?: (p: ExecutionPreview) => void;
|
|
17249
17350
|
};
|
|
17250
17351
|
/** exactly what was sent to the host for one execution, frozen at send time */
|
|
17251
17352
|
type ExecutionSnapshot = {
|
|
@@ -17999,5 +18100,5 @@ declare function promptEnhancerPresets(): VarPresetSpec;
|
|
|
17999
18100
|
//#region src/cli/tui-env.d.ts
|
|
18000
18101
|
declare function isTuiActive(): boolean;
|
|
18001
18102
|
//#endregion
|
|
18002
|
-
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, 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, 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, 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, exampleImagePath, exampleMediaPath, 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 };
|
|
18103
|
+
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 ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, 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 ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, 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, 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, exampleImagePath, exampleMediaPath, 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 };
|
|
18003
18104
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -12283,6 +12283,7 @@ type PendingBinaryFrame = {
|
|
|
12283
12283
|
type: 'binary_preview_frame';
|
|
12284
12284
|
bytes: Uint8Array;
|
|
12285
12285
|
mime: string;
|
|
12286
|
+
metadata: unknown;
|
|
12286
12287
|
};
|
|
12287
12288
|
type PendingWsItem = PromptRelated_WsMsg | PendingBinaryFrame;
|
|
12288
12289
|
type WsMsg = typeof types$1.WsMsg.infer;
|
|
@@ -12759,6 +12760,25 @@ type ExecutionProgress = ProgressReport & {
|
|
|
12759
12760
|
* puts its partial answer here every few tokens */
|
|
12760
12761
|
progressText: string | null;
|
|
12761
12762
|
};
|
|
12763
|
+
/** one live preview frame of a run: the image a sampler is forming, once per step */
|
|
12764
|
+
type ExecutionPreview = {
|
|
12765
|
+
promptId: PromptID;
|
|
12766
|
+
/** the image as ComfyUI encoded it, jpeg or png */
|
|
12767
|
+
bytes: Uint8Array;
|
|
12768
|
+
mime: string;
|
|
12769
|
+
/** the node that sent the frame: the frame's own metadata when it names one (type 4 frames),
|
|
12770
|
+
* else the node executing when it arrived. Null when neither is known */
|
|
12771
|
+
nodeId: ComfyNodeId | null;
|
|
12772
|
+
/** that node's class name in the sent prompt (`KSampler`), null when unknown */
|
|
12773
|
+
nodeName: string | null;
|
|
12774
|
+
/** that node's own counter when the frame arrived (sampler step of total), null when unknown */
|
|
12775
|
+
step: {
|
|
12776
|
+
value: number;
|
|
12777
|
+
max: number;
|
|
12778
|
+
} | null;
|
|
12779
|
+
/** the raw metadata json of a type 4 frame (`node_id`, `prompt_id`, …), null on a type 1 frame */
|
|
12780
|
+
metadata: unknown;
|
|
12781
|
+
};
|
|
12762
12782
|
declare class ComfyExecution {
|
|
12763
12783
|
workflow: ComfyWorkflow;
|
|
12764
12784
|
data: ComfyExecutionData;
|
|
@@ -12769,6 +12789,7 @@ declare class ComfyExecution {
|
|
|
12769
12789
|
scrubHistory?: boolean;
|
|
12770
12790
|
ephemeral?: boolean;
|
|
12771
12791
|
onProgress?: Maybe<(p: ExecutionProgress) => void>;
|
|
12792
|
+
onPreview?: Maybe<(p: ExecutionPreview) => void>;
|
|
12772
12793
|
logProgress?: boolean;
|
|
12773
12794
|
});
|
|
12774
12795
|
/** local disk saving, OPT-IN (architecture.md item 14); null = outputs stay in memory */
|
|
@@ -12781,6 +12802,8 @@ declare class ComfyExecution {
|
|
|
12781
12802
|
snapshot: Maybe<ExecutionSnapshot>;
|
|
12782
12803
|
/** called on every progress-relevant websocket message */
|
|
12783
12804
|
onProgress: Maybe<(p: ExecutionProgress) => void>;
|
|
12805
|
+
/** called on every live preview frame of this run. Null = frames are never decoded for it */
|
|
12806
|
+
onPreview: Maybe<(p: ExecutionPreview) => void>;
|
|
12784
12807
|
/** render a live single-line progress report to the console */
|
|
12785
12808
|
logProgress: boolean;
|
|
12786
12809
|
readonly startedAt: number;
|
|
@@ -12834,6 +12857,13 @@ declare class ComfyExecution {
|
|
|
12834
12857
|
* SENT snapshot (the ephemeral rewrite only touches the snapshot, so the
|
|
12835
12858
|
* live graph may still say SaveImage) — binary frames are then OUTPUTS */
|
|
12836
12859
|
get wsOutputNodeExecuting(): boolean;
|
|
12860
|
+
/** @internal a live preview frame of this run; never an output (the host routes ws saver frames
|
|
12861
|
+
* to onWsImageOutput before they get here) */
|
|
12862
|
+
onPreviewFrame(p: {
|
|
12863
|
+
bytes: Uint8Array;
|
|
12864
|
+
mime: string;
|
|
12865
|
+
metadata: unknown;
|
|
12866
|
+
}): void;
|
|
12837
12867
|
/** one binary ws frame = one output image of the executing SaveImageWebsocket
|
|
12838
12868
|
* node (architecture.md item 14 — the zero-server-disk path) */
|
|
12839
12869
|
onWsImageOutput: (p: {
|
|
@@ -12863,6 +12893,9 @@ declare class ComfyExecution {
|
|
|
12863
12893
|
private _finish;
|
|
12864
12894
|
}
|
|
12865
12895
|
//#endregion
|
|
12896
|
+
//#region src/host/previewMethod.d.ts
|
|
12897
|
+
type PreviewMethod = 'none' | 'auto' | 'latent2rgb' | 'taesd';
|
|
12898
|
+
//#endregion
|
|
12866
12899
|
//#region src/sdk-generator/comfyui-sdk-codegen.d.ts
|
|
12867
12900
|
/**
|
|
12868
12901
|
* convert a host id to the namespace name it gets inside the global `Comfy` namespace
|
|
@@ -16385,20 +16418,33 @@ declare class ToggleVar extends ComfyVar<boolean> {
|
|
|
16385
16418
|
}
|
|
16386
16419
|
/** how many options a choice holds: exactly one (the default), one or none, or any number */
|
|
16387
16420
|
type ChoiceSelect = 'one' | 'zero-or-one' | 'many';
|
|
16421
|
+
/** where a host-bound choice reads its options: one loader input of the host's live schema,
|
|
16422
|
+
* optionally narrowed (`v.model`) */
|
|
16423
|
+
type HostSlotSource = {
|
|
16424
|
+
slot: string;
|
|
16425
|
+
filter?: RegExp;
|
|
16426
|
+
};
|
|
16388
16427
|
declare class ChoiceVar<T extends string> extends ComfyVar<T> {
|
|
16389
|
-
readonly choices: readonly T[];
|
|
16390
16428
|
readonly kind: 'choice';
|
|
16391
16429
|
readonly select: 'one';
|
|
16392
|
-
|
|
16430
|
+
private list;
|
|
16431
|
+
constructor(choices: readonly T[] | HostSlotSource, defaultValue: T, label?: string);
|
|
16432
|
+
get choices(): readonly T[];
|
|
16433
|
+
/** set for `v.model`: the loader input this choice lists */
|
|
16434
|
+
get hostSlot(): HostSlotSource | null;
|
|
16435
|
+
bindHost(host: LorasHost): void;
|
|
16393
16436
|
next(delta?: number): this;
|
|
16394
16437
|
parse(raw: string): boolean;
|
|
16395
16438
|
}
|
|
16396
16439
|
/** one option or none: `null` is "nothing picked", clicking the lit option clears it */
|
|
16397
16440
|
declare class OptionalChoiceVar<T extends string> extends ComfyVar<T | null> {
|
|
16398
|
-
readonly choices: readonly T[];
|
|
16399
16441
|
readonly kind: 'choice';
|
|
16400
16442
|
readonly select: 'zero-or-one';
|
|
16401
|
-
|
|
16443
|
+
private list;
|
|
16444
|
+
constructor(choices: readonly T[] | HostSlotSource, defaultValue: T | null, label?: string);
|
|
16445
|
+
get choices(): readonly T[];
|
|
16446
|
+
get hostSlot(): HostSlotSource | null;
|
|
16447
|
+
bindHost(host: LorasHost): void;
|
|
16402
16448
|
/** pick `c`, or clear it when it is already the one picked */
|
|
16403
16449
|
toggle(c: T): this;
|
|
16404
16450
|
/** the TUI text form: a choice, or an empty line for none */
|
|
@@ -16435,6 +16481,22 @@ declare function choice<const T extends string>(choices: readonly T[], defaultVa
|
|
|
16435
16481
|
}): ChoiceVar<T>;
|
|
16436
16482
|
declare function choice<const T extends string>(choices: readonly T[], defaultValue: T | null, opts: ChoiceOpts<'zero-or-one'>): OptionalChoiceVar<T>;
|
|
16437
16483
|
declare function choice<const T extends string>(choices: readonly T[], defaultValue: readonly T[], opts: ChoiceOpts<'many'>): MultiChoiceVar<T>;
|
|
16484
|
+
type ModelVarOpts<T extends string> = {
|
|
16485
|
+
/** narrows the host's list: `/krea/i` */
|
|
16486
|
+
filter?: RegExp;
|
|
16487
|
+
label?: string;
|
|
16488
|
+
/** a file name, or null for "the workflow decides" (the build then reads null) */
|
|
16489
|
+
default: T | null;
|
|
16490
|
+
};
|
|
16491
|
+
/** a choice over the host's LIVE file list for one loader input (`'UNETLoader.unet_name'`),
|
|
16492
|
+
* resolved at define time and rebound by serve's refresh-schema: a downloaded model is picked
|
|
16493
|
+
* in the draft, never written into the workflow file */
|
|
16494
|
+
declare function model<T extends string>(slot: string, opts: ModelVarOpts<T> & {
|
|
16495
|
+
default: T;
|
|
16496
|
+
}): ChoiceVar<T>;
|
|
16497
|
+
declare function model<T extends string>(slot: string, opts: ModelVarOpts<T> & {
|
|
16498
|
+
default: null;
|
|
16499
|
+
}): OptionalChoiceVar<T>;
|
|
16438
16500
|
type ActiveLora<T extends string> = {
|
|
16439
16501
|
lora_name: T;
|
|
16440
16502
|
strength_model: number;
|
|
@@ -16449,6 +16511,7 @@ type LorasHost = {
|
|
|
16449
16511
|
};
|
|
16450
16512
|
schema: {
|
|
16451
16513
|
getLoras(filter?: RegExp): string[];
|
|
16514
|
+
stringValues(slot: string): string[];
|
|
16452
16515
|
};
|
|
16453
16516
|
};
|
|
16454
16517
|
/**
|
|
@@ -16556,6 +16619,9 @@ type MediaVarOpts = {
|
|
|
16556
16619
|
* not what the api accepts) */
|
|
16557
16620
|
extensions?: readonly string[];
|
|
16558
16621
|
label?: string;
|
|
16622
|
+
/** the text var a file's `<name>.txt` sidecar fills, when a driver sets this var from a file
|
|
16623
|
+
* and leaves that one unset: a voice clip's transcript (`comfy-ts run`) */
|
|
16624
|
+
sidecarText?: TextVar;
|
|
16559
16625
|
};
|
|
16560
16626
|
type ImageVarOpts = MediaVarOpts;
|
|
16561
16627
|
type AudioVarOpts = MediaVarOpts;
|
|
@@ -16615,7 +16681,7 @@ declare class VideoVar extends MediaVar {
|
|
|
16615
16681
|
readonly kind: 'video';
|
|
16616
16682
|
loadInWorkflow<WID extends string>(wf: ComfyWorkflow<WID>): Promise<NodeOf<WID, 'LoadVideo'>>;
|
|
16617
16683
|
}
|
|
16618
|
-
/** the var constructors: v.text / v.prompt / v.int / v.float / v.seed / v.toggle / v.choice / v.loras / v.size / v.image / v.audio / v.video */
|
|
16684
|
+
/** 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 */
|
|
16619
16685
|
declare const v: {
|
|
16620
16686
|
text: (defaultValue: string, opts?: TextVarOpts | string) => TextVar;
|
|
16621
16687
|
prompt: (
|
|
@@ -16650,6 +16716,8 @@ declare const v: {
|
|
|
16650
16716
|
label?: string;
|
|
16651
16717
|
image?: ImageVar;
|
|
16652
16718
|
}) => SizeVar;
|
|
16719
|
+
/** host-bound: only inside defineWorkflow({ vars: (v) => … }), typed per slot there */
|
|
16720
|
+
model: typeof model;
|
|
16653
16721
|
image: (defaultValue: string, opts?: MediaVarOpts) => ImageVar;
|
|
16654
16722
|
audio: (defaultValue: string, opts?: MediaVarOpts) => AudioVar;
|
|
16655
16723
|
video: (defaultValue: string, opts?: MediaVarOpts) => VideoVar;
|
|
@@ -16692,10 +16760,26 @@ type LoraNameOf<ID extends string> = 'E_LoraName' extends keyof SdkForHost<ID>['
|
|
|
16692
16760
|
* the `v` handed to a vars LAMBDA: the global factory, host-typed —
|
|
16693
16761
|
* `v.loras(regex)` yields the host's lora-name union (resolved via bindHost)
|
|
16694
16762
|
*/
|
|
16695
|
-
type BoundVars<ID extends string> = Omit<typeof v, 'loras'> & {
|
|
16763
|
+
type BoundVars<ID extends string> = Omit<typeof v, 'loras' | 'model'> & {
|
|
16696
16764
|
loras(options: RegExp, initial?: LorasInput<LoraNameOf<ID>>, label?: string): LorasVar<LoraNameOf<ID>>;
|
|
16697
16765
|
loras<T extends string>(options: readonly T[], initial?: LorasInput<T>, label?: string): LorasVar<T>;
|
|
16766
|
+
/** the host's file list for one loader input: the slot autocompletes, the value is its union */
|
|
16767
|
+
model: ModelFactory<SdkForHost<ID>['Slots']>;
|
|
16698
16768
|
};
|
|
16769
|
+
/** `v.model` typed by a host's slot table S (`Slots`): its own interface, so the host id's
|
|
16770
|
+
* variance stays measurable (inlined into BoundVars, ComfyHost<ID> stopped being a ComfyHost<string>) */
|
|
16771
|
+
interface ModelFactory<S> {
|
|
16772
|
+
<K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
|
|
16773
|
+
default: S[K] & string;
|
|
16774
|
+
}): ChoiceVar<S[K] & string>;
|
|
16775
|
+
<K extends keyof S & string>(slot: K, opts: ModelVarOpts<S[K] & string> & {
|
|
16776
|
+
default: null;
|
|
16777
|
+
}): OptionalChoiceVar<S[K] & string>;
|
|
16778
|
+
}
|
|
16779
|
+
/** every `Node.input` slot of the host's generated sdk (any string without one) */
|
|
16780
|
+
type SlotNameOf<ID extends string> = keyof SdkForHost<ID>['Slots'] & string;
|
|
16781
|
+
/** the value union of one slot, strings only (a loader file list) */
|
|
16782
|
+
type SlotValueOf<ID extends string, K extends string> = K extends keyof SdkForHost<ID>['Slots'] ? SdkForHost<ID>['Slots'][K] & string : string;
|
|
16699
16783
|
type DefineWorkflowSpec<ID extends string, V extends VarsSpec> = {
|
|
16700
16784
|
/** short id; also names the workflow instances */
|
|
16701
16785
|
id?: string;
|
|
@@ -16839,6 +16923,12 @@ declare class ComfyHostAuthError extends Error {
|
|
|
16839
16923
|
hostId: string;
|
|
16840
16924
|
constructor(code: 401 | 402 | 429, hostId: string, message: string);
|
|
16841
16925
|
}
|
|
16926
|
+
type LatentPreview = {
|
|
16927
|
+
promptID: Maybe<PromptID>;
|
|
16928
|
+
receivedAt: number_Timestamp;
|
|
16929
|
+
blob: Blob;
|
|
16930
|
+
url: string;
|
|
16931
|
+
};
|
|
16842
16932
|
declare class ComfyHost<ID extends string = string> {
|
|
16843
16933
|
data: ComfyHostData & {
|
|
16844
16934
|
id: ID;
|
|
@@ -16980,6 +17070,10 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
16980
17070
|
deleteHistory: (promptId: string) => Promise<void>;
|
|
16981
17071
|
/** wipe the server's WHOLE prompt history (every user of that server) */
|
|
16982
17072
|
clearHistory: () => Promise<void>;
|
|
17073
|
+
/** the `--preview-method` this host was launched with, read from `GET /system_stats`.
|
|
17074
|
+
* `'none'` (ComfyUI's default) means no live preview frame will ever arrive; null = the host
|
|
17075
|
+
* does not publish its launch flags (a cloud host), so only a run can tell */
|
|
17076
|
+
fetchPreviewMethod: () => Promise<PreviewMethod | null>;
|
|
16983
17077
|
/** the server's recent console buffer (entries are write CHUNKS, not lines) */
|
|
16984
17078
|
fetchRawLogs: () => Promise<{
|
|
16985
17079
|
entries: LogEntry[];
|
|
@@ -17008,13 +17102,12 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17008
17102
|
private activePromptID;
|
|
17009
17103
|
/** method to either execute or buffer the incoming message */
|
|
17010
17104
|
routeOrBuffer(prompt_id: PromptID, msg: PromptRelated_WsMsg): void;
|
|
17011
|
-
/** the
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
}>;
|
|
17105
|
+
/** the last raw preview frame; `latentPreview` decodes it only when read */
|
|
17106
|
+
private _latentFrame;
|
|
17107
|
+
private _latentPreview;
|
|
17108
|
+
/** the latent image beeing generated, in case you want to display it. Built on read: a
|
|
17109
|
+
* session that never reads it never decodes a frame nor holds an object url */
|
|
17110
|
+
get latentPreview(): Maybe<LatentPreview>;
|
|
17018
17111
|
/** byte-level latent-preview hook (e.g. TUI live preview panel) */
|
|
17019
17112
|
onLatentPreview: Maybe<(p: {
|
|
17020
17113
|
bytes: Uint8Array;
|
|
@@ -17049,6 +17142,10 @@ declare class ComfyHost<ID extends string = string> {
|
|
|
17049
17142
|
* sockets keep streaming (a half-open socket receives nothing, so this
|
|
17050
17143
|
* never revives one) */
|
|
17051
17144
|
lastWsMessageAt: number | null;
|
|
17145
|
+
/** a type 1 or 4 frame. Parsed only when someone wants it, in this order (architecture.md,
|
|
17146
|
+
* Live previews): the ws saver's output, the pre-registration buffer, the run's onPreview,
|
|
17147
|
+
* the host hook. Nobody listening = the frame is kept by reference and never copied */
|
|
17148
|
+
private onPreviewFrame;
|
|
17052
17149
|
onMessage(e: WsMessageEvent): void;
|
|
17053
17150
|
}
|
|
17054
17151
|
//#endregion
|
|
@@ -17246,6 +17343,10 @@ type RunSettings = {
|
|
|
17246
17343
|
log?: boolean;
|
|
17247
17344
|
/** called on every progress-relevant websocket message */
|
|
17248
17345
|
onProgress?: (p: ExecutionProgress) => void;
|
|
17346
|
+
/** called on every live preview frame of this run (the image a sampler is forming). Opt in:
|
|
17347
|
+
* without it no frame is decoded for the run. ComfyUI sends frames only when launched with
|
|
17348
|
+
* `--preview-method`, see `host.fetchPreviewMethod()` */
|
|
17349
|
+
onPreview?: (p: ExecutionPreview) => void;
|
|
17249
17350
|
};
|
|
17250
17351
|
/** exactly what was sent to the host for one execution, frozen at send time */
|
|
17251
17352
|
type ExecutionSnapshot = {
|
|
@@ -17999,5 +18100,5 @@ declare function promptEnhancerPresets(): VarPresetSpec;
|
|
|
17999
18100
|
//#region src/cli/tui-env.d.ts
|
|
18000
18101
|
declare function isTuiActive(): boolean;
|
|
18001
18102
|
//#endregion
|
|
18002
|
-
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, 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, 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, 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, exampleImagePath, exampleMediaPath, 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 };
|
|
18103
|
+
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 ExecutionPreview, type ExecutionProgress, type ExecutionSnapshot, Flavor, FloatVar, HTMLContent, type HostSlotSource, 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 ParsedHostBase, PartialOmit, type PluginInstallStatus, type PluginSuggestion, type PreviewMethod, 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, 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, exampleImagePath, exampleMediaPath, 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 };
|
|
18003
18104
|
//# sourceMappingURL=index.d.ts.map
|