@comfyorg/comfyui-frontend-types 1.47.3 → 1.47.4

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.
Files changed (2) hide show
  1. package/index.d.ts +93 -21
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -394,6 +394,27 @@ declare class BooleanWidget extends BaseWidget<IBooleanWidget> implements IBoole
394
394
 
395
395
  export declare type BottomPanelExtension = VueBottomPanelExtension | CustomBottomPanelExtension;
396
396
 
397
+ declare interface BoundingBox {
398
+ x: number;
399
+ y: number;
400
+ width: number;
401
+ height: number;
402
+ metadata: BoundingBoxMetadata;
403
+ }
404
+
405
+ declare class BoundingBoxesWidget extends BaseWidget<IBoundingBoxesWidget> implements IBoundingBoxesWidget {
406
+ type: "boundingboxes";
407
+ drawWidget(ctx: CanvasRenderingContext2D, options: DrawWidgetOptions): void;
408
+ onClick(_options: WidgetEventOptions): void;
409
+ }
410
+
411
+ declare interface BoundingBoxMetadata {
412
+ type: RegionType;
413
+ text: string;
414
+ desc: string;
415
+ palette: string[];
416
+ }
417
+
397
418
  /**
398
419
  * Widget for defining bounding box regions.
399
420
  * This widget only has a Vue implementation.
@@ -819,6 +840,12 @@ declare interface ColorStop {
819
840
  readonly color: readonly [r: number, g: number, b: number];
820
841
  }
821
842
 
843
+ declare class ColorsWidget extends BaseWidget<IColorsWidget> implements IColorsWidget {
844
+ type: "colors";
845
+ drawWidget(ctx: CanvasRenderingContext2D, options: DrawWidgetOptions): void;
846
+ onClick(_options: WidgetEventOptions): void;
847
+ }
848
+
822
849
  /**
823
850
  * Widget for displaying a color picker using native HTML color input
824
851
  */
