@comfyorg/comfyui-frontend-types 1.27.1 → 1.27.7
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/index.d.ts +82 -268
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ComfyApiWorkflow } from '../schemas/
|
|
2
|
-
import { ComfyWorkflowJSON } from '../schemas/
|
|
1
|
+
import { ComfyApiWorkflow } from '../platform/workflow/validation/schemas/workflowSchema';
|
|
2
|
+
import { ComfyWorkflowJSON } from '../platform/workflow/validation/schemas/workflowSchema';
|
|
3
|
+
import { ComfyWorkflowJSON as ComfyWorkflowJSON_2 } from '../../validation/schemas/workflowSchema';
|
|
3
4
|
import { Component } from 'vue';
|
|
4
5
|
import { DeviceStats } from '../schemas/apiSchema';
|
|
5
6
|
import { DisplayComponentWsMessage } from '../schemas/apiSchema';
|
|
@@ -18,7 +19,7 @@ import { LogEntry } from '../schemas/apiSchema';
|
|
|
18
19
|
import { LogsRawResponse } from '../schemas/apiSchema';
|
|
19
20
|
import { LogsWsMessage } from '../schemas/apiSchema';
|
|
20
21
|
import { NodeError } from '../schemas/apiSchema';
|
|
21
|
-
import { NodeId as NodeId_2 } from '../schemas/
|
|
22
|
+
import { NodeId as NodeId_2 } from '../platform/workflow/validation/schemas/workflowSchema';
|
|
22
23
|
import { PendingTaskItem } from '../schemas/apiSchema';
|
|
23
24
|
import { ProgressStateWsMessage } from '../schemas/apiSchema';
|
|
24
25
|
import { ProgressTextWsMessage } from '../schemas/apiSchema';
|
|
@@ -76,6 +77,17 @@ declare type AsCustomEvents<T> = {
|
|
|
76
77
|
readonly [K in keyof T]: CustomEvent<T[K]>;
|
|
77
78
|
};
|
|
78
79
|
|
|
80
|
+
declare class AssetWidget extends BaseWidget<IAssetWidget> implements IAssetWidget {
|
|
81
|
+
constructor(widget: IAssetWidget, node: LGraphNode);
|
|
82
|
+
get _displayValue(): string;
|
|
83
|
+
drawWidget(ctx: CanvasRenderingContext2D, { width, showText }: DrawWidgetOptions): void;
|
|
84
|
+
onClick(): void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare interface AuthUserInfo {
|
|
88
|
+
id: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
79
91
|
/** Dictionary of calls originating from ComfyUI core */
|
|
80
92
|
declare interface BackendApiCalls {
|
|
81
93
|
progress: ProgressWsMessage;
|
|
@@ -611,6 +623,15 @@ declare class ChartWidget extends BaseWidget<IChartWidget> implements IChartWidg
|
|
|
611
623
|
|
|
612
624
|
declare type ClassList = string | string[] | Record<string, boolean>;
|
|
613
625
|
|
|
626
|
+
/** Items copied from the canvas */
|
|
627
|
+
declare interface ClipboardItems_2 {
|
|
628
|
+
nodes?: ISerialisedNode[];
|
|
629
|
+
groups?: ISerialisedGroup[];
|
|
630
|
+
reroutes?: SerialisableReroute[];
|
|
631
|
+
links?: SerialisableLLink[];
|
|
632
|
+
subgraphs?: ExportedSubgraph[];
|
|
633
|
+
}
|
|
634
|
+
|
|
614
635
|
/**
|
|
615
636
|
* The items created by a clipboard paste operation.
|
|
616
637
|
* Includes maps of original copied IDs to newly created items.
|
|
@@ -660,9 +681,15 @@ declare class ColorWidget extends BaseWidget<IColorWidget> implements IColorWidg
|
|
|
660
681
|
}
|
|
661
682
|
|
|
662
683
|
declare class ComboWidget extends BaseSteppedWidget<IStringComboWidget | IComboWidget> implements IComboWidget {
|
|
663
|
-
#private;
|
|
664
684
|
type: "combo";
|
|
665
685
|
get _displayValue(): string;
|
|
686
|
+
private getValues;
|
|
687
|
+
/**
|
|
688
|
+
* Checks if the value is {@link Array.at at} the given index in the combo list.
|
|
689
|
+
* @param increment `true` if checking the use of the increment button, `false` for decrement
|
|
690
|
+
* @returns `true` if the value is at the given index, otherwise `false`.
|
|
691
|
+
*/
|
|
692
|
+
private canUseButton;
|
|
666
693
|
/**
|
|
667
694
|
* Returns `true` if the current value is not the last value in the list.
|
|
668
695
|
* Handles edge case where the value is both the first and last item in the list.
|
|
@@ -671,6 +698,7 @@ declare class ComboWidget extends BaseSteppedWidget<IStringComboWidget | IComboW
|
|
|
671
698
|
canDecrement(): boolean;
|
|
672
699
|
incrementValue(options: WidgetEventOptions): void;
|
|
673
700
|
decrementValue(options: WidgetEventOptions): void;
|
|
701
|
+
private tryChangeValue;
|
|
674
702
|
onClick({ e, node, canvas }: WidgetEventOptions): void;
|
|
675
703
|
}
|
|
676
704
|
|
|
@@ -784,19 +812,13 @@ export declare class ComfyApi extends EventTarget {
|
|
|
784
812
|
* Gets a list of model folder keys (eg ['checkpoints', 'loras', ...])
|
|
785
813
|
* @returns The list of model folder keys
|
|
786
814
|
*/
|
|
787
|
-
getModelFolders(): Promise<
|
|
788
|
-
name: string;
|
|
789
|
-
folders: string[];
|
|
790
|
-
}[]>;
|
|
815
|
+
getModelFolders(): Promise<ModelFolderInfo[]>;
|
|
791
816
|
/**
|
|
792
817
|
* Gets a list of models in the specified folder
|
|
793
818
|
* @param {string} folder The folder to list models from, such as 'checkpoints'
|
|
794
819
|
* @returns The list of model filenames within the specified folder
|
|
795
820
|
*/
|
|
796
|
-
getModels(folder: string): Promise<
|
|
797
|
-
name: string;
|
|
798
|
-
pathIndex: number;
|
|
799
|
-
}[]>;
|
|
821
|
+
getModels(folder: string): Promise<ModelFile[]>;
|
|
800
822
|
/**
|
|
801
823
|
* Gets the metadata for a model
|
|
802
824
|
* @param {string} folder The folder containing the model
|
|
@@ -1286,6 +1308,12 @@ export declare class ComfyApp {
|
|
|
1286
1308
|
* @param missingNodeTypes The missing node types
|
|
1287
1309
|
*/
|
|
1288
1310
|
afterConfigureGraph?(missingNodeTypes: MissingNodeType[]): Promise<void> | void;
|
|
1311
|
+
/**
|
|
1312
|
+
* Fired whenever authentication resolves, providing the anonymized user id..
|
|
1313
|
+
* Extensions can register at any time and will receive the latest value immediately.
|
|
1314
|
+
* This is an experimental API and may be changed or removed in the future.
|
|
1315
|
+
*/
|
|
1316
|
+
onAuthUserResolved?(user: AuthUserInfo, app: ComfyApp): Promise<void> | void;
|
|
1289
1317
|
[key: string]: any;
|
|
1290
1318
|
}
|
|
1291
1319
|
|
|
@@ -1412,7 +1440,8 @@ export declare class ComfyApp {
|
|
|
1412
1440
|
};
|
|
1413
1441
|
|
|
1414
1442
|
declare class ComfyWorkflow extends UserFile {
|
|
1415
|
-
static readonly basePath
|
|
1443
|
+
static readonly basePath: string;
|
|
1444
|
+
readonly tintCanvasBg?: string;
|
|
1416
1445
|
/**
|
|
1417
1446
|
* The change tracker for the workflow. Non-reactive raw object.
|
|
1418
1447
|
*/
|
|
@@ -1431,8 +1460,8 @@ export declare class ComfyApp {
|
|
|
1431
1460
|
size: number;
|
|
1432
1461
|
});
|
|
1433
1462
|
get key(): string;
|
|
1434
|
-
get activeState():
|
|
1435
|
-
get initialState():
|
|
1463
|
+
get activeState(): ComfyWorkflowJSON_2 | null;
|
|
1464
|
+
get initialState(): ComfyWorkflowJSON_2 | null;
|
|
1436
1465
|
get isLoaded(): boolean;
|
|
1437
1466
|
get isModified(): boolean;
|
|
1438
1467
|
set isModified(value: boolean);
|
|
@@ -1454,6 +1483,7 @@ export declare class ComfyApp {
|
|
|
1454
1483
|
* @returns this
|
|
1455
1484
|
*/
|
|
1456
1485
|
saveAs(path: string): Promise<UserFile>;
|
|
1486
|
+
promptSave(): Promise<string | null>;
|
|
1457
1487
|
}
|
|
1458
1488
|
|
|
1459
1489
|
export declare interface CommandManager {
|
|
@@ -2134,6 +2164,11 @@ export declare class ComfyApp {
|
|
|
2134
2164
|
onPointerLeave?(e?: CanvasPointerEvent): void;
|
|
2135
2165
|
}
|
|
2136
2166
|
|
|
2167
|
+
declare interface IAssetWidget extends IBaseWidget<string, 'asset', IWidgetOptions<string[]>> {
|
|
2168
|
+
type: 'asset';
|
|
2169
|
+
value: string;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2137
2172
|
/**
|
|
2138
2173
|
* The base type for all widgets. Should not be implemented directly.
|
|
2139
2174
|
* @template TValue The type of value this widget holds.
|
|
@@ -2829,7 +2864,7 @@ export declare class ComfyApp {
|
|
|
2829
2864
|
* Recommend declaration merging any properties that use IWidget (e.g. {@link LGraphNode.widgets}) with a new type alias.
|
|
2830
2865
|
* @see ICustomWidget
|
|
2831
2866
|
*/
|
|
2832
|
-
declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget;
|
|
2867
|
+
declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget | IAssetWidget;
|
|
2833
2868
|
|
|
2834
2869
|
declare interface IWidgetKnobOptions extends IWidgetOptions<number[]> {
|
|
2835
2870
|
min: number;
|
|
@@ -3574,6 +3609,7 @@ export declare class ComfyApp {
|
|
|
3574
3609
|
_bg_img?: HTMLImageElement;
|
|
3575
3610
|
_pattern?: CanvasPattern;
|
|
3576
3611
|
_pattern_img?: HTMLImageElement;
|
|
3612
|
+
bg_tint?: string | CanvasGradient | CanvasPattern;
|
|
3577
3613
|
prompt_box?: PromptDialog | null;
|
|
3578
3614
|
search_box?: HTMLDivElement;
|
|
3579
3615
|
/** @deprecated Panels */
|
|
@@ -3755,6 +3791,7 @@ export declare class ComfyApp {
|
|
|
3755
3791
|
* process a key event
|
|
3756
3792
|
*/
|
|
3757
3793
|
processKey(e: KeyboardEvent): void;
|
|
3794
|
+
_serializeItems(items?: Iterable<Positionable>): ClipboardItems_2;
|
|
3758
3795
|
/**
|
|
3759
3796
|
* Copies canvas items to an internal, app-specific clipboard backed by local storage.
|
|
3760
3797
|
* When called without parameters, it copies {@link selectedItems}.
|
|
@@ -3770,6 +3807,7 @@ export declare class ComfyApp {
|
|
|
3770
3807
|
* Pastes the items from the canvas "clipbaord" - a local storage variable.
|
|
3771
3808
|
*/
|
|
3772
3809
|
_pasteFromClipboard(options?: IPasteFromClipboardOptions): ClipboardPasteResult | undefined;
|
|
3810
|
+
_deserializeItems(parsed: ClipboardItems_2, options: IPasteFromClipboardOptions): ClipboardPasteResult | undefined;
|
|
3773
3811
|
pasteFromClipboard(options?: IPasteFromClipboardOptions): void;
|
|
3774
3812
|
processNodeDblClicked(n: LGraphNode): void;
|
|
3775
3813
|
/**
|
|
@@ -5387,22 +5425,6 @@ export declare class ComfyApp {
|
|
|
5387
5425
|
WIDGET_TEXT_COLOR: string;
|
|
5388
5426
|
WIDGET_SECONDARY_TEXT_COLOR: string;
|
|
5389
5427
|
WIDGET_DISABLED_TEXT_COLOR: string;
|
|
5390
|
-
/**
|
|
5391
|
-
* Vue node dimensions configuration for the contract between LiteGraph and Vue components.
|
|
5392
|
-
* These values ensure both systems can independently calculate node, slot, and widget positions
|
|
5393
|
-
* to place them in identical locations.
|
|
5394
|
-
*/
|
|
5395
|
-
COMFY_VUE_NODE_DIMENSIONS: {
|
|
5396
|
-
readonly spacing: {
|
|
5397
|
-
readonly BETWEEN_SLOTS_AND_BODY: 8;
|
|
5398
|
-
readonly BETWEEN_WIDGETS: 8;
|
|
5399
|
-
};
|
|
5400
|
-
readonly components: {
|
|
5401
|
-
readonly HEADER_HEIGHT: 34;
|
|
5402
|
-
readonly SLOT_HEIGHT: 24;
|
|
5403
|
-
readonly STANDARD_WIDGET_HEIGHT: 30;
|
|
5404
|
-
};
|
|
5405
|
-
};
|
|
5406
5428
|
LINK_COLOR: string;
|
|
5407
5429
|
EVENT_LINK_COLOR: string;
|
|
5408
5430
|
CONNECTING_LINK_COLOR: string;
|
|
@@ -5591,9 +5613,12 @@ export declare class ComfyApp {
|
|
|
5591
5613
|
/**
|
|
5592
5614
|
* "standard": change the dragging on left mouse button click to select, enable middle-click or spacebar+left-click dragging
|
|
5593
5615
|
* "legacy": Enable dragging on left-click (original behavior)
|
|
5616
|
+
* "custom": Use leftMouseClickBehavior and mouseWheelScroll settings
|
|
5594
5617
|
* @default "legacy"
|
|
5595
5618
|
*/
|
|
5596
|
-
canvasNavigationMode: 'standard' | 'legacy';
|
|
5619
|
+
canvasNavigationMode: 'standard' | 'legacy' | 'custom';
|
|
5620
|
+
leftMouseClickBehavior: 'panning' | 'select';
|
|
5621
|
+
mouseWheelScroll: 'panning' | 'zoom';
|
|
5597
5622
|
/**
|
|
5598
5623
|
* If `true`, widget labels and values will both be truncated (proportionally to size),
|
|
5599
5624
|
* until they fit within the widget.
|
|
@@ -5930,8 +5955,8 @@ export declare class ComfyApp {
|
|
|
5930
5955
|
originalContent: string;
|
|
5931
5956
|
content: string;
|
|
5932
5957
|
changeTracker: ChangeTracker;
|
|
5933
|
-
initialState:
|
|
5934
|
-
activeState:
|
|
5958
|
+
initialState: ComfyWorkflowJSON_2;
|
|
5959
|
+
activeState: ComfyWorkflowJSON_2;
|
|
5935
5960
|
}
|
|
5936
5961
|
|
|
5937
5962
|
declare interface LoadedUserFile extends UserFile {
|
|
@@ -5978,6 +6003,16 @@ export declare class ComfyApp {
|
|
|
5978
6003
|
};
|
|
5979
6004
|
};
|
|
5980
6005
|
|
|
6006
|
+
declare interface ModelFile {
|
|
6007
|
+
name: string;
|
|
6008
|
+
pathIndex: number;
|
|
6009
|
+
}
|
|
6010
|
+
|
|
6011
|
+
declare interface ModelFolderInfo {
|
|
6012
|
+
name: string;
|
|
6013
|
+
folders: string[];
|
|
6014
|
+
}
|
|
6015
|
+
|
|
5981
6016
|
declare class MovingInputLink extends MovingLinkBase {
|
|
5982
6017
|
readonly toType = "input";
|
|
5983
6018
|
readonly node: LGraphNode;
|
|
@@ -6805,7 +6840,7 @@ export declare class ComfyApp {
|
|
|
6805
6840
|
|
|
6806
6841
|
declare type SettingCustomRenderer = (name: string, setter: (v: any) => void, value: any, attrs: any) => HTMLElement;
|
|
6807
6842
|
|
|
6808
|
-
declare type SettingInputType = 'boolean' | 'number' | 'slider' | 'knob' | 'combo' | 'text' | 'image' | 'color' | 'url' | 'hidden' | 'backgroundImage';
|
|
6843
|
+
declare type SettingInputType = 'boolean' | 'number' | 'slider' | 'knob' | 'combo' | 'radio' | 'text' | 'image' | 'color' | 'url' | 'hidden' | 'backgroundImage';
|
|
6809
6844
|
|
|
6810
6845
|
declare interface SettingOption {
|
|
6811
6846
|
text: string;
|
|
@@ -6813,7 +6848,7 @@ export declare class ComfyApp {
|
|
|
6813
6848
|
}
|
|
6814
6849
|
|
|
6815
6850
|
declare interface SettingParams<TValue = unknown> extends FormItem {
|
|
6816
|
-
id: keyof
|
|
6851
|
+
id: keyof Settings_2;
|
|
6817
6852
|
defaultValue: any | (() => any);
|
|
6818
6853
|
defaultsByInstallVersion?: Record<`${number}.${number}.${number}`, TValue>;
|
|
6819
6854
|
onChange?: (newValue: any, oldValue?: any) => void;
|
|
@@ -6823,6 +6858,7 @@ export declare class ComfyApp {
|
|
|
6823
6858
|
migrateDeprecatedValue?: (value: any) => any;
|
|
6824
6859
|
versionAdded?: string;
|
|
6825
6860
|
versionModified?: string;
|
|
6861
|
+
sortOrder?: number;
|
|
6826
6862
|
}
|
|
6827
6863
|
|
|
6828
6864
|
export { Settings }
|
|
@@ -7649,6 +7685,7 @@ export declare class ComfyApp {
|
|
|
7649
7685
|
imagecompare: ImageCompareWidget;
|
|
7650
7686
|
selectbutton: SelectButtonWidget;
|
|
7651
7687
|
textarea: TextareaWidget;
|
|
7688
|
+
asset: AssetWidget;
|
|
7652
7689
|
[key: string]: BaseWidget;
|
|
7653
7690
|
};
|
|
7654
7691
|
|
|
@@ -9730,8 +9767,8 @@ export declare class ComfyApp {
|
|
|
9730
9767
|
}, "strip", z.ZodTypeAny, {
|
|
9731
9768
|
name: string;
|
|
9732
9769
|
description: string;
|
|
9733
|
-
category: string;
|
|
9734
9770
|
display_name: string;
|
|
9771
|
+
category: string;
|
|
9735
9772
|
output_node: boolean;
|
|
9736
9773
|
python_module: string;
|
|
9737
9774
|
input?: {
|
|
@@ -10146,19 +10183,19 @@ export declare class ComfyApp {
|
|
|
10146
10183
|
}, z.ZodTypeAny, "passthrough"> | undefined]> | undefined;
|
|
10147
10184
|
} | undefined;
|
|
10148
10185
|
output?: (string | (string | number)[])[] | undefined;
|
|
10149
|
-
deprecated?: boolean | undefined;
|
|
10150
|
-
help?: string | undefined;
|
|
10151
|
-
experimental?: boolean | undefined;
|
|
10152
10186
|
output_is_list?: boolean[] | undefined;
|
|
10153
10187
|
output_name?: string[] | undefined;
|
|
10154
10188
|
output_tooltips?: string[] | undefined;
|
|
10189
|
+
help?: string | undefined;
|
|
10190
|
+
deprecated?: boolean | undefined;
|
|
10191
|
+
experimental?: boolean | undefined;
|
|
10155
10192
|
api_node?: boolean | undefined;
|
|
10156
10193
|
input_order?: Record<string, string[]> | undefined;
|
|
10157
10194
|
}, {
|
|
10158
10195
|
name: string;
|
|
10159
10196
|
description: string;
|
|
10160
|
-
category: string;
|
|
10161
10197
|
display_name: string;
|
|
10198
|
+
category: string;
|
|
10162
10199
|
output_node: boolean;
|
|
10163
10200
|
python_module: string;
|
|
10164
10201
|
input?: {
|
|
@@ -10573,12 +10610,12 @@ export declare class ComfyApp {
|
|
|
10573
10610
|
}, z.ZodTypeAny, "passthrough"> | undefined]> | undefined;
|
|
10574
10611
|
} | undefined;
|
|
10575
10612
|
output?: (string | (string | number)[])[] | undefined;
|
|
10576
|
-
deprecated?: boolean | undefined;
|
|
10577
|
-
help?: string | undefined;
|
|
10578
|
-
experimental?: boolean | undefined;
|
|
10579
10613
|
output_is_list?: boolean[] | undefined;
|
|
10580
10614
|
output_name?: string[] | undefined;
|
|
10581
10615
|
output_tooltips?: string[] | undefined;
|
|
10616
|
+
help?: string | undefined;
|
|
10617
|
+
deprecated?: boolean | undefined;
|
|
10618
|
+
experimental?: boolean | undefined;
|
|
10582
10619
|
api_node?: boolean | undefined;
|
|
10583
10620
|
input_order?: Record<string, string[]> | undefined;
|
|
10584
10621
|
}>;
|
|
@@ -11239,226 +11276,3 @@ export declare class ComfyApp {
|
|
|
11239
11276
|
}>;
|
|
11240
11277
|
|
|
11241
11278
|
export { }
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
declare global {
|
|
11245
|
-
interface Window {
|
|
11246
|
-
/** For use by extensions and in the browser console. Where possible, import `app` from '@/scripts/app' instead. */
|
|
11247
|
-
app?: ComfyApp;
|
|
11248
|
-
/** For use by extensions and in the browser console. Where possible, import `app` and access via `app.graph` instead. */
|
|
11249
|
-
graph?: LGraph;
|
|
11250
|
-
}
|
|
11251
|
-
}
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
declare global {
|
|
11256
|
-
interface Window {
|
|
11257
|
-
__COMFYUI_FRONTEND_VERSION__: string
|
|
11258
|
-
}
|
|
11259
|
-
}
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
/** ComfyUI extensions of litegraph */
|
|
11264
|
-
declare module '@/lib/litegraph/src/types/widgets' {
|
|
11265
|
-
interface IWidgetOptions {
|
|
11266
|
-
/** Currently used by DOM widgets only. Declaring here reduces complexity. */
|
|
11267
|
-
onHide?: (widget: DOMWidget) => void
|
|
11268
|
-
/**
|
|
11269
|
-
* Controls whether the widget's value is included in the API workflow/prompt.
|
|
11270
|
-
* - If false, the value will be excluded from the API workflow but still serialized as part of the graph state
|
|
11271
|
-
* - If true or undefined, the value will be included in both the API workflow and graph state
|
|
11272
|
-
* @default true
|
|
11273
|
-
* @use {@link IBaseWidget.serialize} if you don't want the widget value to be included in both
|
|
11274
|
-
* the API workflow and graph state.
|
|
11275
|
-
*/
|
|
11276
|
-
serialize?: boolean
|
|
11277
|
-
/**
|
|
11278
|
-
* Rounding value for numeric float widgets.
|
|
11279
|
-
*/
|
|
11280
|
-
round?: number
|
|
11281
|
-
/**
|
|
11282
|
-
* The minimum size of the node if the widget is present.
|
|
11283
|
-
*/
|
|
11284
|
-
minNodeSize?: Size
|
|
11285
|
-
|
|
11286
|
-
/** If the widget is advanced, this will be set to true. */
|
|
11287
|
-
advanced?: boolean
|
|
11288
|
-
|
|
11289
|
-
/** If the widget is hidden, this will be set to true. */
|
|
11290
|
-
hidden?: boolean
|
|
11291
|
-
}
|
|
11292
|
-
|
|
11293
|
-
interface IBaseWidget {
|
|
11294
|
-
onRemove?(): void
|
|
11295
|
-
beforeQueued?(): unknown
|
|
11296
|
-
afterQueued?(): unknown
|
|
11297
|
-
serializeValue?(node: LGraphNode, index: number): Promise<unknown> | unknown
|
|
11298
|
-
|
|
11299
|
-
/**
|
|
11300
|
-
* Refreshes the widget's value or options from its remote source.
|
|
11301
|
-
*/
|
|
11302
|
-
refresh?(): unknown
|
|
11303
|
-
|
|
11304
|
-
/**
|
|
11305
|
-
* If the widget supports dynamic prompts, this will be set to true.
|
|
11306
|
-
* See extensions/core/dynamicPrompts.ts
|
|
11307
|
-
*/
|
|
11308
|
-
dynamicPrompts?: boolean
|
|
11309
|
-
}
|
|
11310
|
-
}
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
/**
|
|
11315
|
-
* ComfyUI extensions of litegraph interfaces
|
|
11316
|
-
*/
|
|
11317
|
-
declare module '@/lib/litegraph/src/interfaces' {
|
|
11318
|
-
interface IWidgetLocator {
|
|
11319
|
-
[key: symbol]: unknown
|
|
11320
|
-
}
|
|
11321
|
-
}
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
/**
|
|
11326
|
-
* ComfyUI extensions of litegraph
|
|
11327
|
-
*/
|
|
11328
|
-
declare module '@/lib/litegraph/src/litegraph' {
|
|
11329
|
-
interface LGraphNodeConstructor<T extends LGraphNode = LGraphNode> {
|
|
11330
|
-
type?: string
|
|
11331
|
-
comfyClass: string
|
|
11332
|
-
title: string
|
|
11333
|
-
nodeData?: ComfyNodeDefV1 & ComfyNodeDefV2 & { [key: symbol]: unknown }
|
|
11334
|
-
category?: string
|
|
11335
|
-
new (): T
|
|
11336
|
-
}
|
|
11337
|
-
|
|
11338
|
-
// Add interface augmentations into the class itself
|
|
11339
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
11340
|
-
interface BaseWidget extends IBaseWidget {}
|
|
11341
|
-
|
|
11342
|
-
interface LGraphNode {
|
|
11343
|
-
constructor: LGraphNodeConstructor
|
|
11344
|
-
|
|
11345
|
-
/**
|
|
11346
|
-
* Callback fired on each node after the graph is configured
|
|
11347
|
-
*/
|
|
11348
|
-
onAfterGraphConfigured?(): void
|
|
11349
|
-
onGraphConfigured?(): void
|
|
11350
|
-
onExecuted?(output: any): void
|
|
11351
|
-
onNodeCreated?(this: LGraphNode): void
|
|
11352
|
-
/** @deprecated groupNode */
|
|
11353
|
-
setInnerNodes?(nodes: LGraphNode[]): void
|
|
11354
|
-
/** Originally a group node API. */
|
|
11355
|
-
getInnerNodes?(
|
|
11356
|
-
nodesByExecutionId: Map<ExecutionId, ExecutableLGraphNode>,
|
|
11357
|
-
subgraphNodePath?: readonly NodeId[],
|
|
11358
|
-
nodes?: ExecutableLGraphNode[],
|
|
11359
|
-
subgraphs?: Set<LGraphNode>
|
|
11360
|
-
): ExecutableLGraphNode[]
|
|
11361
|
-
/** @deprecated groupNode */
|
|
11362
|
-
convertToNodes?(): LGraphNode[]
|
|
11363
|
-
recreate?(): Promise<LGraphNode>
|
|
11364
|
-
refreshComboInNode?(defs: Record<string, ComfyNodeDef>)
|
|
11365
|
-
/** @deprecated groupNode */
|
|
11366
|
-
updateLink?(link: LLink): LLink | null
|
|
11367
|
-
/**
|
|
11368
|
-
* @deprecated primitive node.
|
|
11369
|
-
* Used by virtual nodes (primitives) to insert their values into the graph prior to queueing.
|
|
11370
|
-
* Externally used by
|
|
11371
|
-
* - https://github.com/pythongosssss/ComfyUI-Custom-Scripts/blob/bbda5e52ad580c13ceaa53136d9c2bed9137bd2e/web/js/presetText.js#L160-L182
|
|
11372
|
-
* - https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite/blob/4c7858ddd5126f7293dc3c9f6e0fc4c263cde079/web/js/VHS.core.js#L1889-L1889
|
|
11373
|
-
*/
|
|
11374
|
-
applyToGraph?(extraLinks?: LLink[]): void
|
|
11375
|
-
onExecutionStart?(): unknown
|
|
11376
|
-
/**
|
|
11377
|
-
* Callback invoked when the node is dragged over from an external source, i.e.
|
|
11378
|
-
* a file or another HTML element.
|
|
11379
|
-
* @param e The drag event
|
|
11380
|
-
* @returns {boolean} True if the drag event should be handled by this node, false otherwise
|
|
11381
|
-
*/
|
|
11382
|
-
onDragOver?(e: DragEvent): boolean
|
|
11383
|
-
/**
|
|
11384
|
-
* Callback invoked when the node is dropped from an external source, i.e.
|
|
11385
|
-
* a file or another HTML element.
|
|
11386
|
-
* @param e The drag event
|
|
11387
|
-
* @returns {boolean} True if the drag event should be handled by this node, false otherwise
|
|
11388
|
-
*/
|
|
11389
|
-
onDragDrop?(e: DragEvent): Promise<boolean> | boolean
|
|
11390
|
-
|
|
11391
|
-
index?: number
|
|
11392
|
-
runningInternalNodeId?: NodeId
|
|
11393
|
-
|
|
11394
|
-
comfyClass?: string
|
|
11395
|
-
|
|
11396
|
-
/**
|
|
11397
|
-
* If the node is a frontend only node and should not be serialized into the prompt.
|
|
11398
|
-
*/
|
|
11399
|
-
isVirtualNode?: boolean
|
|
11400
|
-
|
|
11401
|
-
addDOMWidget<
|
|
11402
|
-
T extends HTMLElement = HTMLElement,
|
|
11403
|
-
V extends object | string = string
|
|
11404
|
-
>(
|
|
11405
|
-
name: string,
|
|
11406
|
-
type: string,
|
|
11407
|
-
element: T,
|
|
11408
|
-
options?: DOMWidgetOptions<V>
|
|
11409
|
-
): DOMWidget<T, V>
|
|
11410
|
-
|
|
11411
|
-
animatedImages?: boolean
|
|
11412
|
-
imgs?: HTMLImageElement[]
|
|
11413
|
-
images?: ExecutedWsMessage['output']
|
|
11414
|
-
/** Container for the node's video preview */
|
|
11415
|
-
videoContainer?: HTMLElement
|
|
11416
|
-
/** Whether the node's preview media is loading */
|
|
11417
|
-
isLoading?: boolean
|
|
11418
|
-
/** The content type of the node's preview media */
|
|
11419
|
-
previewMediaType?: 'image' | 'video' | 'audio' | 'model'
|
|
11420
|
-
|
|
11421
|
-
preview: string[]
|
|
11422
|
-
/** Index of the currently selected image on a multi-image node such as Preview Image */
|
|
11423
|
-
imageIndex?: number | null
|
|
11424
|
-
imageRects: Rect[]
|
|
11425
|
-
overIndex?: number | null
|
|
11426
|
-
pointerDown?: { index: number | null; pos: Point } | null
|
|
11427
|
-
/**
|
|
11428
|
-
* @deprecated No longer needed as we use {@link useImagePreviewWidget}
|
|
11429
|
-
*/
|
|
11430
|
-
setSizeForImage?(force?: boolean): void
|
|
11431
|
-
/** @deprecated Unused */
|
|
11432
|
-
inputHeight?: unknown
|
|
11433
|
-
|
|
11434
|
-
/** The y offset of the image preview to the top of the node body. */
|
|
11435
|
-
imageOffset?: number
|
|
11436
|
-
/** Callback for pasting an image file into the node */
|
|
11437
|
-
pasteFile?(file: File): void
|
|
11438
|
-
/** Callback for pasting multiple files into the node */
|
|
11439
|
-
pasteFiles?(files: File[]): void
|
|
11440
|
-
}
|
|
11441
|
-
/**
|
|
11442
|
-
* Only used by the Primitive node. Primitive node is using the widget property
|
|
11443
|
-
* to store/access the widget config.
|
|
11444
|
-
* We should remove this hacky solution once we have a proper solution.
|
|
11445
|
-
*/
|
|
11446
|
-
interface INodeOutputSlot {
|
|
11447
|
-
widget?: { name: string; [key: symbol]: unknown }
|
|
11448
|
-
}
|
|
11449
|
-
}
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
/**
|
|
11454
|
-
* Extended types for litegraph, to be merged upstream once it has stabilized.
|
|
11455
|
-
*/
|
|
11456
|
-
declare module '@/lib/litegraph/src/litegraph' {
|
|
11457
|
-
/**
|
|
11458
|
-
* widgets_values is set to LGraphNode by `LGraphNode.configure`, but it is not
|
|
11459
|
-
* used by litegraph internally. We should remove the dependency on it later.
|
|
11460
|
-
*/
|
|
11461
|
-
interface LGraphNode {
|
|
11462
|
-
widgets_values?: unknown[]
|
|
11463
|
-
}
|
|
11464
|
-
}
|