@comfyorg/comfyui-frontend-types 1.10.7 → 1.10.9

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 +43 -37
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -10,6 +10,7 @@ import { LGraph } from '@comfyorg/litegraph';
10
10
  import { LGraphCanvas } from '@comfyorg/litegraph';
11
11
  import { LGraphNode } from '@comfyorg/litegraph';
12
12
  import { LinkMarkerShape } from '@comfyorg/litegraph';
13
+ import { Positionable } from '@comfyorg/litegraph/dist/interfaces';
13
14
  import { RenderShape } from '@comfyorg/litegraph/dist/types/globalEnums';
14
15
  import { Vector2 } from '@comfyorg/litegraph';
15
16
  import { z } from 'zod';
@@ -377,6 +378,8 @@ export declare class ComfyApi extends EventTarget {
377
378
  getCustomNodesI18n(): Promise<Record<string, any>>;
378
379
  }
379
380
 
381
+ declare type ComfyApiWorkflow = z.infer<typeof zComfyApiWorkflow>;
382
+
380
383
  /**
381
384
  * @typedef {import("types/comfy").ComfyExtension} ComfyExtension
382
385
  */
@@ -496,16 +499,11 @@ export declare class ComfyApp {
496
499
  * @returns A serialized graph (aka workflow) with preferred user settings.
497
500
  */
498
501
  serializeGraph(graph?: LGraph): ISerialisedGraph;
499
- /**
500
- * Converts the current graph workflow for sending to the API.
501
- * Note: Node widgets are updated before serialization to prepare queueing.
502
- * @returns The workflow and node links
503
- */
504
- graphToPrompt(graph?: LGraph, clean?: boolean): Promise<{
505
- workflow: ISerialisedGraph;
506
- output: {};
502
+ graphToPrompt(graph?: LGraph): Promise<{
503
+ workflow: ComfyWorkflowJSON;
504
+ output: ComfyApiWorkflow;
507
505
  }>;
508
- queuePrompt(number: any, batchCount?: number): Promise<boolean>;
506
+ queuePrompt(number: number, batchCount?: number): Promise<boolean>;
509
507
  showErrorOnFileLoad(file: any): void;
510
508
  /**
511
509
  * Loads workflow data from the specified file
@@ -672,6 +670,12 @@ export declare class ComfyApp {
672
670
  * @returns An array of {[widget name]: widget data}
673
671
  */
674
672
  getCustomWidgets?(app: ComfyApp): Promise<Widgets> | Widgets;
673
+ /**
674
+ * Allows the extension to add additional commands to the selection toolbox
675
+ * @param selectedItem The selected item on the canvas
676
+ * @returns An array of command ids to add to the selection toolbox
677
+ */
678
+ getSelectionToolboxCommands?(selectedItem: Positionable): string[];
675
679
  /**
676
680
  * Allows the extension to add additional handling to the node before it is registered with **LGraph**
677
681
  * @param nodeType The node class (not an instance)
@@ -1228,6 +1232,30 @@ export declare class ComfyApp {
1228
1232
 
1229
1233
  declare type Widgets = Record<string, ComfyWidgetConstructor>;
1230
1234
 
1235
+ declare const zComfyApiWorkflow: z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodObject<{
1236
+ inputs: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodAny, z.ZodTuple<[z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodUnion<[z.ZodNumber, z.ZodEffects<z.ZodEffects<z.ZodString, number, string>, number, string>]>], null>]>>;
1237
+ class_type: z.ZodString;
1238
+ _meta: z.ZodObject<{
1239
+ title: z.ZodString;
1240
+ }, "strip", z.ZodTypeAny, {
1241
+ title?: string;
1242
+ }, {
1243
+ title?: string;
1244
+ }>;
1245
+ }, "strip", z.ZodTypeAny, {
1246
+ inputs?: Record<string, any>;
1247
+ class_type?: string;
1248
+ _meta?: {
1249
+ title?: string;
1250
+ };
1251
+ }, {
1252
+ inputs?: Record<string, any>;
1253
+ class_type?: string;
1254
+ _meta?: {
1255
+ title?: string;
1256
+ };
1257
+ }>>;
1258
+
1231
1259
  declare const zComfyNodeDef: z.ZodObject<{
1232
1260
  input: z.ZodOptional<z.ZodObject<{
1233
1261
  required: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodTuple<[z.ZodLiteral<"INT">, z.ZodObject<z.objectUtil.extendShape<{
@@ -8245,10 +8273,10 @@ export declare class ComfyApp {
8245
8273
  } & {
8246
8274
  [k: string]: unknown;
8247
8275
  };
8276
+ merge?: boolean;
8248
8277
  prompt_id?: string;
8249
8278
  node?: string | number;
8250
8279
  display_node?: string | number;
8251
- merge?: boolean;
8252
8280
  }, {
8253
8281
  output?: {
8254
8282
  audio?: {
@@ -8265,10 +8293,10 @@ export declare class ComfyApp {
8265
8293
  } & {
8266
8294
  [k: string]: unknown;
8267
8295
  };
8296
+ merge?: boolean;
8268
8297
  prompt_id?: string;
8269
8298
  node?: string | number;
8270
8299
  display_node?: string | number;
8271
- merge?: boolean;
8272
8300
  }>;
8273
8301
 
8274
8302
  declare const zExecutingWsMessage: z.ZodObject<{
@@ -33691,7 +33719,6 @@ declare module '@comfyorg/litegraph' {
33691
33719
  convertToNodes?(): LGraphNode[]
33692
33720
  recreate?(): Promise<LGraphNode>
33693
33721
  refreshComboInNode?(defs: Record<string, ComfyNodeDef>)
33694
- applyToGraph?(extraLinks?: LLink[]): void
33695
33722
  updateLink?(link: LLink): LLink | null
33696
33723
  onExecutionStart?(): unknown
33697
33724
  /**
@@ -33756,32 +33783,11 @@ declare module '@comfyorg/litegraph' {
33756
33783
  * Extended types for litegraph, to be merged upstream once it has stabilized.
33757
33784
  */
33758
33785
  declare module '@comfyorg/litegraph' {
33759
- interface INodeInputSlot {
33760
- pos?: [number, number]
33761
- }
33762
-
33786
+ /**
33787
+ * widgets_values is set to LGraphNode by `LGraphNode.configure`, but it is not
33788
+ * used by litegraph internally. We should remove the dependency on it later.
33789
+ */
33763
33790
  interface LGraphNode {
33764
33791
  widgets_values?: unknown[]
33765
33792
  }
33766
-
33767
- interface LGraphCanvas {
33768
- /** This is in the litegraph types but has incorrect return type */
33769
- isOverNodeInput(
33770
- node: LGraphNode,
33771
- canvasX: number,
33772
- canvasY: number,
33773
- slotPos: Vector2
33774
- ): number
33775
-
33776
- isOverNodeOutput(
33777
- node: LGraphNode,
33778
- canvasX: number,
33779
- canvasY: number,
33780
- slotPos: Vector2
33781
- ): number
33782
- }
33783
-
33784
- interface ContextMenu {
33785
- root?: HTMLDivElement
33786
- }
33787
33793
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-frontend-types",
3
- "version": "1.10.7",
3
+ "version": "1.10.9",
4
4
  "types": "./index.d.ts",
5
5
  "files": [
6
6
  "index.d.ts"
@@ -13,7 +13,7 @@
13
13
  "description": "TypeScript definitions for @comfyorg/comfyui-frontend",
14
14
  "license": "GPL-3.0-only",
15
15
  "dependencies": {
16
- "@comfyorg/litegraph": "^0.8.89"
16
+ "@comfyorg/litegraph": "^0.8.92"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "vue": "^3.5.13",