comfyui-node 1.4.3 → 1.5.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/README.md +21 -16
- package/dist/.tsbuildinfo +1 -1
- package/dist/call-wrapper.d.ts +17 -0
- package/dist/call-wrapper.d.ts.map +1 -1
- package/dist/call-wrapper.js +229 -36
- package/dist/call-wrapper.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +78 -19
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pool/WorkflowPool.d.ts +87 -0
- package/dist/pool/WorkflowPool.d.ts.map +1 -1
- package/dist/pool/WorkflowPool.js +247 -17
- package/dist/pool/WorkflowPool.js.map +1 -1
- package/dist/pool/failover/SmartFailoverStrategy.js +1 -1
- package/dist/pool/failover/SmartFailoverStrategy.js.map +1 -1
- package/dist/pool/index.d.ts +1 -0
- package/dist/pool/index.d.ts.map +1 -1
- package/dist/pool/profiling/JobProfiler.d.ts +130 -0
- package/dist/pool/profiling/JobProfiler.d.ts.map +1 -0
- package/dist/pool/profiling/JobProfiler.js +225 -0
- package/dist/pool/profiling/JobProfiler.js.map +1 -0
- package/dist/pool/types/job.d.ts +3 -0
- package/dist/pool/types/job.d.ts.map +1 -1
- package/dist/pool/utils/failure-analysis.d.ts +14 -0
- package/dist/pool/utils/failure-analysis.d.ts.map +1 -0
- package/dist/pool/utils/failure-analysis.js +224 -0
- package/dist/pool/utils/failure-analysis.js.map +1 -0
- package/dist/types/error.d.ts +31 -1
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/error.js +30 -0
- package/dist/types/error.js.map +1 -1
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +5 -2
- package/dist/workflow.js.map +1 -1
- package/package.json +3 -3
- package/README.OLD.md +0 -1395
package/README.md
CHANGED
|
@@ -61,10 +61,11 @@ for (const img of (result.images?.images || [])) {
|
|
|
61
61
|
|
|
62
62
|
### Multi-Instance Pooling
|
|
63
63
|
|
|
64
|
-
- **[WorkflowPool Documentation](./docs/workflow-pool.md)** – Production-ready pooling with health checks
|
|
64
|
+
- **[WorkflowPool Documentation](./docs/workflow-pool.md)** – Production-ready pooling with health checks, profiling, and timeout protection
|
|
65
65
|
- **[Connection Stability Guide](./docs/websocket-idle-issue.md)** – WebSocket health check implementation details
|
|
66
|
-
- **[Hash-Based Routing Guide](./docs/hash-routing-guide.md)** – Workflow-level failure tracking and intelligent failover
|
|
67
|
-
- **[
|
|
66
|
+
- **[Hash-Based Routing Guide](./docs/hash-routing-guide.md)** – Workflow-level failure tracking and intelligent failover
|
|
67
|
+
- **[Profiling Guide](./docs/profiling.md)** – Automatic per-node performance profiling (v1.5.0+)
|
|
68
|
+
- **[Execution Timeout Guide](./docs/execution-timeout.md)** – Timeout protection for stuck servers and nodes (v1.5.0+)
|
|
68
69
|
|
|
69
70
|
### Advanced Features
|
|
70
71
|
|
|
@@ -99,7 +100,7 @@ const builder = new PromptBuilder(base, ['positive', 'seed'], ['images'])
|
|
|
99
100
|
|
|
100
101
|
See [comparison guide](./docs/workflow-guide.md#choosing-workflow-vs-promptbuilder) for details.
|
|
101
102
|
|
|
102
|
-
### WorkflowPool
|
|
103
|
+
### WorkflowPool
|
|
103
104
|
|
|
104
105
|
Production-ready multi-instance scheduling with automatic health checks and intelligent hash-based routing:
|
|
105
106
|
|
|
@@ -114,29 +115,33 @@ const pool = new WorkflowPool([
|
|
|
114
115
|
cooldownMs: 60_000, // Block workflow for 60s after failure
|
|
115
116
|
maxFailuresBeforeBlock: 1 // Block on first failure
|
|
116
117
|
}),
|
|
117
|
-
healthCheckIntervalMs: 30000
|
|
118
|
+
healthCheckIntervalMs: 30000, // keeps connections alive
|
|
119
|
+
enableProfiling: true, // NEW: enable automatic performance profiling
|
|
120
|
+
executionStartTimeoutMs: 5000 // NEW: 5s timeout for execution to start
|
|
118
121
|
});
|
|
119
122
|
|
|
120
|
-
// Monitor
|
|
121
|
-
pool.on("
|
|
122
|
-
|
|
123
|
+
// Monitor job completion and view profiling stats
|
|
124
|
+
pool.on("job:completed", ev => {
|
|
125
|
+
if (ev.detail.job.profileStats) {
|
|
126
|
+
const { totalDuration, executionTime, summary } = ev.detail.job.profileStats;
|
|
127
|
+
console.log(`Job ${ev.detail.job.jobId} completed in ${totalDuration}ms`);
|
|
128
|
+
console.log(`Slowest nodes:`, summary.slowestNodes);
|
|
129
|
+
}
|
|
123
130
|
});
|
|
124
131
|
|
|
125
|
-
pool.on("job:progress", ev => console.log(ev.detail.jobId, ev.detail.progress));
|
|
126
|
-
|
|
127
132
|
const jobId = await pool.enqueue(workflow, { priority: 10 });
|
|
128
133
|
```
|
|
129
134
|
|
|
130
|
-
|
|
135
|
+
Hash-based routing intelligently handles failures at the workflow level (not client level). When a workflow fails on one client, the pool routes it to others while keeping that client available for different workflows.
|
|
131
136
|
|
|
132
137
|
See [Hash-Based Routing Guide](./docs/hash-routing-guide.md) for details and demos.
|
|
133
138
|
|
|
134
|
-
## What's New in v1.
|
|
139
|
+
## What's New in v1.5.0
|
|
135
140
|
|
|
136
|
-
- **
|
|
137
|
-
- **
|
|
138
|
-
- **
|
|
139
|
-
- **Better DX** – Comprehensive JSDoc comments and exported types for all pool options
|
|
141
|
+
- **WorkflowPool Profiling** – Enable automatic per-node performance tracking with `enableProfiling: true`.
|
|
142
|
+
- **Timeout Protection** – Prevent jobs from hanging with `executionStartTimeoutMs` and `nodeExecutionTimeoutMs`.
|
|
143
|
+
- **Idle connection stability** – Automatic health checks keep WebSocket connections alive.
|
|
144
|
+
- **Better DX** – Comprehensive JSDoc comments and exported types for all pool options.
|
|
140
145
|
|
|
141
146
|
See [CHANGELOG.md](./CHANGELOG.md) for complete release notes.
|
|
142
147
|
|