@comfyorg/comfyui-frontend-types 1.24.0 → 1.24.2

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 +114 -7
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -29,6 +29,7 @@ import { ExecutionInterruptedWsMessage } from '../schemas/apiSchema';
29
29
  import { ExecutionStartWsMessage } from '../schemas/apiSchema';
30
30
  import { ExecutionSuccessWsMessage } from '../schemas/apiSchema';
31
31
  import { ExtensionsResponse } from '../schemas/apiSchema';
32
+ import { FeatureFlagsWsMessage } from '../schemas/apiSchema';
32
33
  import { FirebaseOption } from 'vuefire';
33
34
  import { FirestoreOption } from 'vuefire';
34
35
  import { FunctionalComponent } from 'vue';
@@ -58,6 +59,7 @@ import { PendingTaskItem } from '../schemas/apiSchema';
58
59
  import { PluralizationRules } from '@intlify/core-base';
59
60
  import { Positionable } from '@comfyorg/litegraph/dist/interfaces';
60
61
  import { PostTranslationHandler } from 'vue-i18n';
62
+ import { ProgressStateWsMessage } from '../schemas/apiSchema';
61
63
  import { ProgressTextWsMessage } from '../schemas/apiSchema';
62
64
  import { ProgressWsMessage } from '../schemas/apiSchema';
63
65
  import { PromptResponse } from '../schemas/apiSchema';
@@ -124,8 +126,19 @@ declare interface BackendApiCalls {
124
126
  logs: LogsWsMessage;
125
127
  /** Binary preview/progress data */
126
128
  b_preview: Blob;
129
+ /** Binary preview with metadata (node_id, prompt_id) */
130
+ b_preview_with_metadata: {
131
+ blob: Blob;
132
+ nodeId: string;
133
+ parentNodeId: string;
134
+ displayNodeId: string;
135
+ realNodeId: string;
136
+ promptId: string;
137
+ };
127
138
  progress_text: ProgressTextWsMessage;
139
+ progress_state: ProgressStateWsMessage;
128
140
  display_component: DisplayComponentWsMessage;
141
+ feature_flags: FeatureFlagsWsMessage;
129
142
  }
130
143
 