@@ -2630,7 +2657,7 @@ export declare class ComfyApp {
2630
2657
  * @param nodeIds Array of node IDs from root to target
2631
2658
  * @returns A properly formatted NodeExecutionId
2632
2659
  */
2633
- export declare function createNodeExecutionId(nodeIds: NodeId_2[]): NodeExecutionId;
2660
+ export declare function createNodeExecutionId<const T extends readonly NodeId_2[]>(nodeIds: T & (T extends readonly [] ? never : unknown)): NodeExecutionId;
2634
2661
 
2635
2662
  /**
2636
2663
  * Create a NodeLocatorId from components
@@ -2638,7 +2665,7 @@ export declare class ComfyApp {
2638
2665
  * @param localNodeId The local node ID within that subgraph
2639
2666
  * @returns A properly formatted NodeLocatorId
2640
2667
  */
2641
- export declare function createNodeLocatorId(subgraphUuid: string, localNodeId: NodeId_2): NodeLocatorId;
2668
+ export declare function createNodeLocatorId(subgraphUuid: string | null, localNodeId: NodeId_2): NodeLocatorId;
2642
2669
 
2643
2670
  /** Options for {@link LiteGraphGlobal.createNode}. Shallow-copied onto the new node. */
2644
2671
  declare interface CreateNodeOptions {
@@ -3529,6 +3556,11 @@ export declare class ComfyApp {
3529
3556
  left: LGraphNode;
3530
3557
  }
3531
3558
 
3559
+ declare interface IBoundingBoxesWidget extends IBaseWidget<BoundingBox[], 'boundingboxes'> {
3560
+ type: 'boundingboxes';
3561
+ value: BoundingBox[];
3562
+ }
3563
+
3532
3564
  /** Bounding box widget for defining regions with numeric inputs */
3533
3565
  declare interface IBoundingBoxWidget extends IBaseWidget<Bounds, 'boundingbox'> {
3534
3566
  type: 'boundingbox';
@@ -3567,6 +3599,11 @@ export declare class ComfyApp {
3567
3599
  getColorOption(): ColorOption | null;
3568
3600
  }
3569
3601
 
3602
+ declare interface IColorsWidget extends IBaseWidget<string[], 'colors'> {
3603
+ type: 'colors';
3604
+ value: string[];
3605
+ }
3606
+
3570
3607
  /** Color picker widget for selecting colors */
3571
3608
  declare interface IColorWidget extends IBaseWidget<string, 'color'> {
3572
3609
  type: 'color';
@@ -4169,7 +4206,7 @@ export declare class ComfyApp {
4169
4206
  * Recommend declaration merging any properties that use IWidget (e.g. {@link LGraphNode.widgets}) with a new type alias.
4170
4207
  * @see ICustomWidget
4171
4208
  */
4172
- declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IGradientSliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget | IAssetWidget | IImageCropWidget | IBoundingBoxWidget | ICurveWidget | IPainterWidget | IRangeWidget;
4209
+ declare type IWidget = IBooleanWidget | INumericWidget | IStringWidget | IComboWidget | IStringComboWidget | ICustomWidget | ISliderWidget | IGradientSliderWidget | IButtonWidget | IKnobWidget | IFileUploadWidget | IColorWidget | IMarkdownWidget | IImageWidget | ITreeSelectWidget | IMultiSelectWidget | IChartWidget | IGalleriaWidget | IImageCompareWidget | ISelectButtonWidget | ITextareaWidget | IAssetWidget | IImageCropWidget | IBoundingBoxWidget | ICurveWidget | IPainterWidget | IRangeWidget | IBoundingBoxesWidget | IColorsWidget;
4173
4210
 
4174
4211
  declare interface IWidgetAssetOptions extends IWidgetOptions {
4175
4212
  openModal: (widget: IBaseWidget) => void;
@@ -4361,7 +4398,7 @@ export declare class ComfyApp {
4361
4398
  private _state;
4362
4399
  get state(): LGraphState;
4363
4400
  set state(value: LGraphState);
4364
- readonly events: CustomEventTarget<LGraphEventMap, "node:property:changed" | "node:slot-errors:changed" | "node:slot-links:changed" | "node:slot-label:changed" | "configuring" | "configured" | "subgraph-created" | "convert-to-subgraph" | "open-subgraph">;
4401
+ readonly events: CustomEventTarget<LGraphEventMap, "node:property:changed" | "node:slot-errors:changed" | "node:slot-links:changed" | "node:slot-label:changed" | "configuring" | "configured" | "subgraph-created" | "convert-to-subgraph" | "open-subgraph" | "node:before-removed">;
4365
4402
  readonly _subgraphs: Map<SubgraphId, Subgraph>;
4366
4403
  _nodes: (LGraphNode | SubgraphNode)[];
4367
4404
  _nodes_by_id: Record<NodeId, LGraphNode>;
@@ -4415,13 +4452,16 @@ export declare class ComfyApp {
4415
4452
  onNodeAdded?(node: LGraphNode): void;
4416
4453
  onNodeRemoved?(node: LGraphNode): void;
4417
4454
  onTrigger?: LGraphTriggerHandler;
4455
+ /**
4456
+ * @deprecated Assign a listener to {@link LGraphCanvas.onBeforeChange} instead.
4457
+ * This graph-level hook will be removed in a future version.
4458
+ */
4418
4459
  onBeforeChange?(graph: LGraph, info?: LGraphNode): void;
4419
4460
  onAfterChange?(graph: LGraph, info?: LGraphNode | null): void;
4420
4461
  onConnectionChange?(node: LGraphNode): void;
4421
4462
  on_change?(graph: LGraph): void;
4422
4463
  onSerialize?(data: ISerialisedGraph | SerialisableGraph): void;
4423
4464
  onConfigure?(data: ISerialisedGraph | SerialisableGraph): void;
4424
- onGetNodeMenuOptions?(options: (IContextMenuValue<unknown> | null)[], node: LGraphNode): void;
4425
4465
  private _input_nodes?;
4426
4466
  /**
4427
4467
  * See {@link LGraph}
@@ -5732,6 +5772,12 @@ export declare class ComfyApp {
5732
5772
  subgraph: Subgraph;
5733
5773
  closingGraph: LGraph | Subgraph;
5734
5774
  };
5775
+ /**
5776
+ * Fires on the owning graph before per-node teardown begins
5777
+ */
5778
+ 'node:before-removed': {
5779
+ node: LGraphNode;
5780
+ };
5735
5781
  'node:property:changed': {
5736
5782
  nodeId: NodeId;
5737
5783
  property: string;
@@ -7969,7 +8015,9 @@ export declare class ComfyApp {
7969
8015
  * Format: Colon-separated path of node IDs
7970
8016
  * Example: "123:456:789" (node 789 in subgraph 456 in subgraph 123)
7971
8017
  */
7972
- export declare type NodeExecutionId = string;
8018
+ export declare type NodeExecutionId = string & {
8019
+ readonly __brand: 'NodeExecutionId';
8020
+ };
7973
8021
 
7974
8022
  declare type NodeId = number | string;
7975
8023
 
@@ -7993,7 +8041,9 @@ export declare class ComfyApp {
7993
8041
  * Unlike execution IDs which change based on the instance path,
7994
8042
  * NodeLocatorId remains the same for all instances of a particular node.
7995
8043
  */
7996
- export declare type NodeLocatorId = string;
8044
+ export declare type NodeLocatorId = string & {
8045
+ readonly __brand: 'NodeLocatorId';
8046
+ };
7997
8047
 
7998
8048
  declare type NodeProperty = string | number | boolean | object;
7999
8049
 
@@ -8464,6 +8514,8 @@ export declare class ComfyApp {
8464
8514
  /* Excluded from this release type: _drawDebug */
8465
8515
  }
8466
8516
 
8517
+ declare type RegionType = 'obj' | 'text';
8518
+
8467
8519
  declare type RendererType = 'LG' | 'Vue' | 'Vue-corrected';
8468
8520
 
8469
8521
  declare interface RenderLink {
@@ -8968,7 +9020,7 @@ export declare class ComfyApp {
8968
9020
 
8969
9021
  /** A subgraph definition. */
8970
9022
  declare class Subgraph extends LGraph implements BaseLGraph, Serialisable<ExportedSubgraph> {
8971
- readonly events: CustomEventTarget<SubgraphEventMap, "node:property:changed" | "node:slot-errors:changed" | "node:slot-links:changed" | "node:slot-label:changed" | "adding-input" | "adding-output" | "input-added" | "output-added" | "removing-input" | "removing-output" | "inputs-reordered" | "renaming-input" | "renaming-output" | "widget-promoted" | "widget-demoted" | "configuring" | "configured" | "subgraph-created" | "convert-to-subgraph" | "open-subgraph">;
9023
+ readonly events: CustomEventTarget<SubgraphEventMap, "node:property:changed" | "node:slot-errors:changed" | "node:slot-links:changed" | "node:slot-label:changed" | "adding-input" | "adding-output" | "input-added" | "output-added" | "removing-input" | "removing-output" | "inputs-reordered" | "renaming-input" | "renaming-output" | "widget-promoted" | "widget-demoted" | "configuring" | "configured" | "subgraph-created" | "convert-to-subgraph" | "open-subgraph" | "node:before-removed">;
8972
9024
  /** Limits the number of levels / depth that subgraphs may be nested. Prevents uncontrolled programmatic nesting. */
8973
9025
  static MAX_NESTED_SUBGRAPHS: number;
8974
9026
  /** The display name of the subgraph. */
@@ -9104,7 +9156,7 @@ export declare class ComfyApp {
9104
9156
  */
9105
9157
  declare class SubgraphInput extends SubgraphSlot {
9106
9158
  parent: SubgraphInputNode;
9107
- events: CustomEventTarget<SubgraphInputEventMap, "node:property:changed" | "node:slot-errors:changed" | "node:slot-links:changed" | "node:slot-label:changed" | "configuring" | "configured" | "subgraph-created" | "convert-to-subgraph" | "open-subgraph" | "input-connected" | "input-disconnected">;
9159
+ events: CustomEventTarget<SubgraphInputEventMap, "node:property:changed" | "node:slot-errors:changed" | "node:slot-links:changed" | "node:slot-label:changed" | "configuring" | "configured" | "subgraph-created" | "convert-to-subgraph" | "open-subgraph" | "node:before-removed" | "input-connected" | "input-disconnected">;
9108
9160
  /** The linked widget that this slot is connected to. */
9109
9161
  private _widgetRef?;
9110
9162
  get _widget(): IBaseWidget<string | number | boolean | object | undefined, string, IWidgetOptions<unknown>> | undefined;
@@ -9275,6 +9327,7 @@ export declare class ComfyApp {
9275
9327
  readonly isVirtualNode: true;
9276
9328
  graph: GraphOrSubgraph | null;
9277
9329
  get rootGraph(): LGraph;
9330
+ get isDetached(): boolean;
9278
9331
  get displayType(): string;
9279
9332
  isSubgraphNode(): this is SubgraphNode;
9280
9333
  widgets: IBaseWidget[];
@@ -9434,7 +9487,7 @@ export declare class ComfyApp {
9434
9487
  editorAlpha?: number;
9435
9488
  }
9436
9489
 
9437
- declare type SubscriptionDialogReason = 'subscription_required' | 'out_of_credits' | 'top_up_blocked';
9490
+ declare type SubscriptionDialogReason = 'subscription_required' | 'out_of_credits' | 'top_up_blocked' | 'deep_link';
9438
9491
 
9439
9492
  export declare type SystemStats = z.infer<typeof zSystemStats>;
9440
9493
 
@@ -9822,6 +9875,11 @@ export declare class ComfyApp {
9822
9875
  showLeaveWorkspaceDialog: () => Promise<DialogInstance>;
9823
9876
  showEditWorkspaceDialog: () => Promise<DialogInstance>;
9824
9877
  showRemoveMemberDialog: (memberId: string) => Promise<DialogInstance>;
9878
+ showChangeMemberRoleDialog: (props: {
9879
+ memberId: string;
9880
+ memberName: string;
9881
+ targetRole: WorkspaceRole;
9882
+ }) => Promise<DialogInstance>;
9825
9883
  showRevokeInviteDialog: (inviteId: string) => Promise<DialogInstance>;
9826
9884
  showInviteMemberDialog: () => Promise<DialogInstance>;
9827
9885
  showInviteMemberUpsellDialog: () => Promise<DialogInstance>;
@@ -22232,9 +22290,8 @@ export declare class ComfyApp {
22232
22290
  executionIdToCurrentId: (id: string) => string | undefined;
22233
22291
  nodeIdToNodeLocatorId: (nodeId: NodeId_4, subgraph?: Subgraph) => NodeLocatorId;
22234
22292
  nodeToNodeLocatorId: (node: LGraphNode) => NodeLocatorId;
22235
- nodeExecutionIdToNodeLocatorId: (nodeExecutionId: NodeExecutionId | string) => NodeLocatorId | null;
22236
- nodeLocatorIdToNodeId: (locatorId: NodeLocatorId | string) => NodeId_4 | null;
22237
- nodeLocatorIdToNodeExecutionId: (locatorId: NodeLocatorId | string, targetSubgraph?: Subgraph) => NodeExecutionId | null;
22293
+ nodeLocatorIdToNodeId: (locatorId: NodeLocatorId) => NodeId_4;
22294
+ nodeLocatorIdToNodeExecutionId: (locatorId: NodeLocatorId, targetSubgraph?: Subgraph) => NodeExecutionId | null;
22238
22295
  }, "activeWorkflow" | "isBusy" | "isSyncLoading" | "isSubgraphActive" | "activeSubgraph">, Pick<{
22239
22296
  activeWorkflow: Ref< {
22240
22297
  isLoaded: true;
@@ -34545,10 +34602,9 @@ export declare class ComfyApp {
34545
34602
  executionIdToCurrentId: (id: string) => string | undefined;
34546
34603
  nodeIdToNodeLocatorId: (nodeId: NodeId_4, subgraph?: Subgraph) => NodeLocatorId;
34547
34604
  nodeToNodeLocatorId: (node: LGraphNode) => NodeLocatorId;
34548
- nodeExecutionIdToNodeLocatorId: (nodeExecutionId: NodeExecutionId | string) => NodeLocatorId | null;
34549
- nodeLocatorIdToNodeId: (locatorId: NodeLocatorId | string) => NodeId_4 | null;
34550
- nodeLocatorIdToNodeExecutionId: (locatorId: NodeLocatorId | string, targetSubgraph?: Subgraph) => NodeExecutionId | null;
34551
- }, "workflows" | "openWorkflows" | "bookmarkedWorkflows" | "persistedWorkflows" | "modifiedWorkflows">, Pick<{
34605
+ nodeLocatorIdToNodeId: (locatorId: NodeLocatorId) => NodeId_4;
34606
+ nodeLocatorIdToNodeExecutionId: (locatorId: NodeLocatorId, targetSubgraph?: Subgraph) => NodeExecutionId | null;
34607
+ }, "openWorkflows" | "workflows" | "bookmarkedWorkflows" | "persistedWorkflows" | "modifiedWorkflows">, Pick<{
34552
34608
  activeWorkflow: Ref< {
34553
34609
  isLoaded: true;
34554
34610
  originalContent: string;
@@ -46858,10 +46914,9 @@ export declare class ComfyApp {
46858
46914
  executionIdToCurrentId: (id: string) => string | undefined;
46859
46915
  nodeIdToNodeLocatorId: (nodeId: NodeId_4, subgraph?: Subgraph) => NodeLocatorId;
46860
46916
  nodeToNodeLocatorId: (node: LGraphNode) => NodeLocatorId;
46861
- nodeExecutionIdToNodeLocatorId: (nodeExecutionId: NodeExecutionId | string) => NodeLocatorId | null;
46862
- nodeLocatorIdToNodeId: (locatorId: NodeLocatorId | string) => NodeId_4 | null;
46863
- nodeLocatorIdToNodeExecutionId: (locatorId: NodeLocatorId | string, targetSubgraph?: Subgraph) => NodeExecutionId | null;
46864
- }, "attachWorkflow" | "isActive" | "openedWorkflowIndexShift" | "getMostRecentWorkflow" | "openWorkflow" | "openWorkflowsInBackground" | "isOpen" | "closeWorkflow" | "createTemporary" | "createNewTemporary" | "renameWorkflow" | "deleteWorkflow" | "saveWorkflow" | "getWorkflowByPath" | "syncWorkflows" | "reorderWorkflows" | "updateActiveGraph" | "executionIdToCurrentId" | "nodeIdToNodeLocatorId" | "nodeToNodeLocatorId" | "nodeExecutionIdToNodeLocatorId" | "nodeLocatorIdToNodeId" | "nodeLocatorIdToNodeExecutionId" | "saveAs" | "loadWorkflows">>;
46917
+ nodeLocatorIdToNodeId: (locatorId: NodeLocatorId) => NodeId_4;
46918
+ nodeLocatorIdToNodeExecutionId: (locatorId: NodeLocatorId, targetSubgraph?: Subgraph) => NodeExecutionId | null;
46919
+ }, "attachWorkflow" | "isActive" | "openedWorkflowIndexShift" | "getMostRecentWorkflow" | "openWorkflow" | "openWorkflowsInBackground" | "isOpen" | "closeWorkflow" | "createTemporary" | "createNewTemporary" | "renameWorkflow" | "deleteWorkflow" | "saveWorkflow" | "getWorkflowByPath" | "syncWorkflows" | "reorderWorkflows" | "updateActiveGraph" | "executionIdToCurrentId" | "nodeIdToNodeLocatorId" | "nodeToNodeLocatorId" | "nodeLocatorIdToNodeId" | "nodeLocatorIdToNodeExecutionId" | "saveAs" | "loadWorkflows">>;
46865
46920
 
46866
46921
  declare type UUID = string;
46867
46922
 
@@ -46923,6 +46978,8 @@ export declare class ComfyApp {
46923
46978
  curve: CurveWidget;
46924
46979
  painter: PainterWidget;
46925
46980
  range: RangeWidget;
46981
+ boundingboxes: BoundingBoxesWidget;
46982
+ colors: ColorsWidget;
46926
46983
  [key: string]: BaseWidget;
46927
46984
  };
46928
46985
 
@@ -46960,6 +47017,8 @@ export declare class ComfyApp {
46960
47017
  isEssential?: boolean;
46961
47018
  }
46962
47019
 
47020
+ declare type WorkspaceRole = 'owner' | 'member';
47021
+
46963
47022
  declare const zAssetDownloadWsMessage: z.ZodObject<{
46964
47023
  task_id: z.ZodString;
46965
47024
  asset_name: z.ZodString;
@@ -51454,3 +51513,16 @@ export declare class ComfyApp {
51454
51513
  }>;
51455
51514
 
51456
51515
  export { }
51516
+
51517
+
51518
+
51519
+ declare module 'axios' {
51520
+ interface AxiosRequestConfig {
51521
+ // Latches a single reactive 401 retry so a replayed request cannot trigger
51522
+ // a second re-mint.
51523
+ __unifiedRetried?: boolean
51524
+ // Exempts a deliberately Firebase-authed request (acceptInvite) from the
51525
+ // unified re-mint.
51526
+ __skipUnifiedRemint?: boolean
51527
+ }
51528
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-frontend-types",
3
- "version": "1.47.3",
3
+ "version": "1.47.4",
4
4
  "types": "./index.d.ts",
5
5
  "files": [
6
6
  "index.d.ts"