@comfyorg/comfyui-frontend-types 1.42.6 → 1.42.8
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 +77 -9
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import { ComfyApiWorkflow } from '../platform/workflow/validation/schemas/workfl
|
|
|
2
2
|
import { ComfyWorkflowJSON } from '../platform/workflow/validation/schemas/workflowSchema';
|
|
3
3
|
import { ComfyWorkflowJSON as ComfyWorkflowJSON_2 } from '../../validation/schemas/workflowSchema';
|
|
4
4
|
import { Component } from 'vue';
|
|
5
|
-
import {
|
|
6
|
-
import { DOMWidget } from '../scripts/domWidget';
|
|
7
|
-
import { DOMWidgetOptions } from '../scripts/domWidget';
|
|
5
|
+
import { CurveData } from '../../../../components/curve/types';
|
|
8
6
|
import { IFuseOptions } from 'fuse.js';
|
|
9
7
|
import { ModelFile as ModelFile_2 } from '../../validation/schemas/workflowSchema';
|
|
10
8
|
import { NodeId as NodeId_2 } from '../platform/workflow/validation/schemas/workflowSchema';
|
|
@@ -145,6 +143,21 @@ declare interface BaseBottomPanelExtension {
|
|
|
145
143
|
targetPanel?: 'terminal' | 'shortcuts';
|
|
146
144
|
}
|
|
147
145
|
|
|
146
|
+
declare interface BaseDOMWidget<V extends object | string = object | string> extends IBaseWidget<V, string, DOMWidgetOptions<V>> {
|
|
147
|
+
type: string;
|
|
148
|
+
options: DOMWidgetOptions<V>;
|
|
149
|
+
value: V;
|
|
150
|
+
callback?: (value: V) => void;
|
|
151
|
+
/** The unique ID of the widget. */
|
|
152
|
+
readonly id: string;
|
|
153
|
+
/** The node that the widget belongs to. */
|
|
154
|
+
readonly node: LGraphNode;
|
|
155
|
+
/** Whether the widget is visible. */
|
|
156
|
+
isVisible(): boolean;
|
|
157
|
+
/** The margin of the widget. */
|
|
158
|
+
margin: number;
|
|
159
|
+
}
|
|
160
|
+
|
|
148
161
|
declare interface BaseExportedGraph {
|
|
149
162
|
/** Unique graph ID. Automatically generated if not provided. */
|
|
150
163
|
id: UUID;
|
|
@@ -2088,6 +2101,7 @@ export declare class ComfyApp {
|
|
|
2088
2101
|
'Comfy.Workflow.ShowMissingNodesWarning'?: boolean | undefined;
|
|
2089
2102
|
'Comfy.Workflow.ShowMissingModelsWarning'?: boolean | undefined;
|
|
2090
2103
|
'Comfy.Workflow.WarnBlueprintOverwrite'?: boolean | undefined;
|
|
2104
|
+
'Comfy.Desktop.CloudNotificationShown'?: boolean | undefined;
|
|
2091
2105
|
'Comfy.DisableFloatRounding'?: boolean | undefined;
|
|
2092
2106
|
'Comfy.DisableSliders'?: boolean | undefined;
|
|
2093
2107
|
'Comfy.DOMClippingEnabled'?: boolean | undefined;
|
|
@@ -2666,9 +2680,43 @@ export declare class ComfyApp {
|
|
|
2666
2680
|
*/
|
|
2667
2681
|
declare function distance(a: Readonly<Point>, b: Readonly<Point>): number;
|
|
2668
2682
|
|
|
2669
|
-
|
|
2683
|
+
/**
|
|
2684
|
+
* A DOM widget that wraps a custom HTML element as a litegraph widget.
|
|
2685
|
+
*/
|
|
2686
|
+
export declare interface DOMWidget<T extends HTMLElement, V extends object | string> extends BaseDOMWidget<V> {
|
|
2687
|
+
element: T;
|
|
2688
|
+
/**
|
|
2689
|
+
* @deprecated Legacy property used by some extensions for customtext
|
|
2690
|
+
* (textarea) widgets. Use {@link element} instead as it provides the same
|
|
2691
|
+
* functionality and works for all DOMWidget types.
|
|
2692
|
+
*/
|
|
2693
|
+
inputEl?: T;
|
|
2694
|
+
}
|
|
2670
2695
|
|
|
2671
|
-
export
|
|
2696
|
+
export declare interface DOMWidgetOptions<V extends object | string> extends IWidgetOptions {
|
|
2697
|
+
/**
|
|
2698
|
+
* Whether to render a placeholder rectangle when zoomed out.
|
|
2699
|
+
*/
|
|
2700
|
+
hideOnZoom?: boolean;
|
|
2701
|
+
selectOn?: string[];
|
|
2702
|
+
onHide?: (widget: BaseDOMWidget<V>) => void;
|
|
2703
|
+
getValue?: () => V;
|
|
2704
|
+
setValue?: (value: V) => void;
|
|
2705
|
+
getMinHeight?: () => number;
|
|
2706
|
+
getMaxHeight?: () => number;
|
|
2707
|
+
getHeight?: () => string | number;
|
|
2708
|
+
onDraw?: (widget: BaseDOMWidget<V>) => void;
|
|
2709
|
+
margin?: number;
|
|
2710
|
+
/**
|
|
2711
|
+
* @deprecated Use `afterResize` instead. This callback is a legacy API
|
|
2712
|
+
* that fires before resize happens, but it is no longer supported. Now it
|
|
2713
|
+
* fires after resize happens.
|
|
2714
|
+
* The resize logic has been upstreamed to litegraph in
|
|
2715
|
+
* https://github.com/Comfy-Org/ComfyUI_frontend/pull/2557
|
|
2716
|
+
*/
|
|
2717
|
+
beforeResize?: (this: BaseDOMWidget<V>, node: LGraphNode) => void;
|
|
2718
|
+
afterResize?: (this: BaseDOMWidget<V>, node: LGraphNode) => void;
|
|
2719
|
+
}
|
|
2672
2720
|
|
|
2673
2721
|
declare class DragAndScale {
|
|
2674
2722
|
/**
|
|
@@ -3437,9 +3485,9 @@ export declare class ComfyApp {
|
|
|
3437
3485
|
height?: number | string;
|
|
3438
3486
|
}
|
|
3439
3487
|
|
|
3440
|
-
declare interface ICurveWidget extends IBaseWidget<
|
|
3488
|
+
declare interface ICurveWidget extends IBaseWidget<CurveData, 'curve'> {
|
|
3441
3489
|
type: 'curve';
|
|
3442
|
-
value:
|
|
3490
|
+
value: CurveData;
|
|
3443
3491
|
}
|
|
3444
3492
|
|
|
3445
3493
|
/**
|
|
@@ -5956,6 +6004,14 @@ export declare class ComfyApp {
|
|
|
5956
6004
|
* @returns object or null { link: id, name: string, type: string or 0 }
|
|
5957
6005
|
*/
|
|
5958
6006
|
getInputInfo(slot: number): INodeInputSlot | null;
|
|
6007
|
+
/**
|
|
6008
|
+
* Resolves the output source for cross-graph virtual nodes (e.g. Set/Get),
|
|
6009
|
+
* bypassing {@link getInputLink} when the source lives in a different graph.
|
|
6010
|
+
*/
|
|
6011
|
+
resolveVirtualOutput?(slot: number): {
|
|
6012
|
+
node: LGraphNode;
|
|
6013
|
+
slot: number;
|
|
6014
|
+
} | undefined;
|
|
5959
6015
|
/**
|
|
5960
6016
|
* Returns the link info in the connection of an input slot
|
|
5961
6017
|
* @returns object or null
|
|
@@ -6099,7 +6155,6 @@ export declare class ComfyApp {
|
|
|
6099
6155
|
addCustomWidget<TPlainWidget extends IBaseWidget>(custom_widget: TPlainWidget): TPlainWidget | WidgetTypeMap[TPlainWidget['type']];
|
|
6100
6156
|
addTitleButton(options: LGraphButtonOptions): LGraphButton;
|
|
6101
6157
|
onTitleButtonClick(button: LGraphButton, canvas: LGraphCanvas): void;
|
|
6102
|
-
removeWidgetByName(name: string): void;
|
|
6103
6158
|
removeWidget(widget: IBaseWidget): void;
|
|
6104
6159
|
ensureWidgetRemoved(widget: IBaseWidget): void;
|
|
6105
6160
|
move(deltaX: number, deltaY: number): void;
|
|
@@ -8628,6 +8683,16 @@ export declare class ComfyApp {
|
|
|
8628
8683
|
getIoNodeOnPos(x: number, y: number): SubgraphInputNode | SubgraphOutputNode | undefined;
|
|
8629
8684
|
private _configureSubgraph;
|
|
8630
8685
|
configure(data: (ISerialisedGraph & ExportedSubgraph) | (SerialisableGraph & ExportedSubgraph), keep_old?: boolean): boolean | undefined;
|
|
8686
|
+
/**
|
|
8687
|
+
* Repairs SubgraphInput/Output `linkIds` that reference links removed
|
|
8688
|
+
* by `_removeDuplicateLinks` during `super.configure()`.
|
|
8689
|
+
*
|
|
8690
|
+
* For each stale link ID, finds the surviving link that connects to the
|
|
8691
|
+
* same IO node and slot index, and substitutes it.
|
|
8692
|
+
*/
|
|
8693
|
+
private _repairIOSlotLinkIds;
|
|
8694
|
+
private _repairSlotLinkIds;
|
|
8695
|
+
private _findLinkBySlot;
|
|
8631
8696
|
attachCanvas(canvas: LGraphCanvas): void;
|
|
8632
8697
|
addInput(name: string, type: string): SubgraphInput;
|
|
8633
8698
|
addOutput(name: string, type: string): SubgraphOutput;
|
|
@@ -8928,6 +8993,7 @@ export declare class ComfyApp {
|
|
|
8928
8993
|
private _buildDisplayNameByViewKey;
|
|
8929
8994
|
private _makePromotionEntryKey;
|
|
8930
8995
|
private _makePromotionViewKey;
|
|
8996
|
+
private _serializeEntries;
|
|
8931
8997
|
private _resolveLegacyEntry;
|
|
8932
8998
|
/** Manages lifecycle of all subgraph event listeners */
|
|
8933
8999
|
private _eventAbortController;
|
|
@@ -8975,7 +9041,6 @@ export declare class ComfyApp {
|
|
|
8975
9041
|
private _clearDomOverrideForView;
|
|
8976
9042
|
private _removePromotedView;
|
|
8977
9043
|
removeWidget(widget: IBaseWidget): void;
|
|
8978
|
-
removeWidgetByName(name: string): void;
|
|
8979
9044
|
ensureWidgetRemoved(widget: IBaseWidget): void;
|
|
8980
9045
|
onRemoved(): void;
|
|
8981
9046
|
drawTitleBox(ctx: CanvasRenderingContext2D, { scale, low_quality, title_height, box_size }: DrawTitleBoxOptions): void;
|
|
@@ -16598,6 +16663,7 @@ export declare class ComfyApp {
|
|
|
16598
16663
|
'Comfy.Workflow.ShowMissingNodesWarning': z.ZodBoolean;
|
|
16599
16664
|
'Comfy.Workflow.ShowMissingModelsWarning': z.ZodBoolean;
|
|
16600
16665
|
'Comfy.Workflow.WarnBlueprintOverwrite': z.ZodBoolean;
|
|
16666
|
+
'Comfy.Desktop.CloudNotificationShown': z.ZodBoolean;
|
|
16601
16667
|
'Comfy.DisableFloatRounding': z.ZodBoolean;
|
|
16602
16668
|
'Comfy.DisableSliders': z.ZodBoolean;
|
|
16603
16669
|
'Comfy.DOMClippingEnabled': z.ZodBoolean;
|
|
@@ -17223,6 +17289,7 @@ export declare class ComfyApp {
|
|
|
17223
17289
|
'Comfy.Workflow.ShowMissingNodesWarning': boolean;
|
|
17224
17290
|
'Comfy.Workflow.ShowMissingModelsWarning': boolean;
|
|
17225
17291
|
'Comfy.Workflow.WarnBlueprintOverwrite': boolean;
|
|
17292
|
+
'Comfy.Desktop.CloudNotificationShown': boolean;
|
|
17226
17293
|
'Comfy.DisableFloatRounding': boolean;
|
|
17227
17294
|
'Comfy.DisableSliders': boolean;
|
|
17228
17295
|
'Comfy.DOMClippingEnabled': boolean;
|
|
@@ -17775,6 +17842,7 @@ export declare class ComfyApp {
|
|
|
17775
17842
|
'Comfy.Workflow.ShowMissingNodesWarning': boolean;
|
|
17776
17843
|
'Comfy.Workflow.ShowMissingModelsWarning': boolean;
|
|
17777
17844
|
'Comfy.Workflow.WarnBlueprintOverwrite': boolean;
|
|
17845
|
+
'Comfy.Desktop.CloudNotificationShown': boolean;
|
|
17778
17846
|
'Comfy.DisableFloatRounding': boolean;
|
|
17779
17847
|
'Comfy.DisableSliders': boolean;
|
|
17780
17848
|
'Comfy.DOMClippingEnabled': boolean;
|