131
144
  declare interface BaseBottomPanelExtension {
@@ -234,6 +247,15 @@ export declare class ComfyApi extends EventTarget {
234
247
  user: string;
235
248
  socket: WebSocket | null;
236
249
  reportedUnknownMessageTypes: Set<string>;
250
+ /**
251
+ * Get feature flags supported by this frontend client.
252
+ * Returns a copy to prevent external modification.
253
+ */
254
+ getClientFeatureFlags(): Record<string, unknown>;
255
+ /**
256
+ * Feature flags received from the backend server.
257
+ */
258
+ serverFeatureFlags: Record<string, unknown>;
237
259
  /**
238
260
  * The auth token for the comfy org account if the user is logged in.
239
261
  * This is only used for {@link queuePrompt} now. It is not directly
@@ -373,9 +395,11 @@ export declare class ComfyApi extends EventTarget {
373
395
  */
374
396
  clearItems(type: string): Promise<void>;
375
397
  /**
376
- * Interrupts the execution of the running prompt
398
+ * Interrupts the execution of the running prompt. If runningPromptId is provided,
399
+ * it is included in the payload as a helpful hint to the backend.
400
+ * @param {string | null} [runningPromptId] Optional Running Prompt ID to interrupt
377
401
  */
378
- interrupt(): Promise<void>;
402
+ interrupt(runningPromptId: string | null): Promise<void>;
379
403
  /**
380
404
  * Gets user configuration data and where data should be stored
381
405
  */
@@ -446,6 +470,24 @@ export declare class ComfyApi extends EventTarget {
446
470
  * @returns The custom nodes i18n data
447
471
  */
448
472
  getCustomNodesI18n(): Promise<Record<string, any>>;
473
+ /**
474
+ * Checks if the server supports a specific feature.
475
+ * @param featureName The name of the feature to check
476
+ * @returns true if the feature is supported, false otherwise
477
+ */
478
+ serverSupportsFeature(featureName: string): boolean;
479
+ /**
480
+ * Gets a server feature flag value.
481
+ * @param featureName The name of the feature to get
482
+ * @param defaultValue The default value if the feature is not found
483
+ * @returns The feature value or default
484
+ */
485
+ getServerFeature<T = unknown>(featureName: string, defaultValue?: T): T;
486
+ /**
487
+ * Gets all server feature flags.
488
+ * @returns Copy of all server feature flags
489
+ */
490
+ getServerFeatures(): Record<string, unknown>;
449
491
  }
450
492
 
451
493
  export declare class ComfyApp {
@@ -491,6 +533,8 @@ export declare class ComfyApp {
491
533
  get lastExecutionError(): ExecutionErrorWsMessage | null;
492
534
  /**
493
535
  * @deprecated Use useExecutionStore().executingNodeId instead
536
+ * TODO: Update to support multiple executing nodes. This getter returns only the first executing node.
537
+ * Consider updating consumers to handle multiple nodes or use executingNodeIds array.
494
538
  */
495
539
  get runningNodeId(): NodeId | null;
496
540
  /**
@@ -592,11 +636,6 @@ export declare class ComfyApp {
592
636
  * Refresh combo list on whole nodes
593
637
  */
594
638
  refreshComboInNodes(): Promise<void>;
595
- /**
596
- * Frees memory allocated to image preview blobs for a specific node, by revoking the URLs associated with them.
597
- * @param nodeId ID of the node to revoke all preview images of
598
- */
599
- revokePreviews(nodeId: NodeId): void;
600
639
  /**
601
640
  * Clean current state
602
641
  */
@@ -972,6 +1011,21 @@ export declare class ComfyApp {
972
1011
 
973
1012
  declare type ConfirmationDialogType = 'default' | 'overwrite' | 'delete' | 'dirtyClose' | 'reinstall';
974
1013
 
1014
+ /**
1015
+ * Create a NodeExecutionId from an array of node IDs
1016
+ * @param nodeIds Array of node IDs from root to target
1017
+ * @returns A properly formatted NodeExecutionId
1018
+ */
1019
+ export declare function createNodeExecutionId(nodeIds: NodeId[]): NodeExecutionId;
1020
+
1021
+ /**
1022
+ * Create a NodeLocatorId from components
1023
+ * @param subgraphUuid The UUID of the immediate containing subgraph
1024
+ * @param localNodeId The local node ID within that subgraph
1025
+ * @returns A properly formatted NodeLocatorId
1026
+ */
1027
+ export declare function createNodeLocatorId(subgraphUuid: string, localNodeId: NodeId): NodeLocatorId;
1028
+
975
1029
  declare type CustomBottomPanelExtension = BaseBottomPanelExtension & CustomExtension;
976
1030
 
977
1031
  declare interface CustomDialogComponentProps {
@@ -1041,6 +1095,16 @@ export declare class ComfyApp {
1041
1095
 
1042
1096
  export declare type InputSpec = z.infer<typeof zInputSpec>;
1043
1097
 
1098
+ /**
1099
+ * Type guard to check if a value is a NodeExecutionId
1100
+ */
1101
+ export declare function isNodeExecutionId(value: unknown): value is NodeExecutionId;
1102
+
1103
+ /**
1104
+ * Type guard to check if a value is a NodeLocatorId
1105
+ */
1106
+ export declare function isNodeLocatorId(value: unknown): value is NodeLocatorId;
1107
+
1044
1108
  declare type Keybinding = z.infer<typeof zKeybinding>;
1045
1109
 
1046
1110
  declare interface LoadedComfyWorkflow extends ComfyWorkflow {
@@ -1090,6 +1154,49 @@ export declare class ComfyApp {
1090
1154
 
1091
1155
  export { NodeError }
1092
1156
 
1157
+ /**
1158
+ * An execution identifier representing a node's position in nested subgraphs.
1159
+ * Also known as ExecutionId in some contexts.
1160
+ *
1161
+ * Format: Colon-separated path of node IDs
1162
+ * Example: "123:456:789" (node 789 in subgraph 456 in subgraph 123)
1163
+ */
1164
+ export declare type NodeExecutionId = string;
1165
+
1166
+ /**
1167
+ * A globally unique identifier for nodes that maintains consistency across
1168
+ * multiple instances of the same subgraph.
1169
+ *
1170
+ * Format:
1171
+ * - For subgraph nodes: `<immediate-contained-subgraph-uuid>:<local-node-id>`
1172
+ * - For root graph nodes: `<local-node-id>`
1173
+ *
1174
+ * Examples:
1175
+ * - "a1b2c3d4-e5f6-7890-abcd-ef1234567890:123" (node in subgraph)
1176
+ * - "456" (node in root graph)
1177
+ *
1178
+ * Unlike execution IDs which change based on the instance path,
1179
+ * NodeLocatorId remains the same for all instances of a particular node.
1180
+ */
1181
+ export declare type NodeLocatorId = string;
1182
+
1183
+ /**
1184
+ * Parse a NodeExecutionId into its component node IDs
1185
+ * @param id The NodeExecutionId to parse
1186
+ * @returns Array of node IDs from root to target, or null if not an execution ID
1187
+ */
1188
+ export declare function parseNodeExecutionId(id: string): NodeId[] | null;
1189
+
1190
+ /**
1191
+ * Parse a NodeLocatorId into its components
1192
+ * @param id The NodeLocatorId to parse
1193
+ * @returns The subgraph UUID and local node ID, or null if invalid
1194
+ */
1195
+ export declare function parseNodeLocatorId(id: string): {
1196
+ subgraphUuid: string | null;
1197
+ localNodeId: NodeId;
1198
+ } | null;
1199
+
1093
1200
  /** {@link Pick} only properties that evaluate to `never`. */
1094
1201
  declare type PickNevers<T> = {
1095
1202
  [K in keyof T as T[K] extends never ? K : never]: T[K];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfyorg/comfyui-frontend-types",
3
- "version": "1.24.0",
3
+ "version": "1.24.2",
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.16.6"
16
+ "@comfyorg/litegraph": "^0.16.16"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "vue": "^3.5.13",