comfyui-node 1.1.3 → 1.2.0
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/LICENSE +1 -1
- package/README.md +1200 -1140
- package/dist/.tsbuildinfo +1 -1
- package/dist/call-wrapper.d.ts +8 -0
- package/dist/call-wrapper.d.ts.map +1 -1
- package/dist/call-wrapper.js +12 -0
- package/dist/call-wrapper.js.map +1 -1
- package/dist/client.d.ts +20 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +76 -14
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -1
- package/dist/features/base.d.ts +21 -0
- package/dist/features/base.d.ts.map +1 -1
- package/dist/features/base.js +21 -0
- package/dist/features/base.js.map +1 -1
- package/dist/tools.d.ts +22 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +22 -0
- package/dist/tools.js.map +1 -1
- package/dist/typed-event-target.d.ts +29 -0
- package/dist/typed-event-target.d.ts.map +1 -1
- package/dist/typed-event-target.js +29 -2
- package/dist/typed-event-target.js.map +1 -1
- package/dist/types/error.d.ts +134 -8
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/error.js +134 -8
- package/dist/types/error.js.map +1 -1
- package/dist/types/event.d.ts +227 -1
- package/dist/types/event.d.ts.map +1 -1
- package/dist/types/manager.d.ts +99 -0
- package/dist/types/manager.d.ts.map +1 -1
- package/dist/types/manager.js +90 -0
- package/dist/types/manager.js.map +1 -1
- package/dist/types/sampler.d.ts +12 -2
- package/dist/types/sampler.d.ts.map +1 -1
- package/dist/types/tool.d.ts +15 -0
- package/dist/types/tool.d.ts.map +1 -1
- package/dist/utils/response-error.d.ts +10 -0
- package/dist/utils/response-error.d.ts.map +1 -1
- package/dist/utils/response-error.js +15 -1
- package/dist/utils/response-error.js.map +1 -1
- package/dist/workflow.d.ts +4 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +2 -0
- package/dist/workflow.js.map +1 -1
- package/package.json +3 -2
package/dist/tools.js
CHANGED
|
@@ -1,15 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a random integer between the specified minimum and maximum values (inclusive).
|
|
3
|
+
* @param min - The minimum value (inclusive)
|
|
4
|
+
* @param max - The maximum value (inclusive)
|
|
5
|
+
* @returns A random integer between min and max
|
|
6
|
+
*/
|
|
1
7
|
export const randomInt = (min, max) => {
|
|
2
8
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
3
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates a delay promise that resolves after the specified number of milliseconds.
|
|
12
|
+
* @param ms - The number of milliseconds to delay
|
|
13
|
+
* @returns A promise that resolves after ms milliseconds
|
|
14
|
+
*/
|
|
4
15
|
export const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
16
|
+
/**
|
|
17
|
+
* Generates a random seed value for ComfyUI operations.
|
|
18
|
+
* @returns A random integer between 10000000000 and 999999999999
|
|
19
|
+
*/
|
|
5
20
|
export const seed = () => randomInt(10000000000, 999999999999);
|
|
6
21
|
/**
|
|
7
22
|
* Encode a POSIX path to NT path
|
|
8
23
|
* Useful for loading model with Windows's ComfyUI Client
|
|
24
|
+
* @param path - The POSIX path to encode
|
|
25
|
+
* @returns The encoded NT path
|
|
9
26
|
*/
|
|
10
27
|
export const encodeNTPath = (path) => {
|
|
11
28
|
return path.replace(/\//g, "\\");
|
|
12
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Encodes an NT path to a POSIX path.
|
|
32
|
+
* @param path - The NT path to encode
|
|
33
|
+
* @returns The encoded POSIX path
|
|
34
|
+
*/
|
|
13
35
|
export const encodePosixPath = (path) => {
|
|
14
36
|
return path.replace(/\\/g, "/");
|
|
15
37
|
};
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":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AC,KAAK,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,EAAE;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
|
@@ -1,7 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight strongly-typed EventTarget wrapper without exploding union overloads.
|
|
3
|
+
* M is a mapping of event name to CustomEvent<Detail>.
|
|
4
|
+
*/
|
|
1
5
|
export declare class TypedEventTarget<M extends Record<string, CustomEvent<any>>> extends EventTarget {
|
|
6
|
+
/**
|
|
7
|
+
* Adds an event listener for the specified event type.
|
|
8
|
+
* @param type - The event type to listen for
|
|
9
|
+
* @param handler - The event handler function
|
|
10
|
+
* @param options - Event listener options
|
|
11
|
+
* @returns A function to remove the event listener
|
|
12
|
+
*/
|
|
2
13
|
on<K extends keyof M>(type: K, handler: (ev: M[K]) => void, options?: AddEventListenerOptions | boolean): () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Removes an event listener for the specified event type.
|
|
16
|
+
* @param type - The event type to remove the listener for
|
|
17
|
+
* @param handler - The event handler function to remove
|
|
18
|
+
* @param options - Event listener options
|
|
19
|
+
*/
|
|
3
20
|
off<K extends keyof M>(type: K, handler: (ev: M[K]) => void, options?: EventListenerOptions | boolean): void;
|
|
21
|
+
/**
|
|
22
|
+
* Adds an event listener that will only be called once for the specified event type.
|
|
23
|
+
* @param type - The event type to listen for
|
|
24
|
+
* @param handler - The event handler function
|
|
25
|
+
* @param options - Event listener options
|
|
26
|
+
* @returns A function to remove the event listener
|
|
27
|
+
*/
|
|
4
28
|
once<K extends keyof M>(type: K, handler: (ev: M[K]) => void, options?: AddEventListenerOptions | boolean): () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Emits an event of the specified type.
|
|
31
|
+
* @param type - The event type to emit
|
|
32
|
+
* @param event - The event object to emit
|
|
33
|
+
*/
|
|
5
34
|
emit<K extends keyof M>(type: K, event: M[K]): void;
|
|
6
35
|
}
|
|
7
36
|
//# sourceMappingURL=typed-event-target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-event-target.d.ts","sourceRoot":"","sources":["../src/typed-event-target.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typed-event-target.d.ts","sourceRoot":"","sources":["../src/typed-event-target.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAE,SAAQ,WAAW;IAC3F;;;;;;OAMG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO;IAKvG;;;;;OAKG;IACH,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO;IAIrG;;;;;;OAMG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO;IAKzG;;;;OAIG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;CAG7C"}
|
|
@@ -1,17 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight strongly-typed EventTarget wrapper without exploding union overloads.
|
|
3
|
+
* M is a mapping of event name to CustomEvent<Detail>.
|
|
4
|
+
*/
|
|
3
5
|
export class TypedEventTarget extends EventTarget {
|
|
6
|
+
/**
|
|
7
|
+
* Adds an event listener for the specified event type.
|
|
8
|
+
* @param type - The event type to listen for
|
|
9
|
+
* @param handler - The event handler function
|
|
10
|
+
* @param options - Event listener options
|
|
11
|
+
* @returns A function to remove the event listener
|
|
12
|
+
*/
|
|
4
13
|
on(type, handler, options) {
|
|
5
14
|
this.addEventListener(type, handler, options);
|
|
6
15
|
return () => this.off(type, handler, options);
|
|
7
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Removes an event listener for the specified event type.
|
|
19
|
+
* @param type - The event type to remove the listener for
|
|
20
|
+
* @param handler - The event handler function to remove
|
|
21
|
+
* @param options - Event listener options
|
|
22
|
+
*/
|
|
8
23
|
off(type, handler, options) {
|
|
9
24
|
this.removeEventListener(type, handler, options);
|
|
10
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds an event listener that will only be called once for the specified event type.
|
|
28
|
+
* @param type - The event type to listen for
|
|
29
|
+
* @param handler - The event handler function
|
|
30
|
+
* @param options - Event listener options
|
|
31
|
+
* @returns A function to remove the event listener
|
|
32
|
+
*/
|
|
11
33
|
once(type, handler, options) {
|
|
12
34
|
const off = this.on(type, (ev) => { off(); handler(ev); }, { ...(typeof options === 'object' ? options : {}), once: true });
|
|
13
35
|
return off;
|
|
14
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Emits an event of the specified type.
|
|
39
|
+
* @param type - The event type to emit
|
|
40
|
+
* @param event - The event object to emit
|
|
41
|
+
*/
|
|
15
42
|
emit(type, event) {
|
|
16
43
|
this.dispatchEvent(event);
|
|
17
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-event-target.js","sourceRoot":"","sources":["../src/typed-event-target.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"typed-event-target.js","sourceRoot":"","sources":["../src/typed-event-target.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,gBAA6D,SAAQ,WAAW;IAC3F;;;;;;OAMG;IACH,EAAE,CAAoB,IAAO,EAAE,OAA2B,EAAE,OAA2C;QACrG,IAAI,CAAC,gBAAgB,CAAC,IAAc,EAAE,OAAwB,EAAE,OAAO,CAAC,CAAC;QACzE,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAoB,IAAO,EAAE,OAA2B,EAAE,OAAwC;QACnG,IAAI,CAAC,mBAAmB,CAAC,IAAc,EAAE,OAAwB,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CAAoB,IAAO,EAAE,OAA2B,EAAE,OAA2C;QACvG,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAQ,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClI,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAoB,IAAO,EAAE,KAAW;QAC1C,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/types/error.d.ts
CHANGED
|
@@ -1,43 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing error codes for ComfyUI operations
|
|
3
|
+
*/
|
|
1
4
|
export declare enum ErrorCode {
|
|
5
|
+
/**
|
|
6
|
+
* The job went missing
|
|
7
|
+
*/
|
|
2
8
|
WENT_MISSING = "E_WENT_MISSING",
|
|
9
|
+
/**
|
|
10
|
+
* Failed to get cached output
|
|
11
|
+
*/
|
|
3
12
|
FAILED_CACHE = "E_FAILED_CACHE",
|
|
13
|
+
/**
|
|
14
|
+
* Failed to enqueue prompt
|
|
15
|
+
*/
|
|
4
16
|
ENQUEUE_FAILED = "E_ENQUEUE_FAILED",
|
|
17
|
+
/**
|
|
18
|
+
* Disconnected from server
|
|
19
|
+
*/
|
|
5
20
|
DISCONNECTED = "E_DISCONNECTED",
|
|
21
|
+
/**
|
|
22
|
+
* Execution failed
|
|
23
|
+
*/
|
|
6
24
|
EXECUTION_FAILED = "E_EXECUTION_FAILED",
|
|
25
|
+
/**
|
|
26
|
+
* Custom event error
|
|
27
|
+
*/
|
|
7
28
|
CUSTOM_EVENT = "E_CUSTOM_EVENT",
|
|
29
|
+
/**
|
|
30
|
+
* Execution was interrupted
|
|
31
|
+
*/
|
|
8
32
|
EXECUTION_INTERRUPTED = "E_EXECUTION_INTERRUPTED",
|
|
33
|
+
/**
|
|
34
|
+
* Missing node in workflow
|
|
35
|
+
*/
|
|
9
36
|
MISSING_NODE = "E_MISSING_NODE"
|
|
10
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Base error class for ComfyUI call wrapper operations
|
|
40
|
+
*/
|
|
11
41
|
export declare class CallWrapperError extends Error {
|
|
42
|
+
/**
|
|
43
|
+
* The name of the error class
|
|
44
|
+
*/
|
|
12
45
|
name: string;
|
|
13
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Stable machine-readable error code
|
|
48
|
+
*/
|
|
14
49
|
code: ErrorCode | string;
|
|
15
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Error thrown when a job goes missing
|
|
53
|
+
*/
|
|
16
54
|
export declare class WentMissingError extends CallWrapperError {
|
|
55
|
+
/**
|
|
56
|
+
* The name of the error class
|
|
57
|
+
*/
|
|
17
58
|
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* The error code for this error type
|
|
61
|
+
*/
|
|
18
62
|
code: ErrorCode;
|
|
19
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Error thrown when failed to get cached output
|
|
66
|
+
*/
|
|
20
67
|
export declare class FailedCacheError extends CallWrapperError {
|
|
68
|
+
/**
|
|
69
|
+
* The name of the error class
|
|
70
|
+
*/
|
|
21
71
|
name: string;
|
|
72
|
+
/**
|
|
73
|
+
* The error code for this error type
|
|
74
|
+
*/
|
|
22
75
|
code: ErrorCode;
|
|
23
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Error thrown when failed to enqueue a prompt
|
|
79
|
+
*/
|
|
24
80
|
export declare class EnqueueFailedError extends CallWrapperError {
|
|
81
|
+
/**
|
|
82
|
+
* The name of the error class
|
|
83
|
+
*/
|
|
25
84
|
name: string;
|
|
85
|
+
/**
|
|
86
|
+
* The error code for this error type
|
|
87
|
+
*/
|
|
26
88
|
code: ErrorCode;
|
|
27
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* HTTP status code when available
|
|
91
|
+
*/
|
|
28
92
|
status?: number;
|
|
29
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* HTTP status text
|
|
95
|
+
*/
|
|
30
96
|
statusText?: string;
|
|
31
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Request URL (if known)
|
|
99
|
+
*/
|
|
32
100
|
url?: string;
|
|
33
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* HTTP method (if known)
|
|
103
|
+
*/
|
|
34
104
|
method?: string;
|
|
35
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Parsed JSON body (if any)
|
|
107
|
+
*/
|
|
36
108
|
bodyJSON?: any;
|
|
37
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Raw body text snippet (truncated)
|
|
111
|
+
*/
|
|
38
112
|
bodyTextSnippet?: string;
|
|
39
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Extracted concise reason message
|
|
115
|
+
*/
|
|
40
116
|
reason?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new EnqueueFailedError instance
|
|
119
|
+
* @param message - The error message
|
|
120
|
+
* @param init - Initialization options for the error
|
|
121
|
+
*/
|
|
41
122
|
constructor(message: string, init?: {
|
|
42
123
|
cause?: any;
|
|
43
124
|
status?: number;
|
|
@@ -49,24 +130,69 @@ export declare class EnqueueFailedError extends CallWrapperError {
|
|
|
49
130
|
reason?: string;
|
|
50
131
|
});
|
|
51
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Error thrown when disconnected from server
|
|
135
|
+
*/
|
|
52
136
|
export declare class DisconnectedError extends CallWrapperError {
|
|
137
|
+
/**
|
|
138
|
+
* The name of the error class
|
|
139
|
+
*/
|
|
53
140
|
name: string;
|
|
141
|
+
/**
|
|
142
|
+
* The error code for this error type
|
|
143
|
+
*/
|
|
54
144
|
code: ErrorCode;
|
|
55
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Error thrown when execution fails
|
|
148
|
+
*/
|
|
56
149
|
export declare class ExecutionFailedError extends CallWrapperError {
|
|
150
|
+
/**
|
|
151
|
+
* The name of the error class
|
|
152
|
+
*/
|
|
57
153
|
name: string;
|
|
154
|
+
/**
|
|
155
|
+
* The error code for this error type
|
|
156
|
+
*/
|
|
58
157
|
code: ErrorCode;
|
|
59
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Error thrown for custom events
|
|
161
|
+
*/
|
|
60
162
|
export declare class CustomEventError extends CallWrapperError {
|
|
163
|
+
/**
|
|
164
|
+
* The name of the error class
|
|
165
|
+
*/
|
|
61
166
|
name: string;
|
|
167
|
+
/**
|
|
168
|
+
* The error code for this error type
|
|
169
|
+
*/
|
|
62
170
|
code: ErrorCode;
|
|
63
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Error thrown when execution is interrupted
|
|
174
|
+
*/
|
|
64
175
|
export declare class ExecutionInterruptedError extends CallWrapperError {
|
|
176
|
+
/**
|
|
177
|
+
* The name of the error class
|
|
178
|
+
*/
|
|
65
179
|
name: string;
|
|
180
|
+
/**
|
|
181
|
+
* The error code for this error type
|
|
182
|
+
*/
|
|
66
183
|
code: ErrorCode;
|
|
67
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Error thrown when a node is missing from the workflow
|
|
187
|
+
*/
|
|
68
188
|
export declare class MissingNodeError extends CallWrapperError {
|
|
189
|
+
/**
|
|
190
|
+
* The name of the error class
|
|
191
|
+
*/
|
|
69
192
|
name: string;
|
|
193
|
+
/**
|
|
194
|
+
* The error code for this error type
|
|
195
|
+
*/
|
|
70
196
|
code: ErrorCode;
|
|
71
197
|
}
|
|
72
198
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,YAAY,mBAAmB;IAC/B,YAAY,mBAAmB;IAC/B,cAAc,qBAAqB;IACnC,YAAY,mBAAmB;IAC/B,gBAAgB,uBAAuB;IACvC,YAAY,mBAAmB;IAC/B,qBAAqB,4BAA4B;IACjD,YAAY,mBAAmB;CAChC;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,IAAI,SAAsB;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS;IACnB;;OAEG;IACH,YAAY,mBAAmB;IAC/B;;OAEG;IACH,YAAY,mBAAmB;IAC/B;;OAEG;IACH,cAAc,qBAAqB;IACnC;;OAEG;IACH,YAAY,mBAAmB;IAC/B;;OAEG;IACH,gBAAgB,uBAAuB;IACvC;;OAEG;IACH,YAAY,mBAAmB;IAC/B;;OAEG;IACH,qBAAqB,4BAA4B;IACjD;;OAEG;IACH,YAAY,mBAAmB;CAChC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ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SAAuB;IAE3B;;OAEG;IACH,IAAI,YAA0B;CAC/B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD;;OAEG;IACH,IAAI,SAA0B;IAE9B;;OAEG;IACH,IAAI,YAA8B;CACnC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD;;OAEG;IACH,IAAI,SAAsB;IAE1B;;OAEG;IACH,IAAI,YAA0B;CAC/B;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D;;OAEG;IACH,IAAI,SAA+B;IAEnC;;OAEG;IACH,IAAI,YAAmC;CACxC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD;;OAEG;IACH,IAAI,SAAsB;IAE1B;;OAEG;IACH,IAAI,YAA0B;CAC/B"}
|
package/dist/types/error.js
CHANGED
|
@@ -1,44 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing error codes for ComfyUI operations
|
|
3
|
+
*/
|
|
1
4
|
export var ErrorCode;
|
|
2
5
|
(function (ErrorCode) {
|
|
6
|
+
/**
|
|
7
|
+
* The job went missing
|
|
8
|
+
*/
|
|
3
9
|
ErrorCode["WENT_MISSING"] = "E_WENT_MISSING";
|
|
10
|
+
/**
|
|
11
|
+
* Failed to get cached output
|
|
12
|
+
*/
|
|
4
13
|
ErrorCode["FAILED_CACHE"] = "E_FAILED_CACHE";
|
|
14
|
+
/**
|
|
15
|
+
* Failed to enqueue prompt
|
|
16
|
+
*/
|
|
5
17
|
ErrorCode["ENQUEUE_FAILED"] = "E_ENQUEUE_FAILED";
|
|
18
|
+
/**
|
|
19
|
+
* Disconnected from server
|
|
20
|
+
*/
|
|
6
21
|
ErrorCode["DISCONNECTED"] = "E_DISCONNECTED";
|
|
22
|
+
/**
|
|
23
|
+
* Execution failed
|
|
24
|
+
*/
|
|
7
25
|
ErrorCode["EXECUTION_FAILED"] = "E_EXECUTION_FAILED";
|
|
26
|
+
/**
|
|
27
|
+
* Custom event error
|
|
28
|
+
*/
|
|
8
29
|
ErrorCode["CUSTOM_EVENT"] = "E_CUSTOM_EVENT";
|
|
30
|
+
/**
|
|
31
|
+
* Execution was interrupted
|
|
32
|
+
*/
|
|
9
33
|
ErrorCode["EXECUTION_INTERRUPTED"] = "E_EXECUTION_INTERRUPTED";
|
|
34
|
+
/**
|
|
35
|
+
* Missing node in workflow
|
|
36
|
+
*/
|
|
10
37
|
ErrorCode["MISSING_NODE"] = "E_MISSING_NODE";
|
|
11
38
|
})(ErrorCode || (ErrorCode = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Base error class for ComfyUI call wrapper operations
|
|
41
|
+
*/
|
|
12
42
|
export class CallWrapperError extends Error {
|
|
43
|
+
/**
|
|
44
|
+
* The name of the error class
|
|
45
|
+
*/
|
|
13
46
|
name = "CallWrapperError";
|
|
14
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Stable machine-readable error code
|
|
49
|
+
*/
|
|
15
50
|
code = "";
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Error thrown when a job goes missing
|
|
54
|
+
*/
|
|
17
55
|
export class WentMissingError extends CallWrapperError {
|
|
56
|
+
/**
|
|
57
|
+
* The name of the error class
|
|
58
|
+
*/
|
|
18
59
|
name = "WentMissingError";
|
|
60
|
+
/**
|
|
61
|
+
* The error code for this error type
|
|
62
|
+
*/
|
|
19
63
|
code = ErrorCode.WENT_MISSING;
|
|
20
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Error thrown when failed to get cached output
|
|
67
|
+
*/
|
|
21
68
|
export class FailedCacheError extends CallWrapperError {
|
|
69
|
+
/**
|
|
70
|
+
* The name of the error class
|
|
71
|
+
*/
|
|
22
72
|
name = "FailedCacheError";
|
|
73
|
+
/**
|
|
74
|
+
* The error code for this error type
|
|
75
|
+
*/
|
|
23
76
|
code = ErrorCode.FAILED_CACHE;
|
|
24
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Error thrown when failed to enqueue a prompt
|
|
80
|
+
*/
|
|
25
81
|
export class EnqueueFailedError extends CallWrapperError {
|
|
82
|
+
/**
|
|
83
|
+
* The name of the error class
|
|
84
|
+
*/
|
|
26
85
|
name = "EnqueueFailedError";
|
|
86
|
+
/**
|
|
87
|
+
* The error code for this error type
|
|
88
|
+
*/
|
|
27
89
|
code = ErrorCode.ENQUEUE_FAILED;
|
|
28
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* HTTP status code when available
|
|
92
|
+
*/
|
|
29
93
|
status;
|
|
30
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* HTTP status text
|
|
96
|
+
*/
|
|
31
97
|
statusText;
|
|
32
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Request URL (if known)
|
|
100
|
+
*/
|
|
33
101
|
url;
|
|
34
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* HTTP method (if known)
|
|
104
|
+
*/
|
|
35
105
|
method;
|
|
36
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Parsed JSON body (if any)
|
|
108
|
+
*/
|
|
37
109
|
bodyJSON;
|
|
38
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* Raw body text snippet (truncated)
|
|
112
|
+
*/
|
|
39
113
|
bodyTextSnippet;
|
|
40
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Extracted concise reason message
|
|
116
|
+
*/
|
|
41
117
|
reason;
|
|
118
|
+
/**
|
|
119
|
+
* Creates a new EnqueueFailedError instance
|
|
120
|
+
* @param message - The error message
|
|
121
|
+
* @param init - Initialization options for the error
|
|
122
|
+
*/
|
|
42
123
|
constructor(message, init) {
|
|
43
124
|
super(message, init ? { cause: init.cause } : undefined);
|
|
44
125
|
if (init) {
|
|
@@ -52,24 +133,69 @@ export class EnqueueFailedError extends CallWrapperError {
|
|
|
52
133
|
}
|
|
53
134
|
}
|
|
54
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Error thrown when disconnected from server
|
|
138
|
+
*/
|
|
55
139
|
export class DisconnectedError extends CallWrapperError {
|
|
140
|
+
/**
|
|
141
|
+
* The name of the error class
|
|
142
|
+
*/
|
|
56
143
|
name = "DisconnectedError";
|
|
144
|
+
/**
|
|
145
|
+
* The error code for this error type
|
|
146
|
+
*/
|
|
57
147
|
code = ErrorCode.DISCONNECTED;
|
|
58
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Error thrown when execution fails
|
|
151
|
+
*/
|
|
59
152
|
export class ExecutionFailedError extends CallWrapperError {
|
|
153
|
+
/**
|
|
154
|
+
* The name of the error class
|
|
155
|
+
*/
|
|
60
156
|
name = "ExecutionFailedError";
|
|
157
|
+
/**
|
|
158
|
+
* The error code for this error type
|
|
159
|
+
*/
|
|
61
160
|
code = ErrorCode.EXECUTION_FAILED;
|
|
62
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Error thrown for custom events
|
|
164
|
+
*/
|
|
63
165
|
export class CustomEventError extends CallWrapperError {
|
|
166
|
+
/**
|
|
167
|
+
* The name of the error class
|
|
168
|
+
*/
|
|
64
169
|
name = "CustomEventError";
|
|
170
|
+
/**
|
|
171
|
+
* The error code for this error type
|
|
172
|
+
*/
|
|
65
173
|
code = ErrorCode.CUSTOM_EVENT;
|
|
66
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Error thrown when execution is interrupted
|
|
177
|
+
*/
|
|
67
178
|
export class ExecutionInterruptedError extends CallWrapperError {
|
|
179
|
+
/**
|
|
180
|
+
* The name of the error class
|
|
181
|
+
*/
|
|
68
182
|
name = "ExecutionInterruptedError";
|
|
183
|
+
/**
|
|
184
|
+
* The error code for this error type
|
|
185
|
+
*/
|
|
69
186
|
code = ErrorCode.EXECUTION_INTERRUPTED;
|
|
70
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Error thrown when a node is missing from the workflow
|
|
190
|
+
*/
|
|
71
191
|
export class MissingNodeError extends CallWrapperError {
|
|
192
|
+
/**
|
|
193
|
+
* The name of the error class
|
|
194
|
+
*/
|
|
72
195
|
name = "MissingNodeError";
|
|
196
|
+
/**
|
|
197
|
+
* The error code for this error type
|
|
198
|
+
*/
|
|
73
199
|
code = ErrorCode.MISSING_NODE;
|
|
74
200
|
}
|
|
75
201
|
//# sourceMappingURL=error.js.map
|
package/dist/types/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,SAiCX;AAjCD,WAAY,SAAS;IACnB;;OAEG;IACH,4CAA+B,CAAA;IAC/B;;OAEG;IACH,4CAA+B,CAAA;IAC/B;;OAEG;IACH,gDAAmC,CAAA;IACnC;;OAEG;IACH,4CAA+B,CAAA;IAC/B;;OAEG;IACH,oDAAuC,CAAA;IACvC;;OAEG;IACH,4CAA+B,CAAA;IAC/B;;OAEG;IACH,8DAAiD,CAAA;IACjD;;OAEG;IACH,4CAA+B,CAAA;AACjC,CAAC,EAjCW,SAAS,KAAT,SAAS,QAiCpB;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC;;OAEG;IACH,IAAI,GAAG,kBAAkB,CAAC;IAE1B;;OAEG;IACH,IAAI,GAAuB,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IACpD;;OAEG;IACH,IAAI,GAAG,kBAAkB,CAAC;IAE1B;;OAEG;IACH,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IACpD;;OAEG;IACH,IAAI,GAAG,kBAAkB,CAAC;IAE1B;;OAEG;IACH,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC;CAC/B;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