comfyui-node 1.4.4 → 1.6.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.
Files changed (58) hide show
  1. package/README.md +21 -16
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/call-wrapper.d.ts +141 -124
  4. package/dist/call-wrapper.d.ts.map +1 -1
  5. package/dist/call-wrapper.js +353 -64
  6. package/dist/call-wrapper.js.map +1 -1
  7. package/dist/client.d.ts +290 -290
  8. package/dist/client.d.ts.map +1 -1
  9. package/dist/client.js +78 -19
  10. package/dist/client.js.map +1 -1
  11. package/dist/index.d.ts +3 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/pool/SmartPool.d.ts +144 -0
  16. package/dist/pool/SmartPool.d.ts.map +1 -0
  17. package/dist/pool/SmartPool.js +677 -0
  18. package/dist/pool/SmartPool.js.map +1 -0
  19. package/dist/pool/SmartPoolV2.d.ts +120 -0
  20. package/dist/pool/SmartPoolV2.d.ts.map +1 -0
  21. package/dist/pool/SmartPoolV2.js +587 -0
  22. package/dist/pool/SmartPoolV2.js.map +1 -0
  23. package/dist/pool/WorkflowPool.d.ts +32 -2
  24. package/dist/pool/WorkflowPool.d.ts.map +1 -1
  25. package/dist/pool/WorkflowPool.js +298 -66
  26. package/dist/pool/WorkflowPool.js.map +1 -1
  27. package/dist/pool/client/ClientManager.d.ts +4 -2
  28. package/dist/pool/client/ClientManager.d.ts.map +1 -1
  29. package/dist/pool/client/ClientManager.js +29 -9
  30. package/dist/pool/client/ClientManager.js.map +1 -1
  31. package/dist/pool/index.d.ts +2 -0
  32. package/dist/pool/index.d.ts.map +1 -1
  33. package/dist/pool/index.js +2 -0
  34. package/dist/pool/index.js.map +1 -1
  35. package/dist/pool/queue/QueueAdapter.d.ts +32 -30
  36. package/dist/pool/queue/QueueAdapter.d.ts.map +1 -1
  37. package/dist/pool/queue/adapters/memory.d.ts +22 -20
  38. package/dist/pool/queue/adapters/memory.d.ts.map +1 -1
  39. package/dist/pool/queue/adapters/memory.js +14 -2
  40. package/dist/pool/queue/adapters/memory.js.map +1 -1
  41. package/dist/pool/types/affinity.d.ts +6 -0
  42. package/dist/pool/types/affinity.d.ts.map +1 -0
  43. package/dist/pool/types/affinity.js +2 -0
  44. package/dist/pool/types/affinity.js.map +1 -0
  45. package/dist/pool/types/job.d.ts.map +1 -1
  46. package/dist/pool/utils/failure-analysis.d.ts +14 -0
  47. package/dist/pool/utils/failure-analysis.d.ts.map +1 -0
  48. package/dist/pool/utils/failure-analysis.js +224 -0
  49. package/dist/pool/utils/failure-analysis.js.map +1 -0
  50. package/dist/pool.d.ts +180 -180
  51. package/dist/types/error.d.ts +31 -1
  52. package/dist/types/error.d.ts.map +1 -1
  53. package/dist/types/error.js +30 -0
  54. package/dist/types/error.js.map +1 -1
  55. package/dist/workflow.d.ts.map +1 -1
  56. package/dist/workflow.js +4 -1
  57. package/dist/workflow.js.map +1 -1
  58. package/package.json +4 -3
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 (v1.4.1+)
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 (v1.4.2+)
67
- - **[Hash-Routing Quick Start](./docs/hash-routing-quickstart.sh)** – Running the demos
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 (v1.4.1+)
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 // keeps connections alive
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 workflow blocking
121
- pool.on("client:blocked_workflow", ev => {
122
- console.log(`${ev.detail.clientId} blocked for workflow ${ev.detail.workflowHash.slice(0, 8)}`);
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
- **New in v1.4.2:** 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.
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.4.1
139
+ ## What's New in v1.5.0
135
140
 
136
- - **Idle connection stability** – Automatic health checks keep WebSocket connections alive
137
- - **Increased default timeout** – WebSocket inactivity timeout raised from 10s to 60s
138
- - **Configurable health checks** – `healthCheckIntervalMs` option (default 30s, set to 0 to disable)
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