@comfyorg/comfyui-frontend-types 1.45.10 → 1.45.20

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 +56 -1
  2. package/package.json +4 -2
package/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ComfyApiWorkflow } from '../platform/workflow/validation/schemas/workflowSchema';
2
+ import { ComfyDesktop2Bridge } from '@comfyorg/comfyui-desktop-bridge-types';
2
3
  import { ComfyNodeDef } from '@comfyorg/object-info-parser';
3
4
  import { ComfyWorkflowJSON } from '../platform/workflow/validation/schemas/workflowSchema';
4
5
  import { ComfyWorkflowJSON as ComfyWorkflowJSON_2 } from '../../validation/schemas/workflowSchema';
@@ -373,6 +374,27 @@ declare class BooleanWidget extends BaseWidget<IBooleanWidget> implements IBoole
373
374
 
374
375
  export declare type BottomPanelExtension = VueBottomPanelExtension | CustomBottomPanelExtension;
375
376
 
377
+ declare interface BoundingBox {
378
+ x: number;
379
+ y: number;
380
+ width: number;
381
+ height: number;
382
+ metadata: BoundingBoxMetadata;
383
+ }
384
+
385
+ declare class BoundingBoxesWidget extends BaseWidget<IBoundingBoxesWidget> implements IBoundingBoxesWidget {
386
+ type: "boundingboxes";
387
+ drawWidget(ctx: CanvasRenderingContext2D, options: DrawWidgetOptions): void;
388
+ onClick(_options: WidgetEventOptions): void;
389
+ }
390
+
391
+ declare interface BoundingBoxMetadata {
392
+ type: RegionType;
393
+ text: string;
394
+ desc: string;
395
+ palette: string[];
396
+ }
397
+
376
398
  /**
377
399
  * Widget for defining bounding box regions.
378
400
  * This widget only has a Vue implementation.
@@ -798,6 +820,12 @@ declare interface ColorStop {
798
820
  readonly color: readonly [r: number, g: number, b: number];
799
821
  }
800
822
 
823
+ declare class ColorsWidget extends BaseWidget<IColorsWidget> implements IColorsWidget {
824
+ type: "colors";
825
+ drawWidget(ctx: CanvasRenderingContext2D, options: DrawWidgetOptions): void;
826
+ onClick(_options: WidgetEventOptions): void;
827
+ }
828
+
801
829
  /**
802
830
  * Widget for displaying a color picker using native HTML color input
803
831
  */
@@ -1550,6 +1578,8 @@ export declare class ComfyApp {
1550
1578
  element: T;
1551
1579
  }
1552
1580
 
1581
+ export { ComfyDesktop2Bridge }
1582
+
1553
1583
  declare class ComfyDialog<T extends HTMLElement = HTMLElement> extends EventTarget {
1554
1584
  element: T;
1555
1585
  textElement: HTMLElement;
@@ -3396,6 +3426,11 @@ export declare class ComfyApp {
3396
3426
  left: LGraphNode;
3397
3427
  }
3398
3428
 
3429
+ declare interface IBoundingBoxesWidget extends IBaseWidget<BoundingBox[], 'boundingboxes'> {
3430
+ type: 'boundingboxes';
3431
+ value: BoundingBox[];
3432
+ }
3433
+
3399
3434
  /** Bounding box widget for defining regions with numeric inputs */
3400
3435
  declare interface IBoundingBoxWidget extends IBaseWidget<Bounds, 'boundingbox'> {
3401
3436
  type: 'boundingbox';
@@ -3434,6 +3469,11 @@ export declare class ComfyApp {
3434
3469
  getColorOption(): ColorOption | null;
3435
3470
  }
3436
3471
 
3472
+ declare interface IColorsWidget extends IBaseWidget<string[], 'colors'> {
3473
+ type: 'colors';
3474
+ value: string[];
3475
+ }
3476
+
3437
3477
  /** Color picker widget for selecting colors */
3438
3478
  declare interface IColorWidget extends IBaseWidget<string, 'color'> {
3439
3479
  type: 'color';
@@ -4035,7 +4075,7 @@ export declare class ComfyApp {
4035
4075
  * Recommend declaration merging any properties that use IWidget (e.g. {@link LGraphNode.widgets}) with a new type alias.
4036
4076
  * @see ICustomWidget
4037
4077
  */
4038
- 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;
4078
+ 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;
4039
4079
 
4040
4080
  declare interface IWidgetAssetOptions extends IWidgetOptions {
4041
4081
  openModal: (widget: IBaseWidget) => void;
@@ -4091,6 +4131,14 @@ export declare class ComfyApp {
4091
4131
  socketless?: boolean;
4092
4132
  /** If `true`, the widget will not be rendered by the Vue renderer. */
4093
4133
  canvasOnly?: boolean;
4134
+ /**
4135
+ * If `true`, the widget still renders on the node but is omitted from the
4136
+ * right side panel. Unlike {@link IWidgetOptions.canvasOnly}, the node body
4137
+ * keeps rendering it via the Vue renderer. Used for widgets that hold
4138
+ * non-syncable state (e.g. a Three.js viewport) where a second instance in
4139
+ * the panel would diverge from the one on the node.
4140
+ */
4141
+ hideInPanel?: boolean;
4094
4142
  /** Used as a temporary override for determining the asset type in vue mode*/
4095
4143
  nodeType?: string;
4096
4144
  /**
@@ -8312,6 +8360,8 @@ export declare class ComfyApp {
8312
8360
  /* Excluded from this release type: _drawDebug */
8313
8361
  }
8314
8362
 
8363
+ declare type RegionType = 'obj' | 'text';
8364
+
8315
8365
  declare type RendererType = 'LG' | 'Vue' | 'Vue-corrected';
8316
8366
 
8317
8367
  declare interface RenderLink {
@@ -8333,6 +8383,7 @@ export declare class ComfyApp {
8333
8383
  readonly fromSlotIndex: SlotIndex;
8334
8384
  /** The reroute that the link is being connected from. */
8335
8385
  readonly fromReroute?: Reroute;
8386
+ readonly isIoNodeLink?: boolean;
8336
8387
  /**
8337
8388
  * Capability checks used for hit-testing and validation during drag.
8338
8389
  * Implementations should return `false` when a connection is not possible
@@ -9455,6 +9506,7 @@ export declare class ComfyApp {
9455
9506
  readonly fromPos: Point;
9456
9507
  fromDirection: LinkDirection;
9457
9508
  readonly existingLink?: LLink;
9509
+ readonly isIoNodeLink = true;
9458
9510
  constructor(network: LinkNetwork, node: SubgraphInputNode, fromSlot: SubgraphInput, fromReroute?: Reroute | undefined, dragDirection?: LinkDirection, existingLink?: LLink);
9459
9511
  canConnectToInput(inputNode: NodeLike, input: INodeInputSlot): boolean;
9460
9512
  canConnectToOutput(): false;
@@ -9508,6 +9560,7 @@ export declare class ComfyApp {
9508
9560
  readonly fromPos: Point;
9509
9561
  readonly fromSlotIndex: SlotIndex;
9510
9562
  fromDirection: LinkDirection;
9563
+ readonly isIoNodeLink = true;
9511
9564
  constructor(network: LinkNetwork, node: SubgraphOutputNode, fromSlot: SubgraphOutput, fromReroute?: Reroute | undefined, dragDirection?: LinkDirection);
9512
9565
  canConnectToInput(): false;
9513
9566
  canConnectToOutput(outputNode: NodeLike, output: INodeOutputSlot | SubgraphIO): boolean;
@@ -46658,6 +46711,8 @@ export declare class ComfyApp {
46658
46711
  curve: CurveWidget;
46659
46712
  painter: PainterWidget;
46660
46713
  range: RangeWidget;
46714
+ boundingboxes: BoundingBoxesWidget;
46715
+ colors: ColorsWidget;
46661
46716
  [key: string]: BaseWidget;
46662
46717
  };
46663
46718
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-frontend-types",
3
- "version": "1.45.10",
3
+ "version": "1.45.20",
4
4
  "types": "./index.d.ts",
5
5
  "files": [
6
6
  "index.d.ts"
@@ -12,7 +12,9 @@
12
12
  "homepage": "https://comfy.org",
13
13
  "description": "TypeScript definitions for @comfyorg/comfyui-frontend",
14
14
  "license": "GPL-3.0-only",
15
- "dependencies": {},
15
+ "dependencies": {
16
+ "@comfyorg/comfyui-desktop-bridge-types": "0.1.2"
17
+ },
16
18
  "peerDependencies": {
17
19
  "vue": "^3.5.13",
18
20
  "zod": "^3.23.8"