comfyui-node 1.4.2 → 1.4.3
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 +16 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/call-wrapper.d.ts +124 -124
- package/dist/call-wrapper.js +567 -567
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/pool/WorkflowPool.d.ts.map +1 -1
- package/dist/pool/WorkflowPool.js +463 -455
- package/dist/pool/WorkflowPool.js.map +1 -1
- package/dist/pool/client/ClientManager.d.ts +15 -1
- package/dist/pool/client/ClientManager.d.ts.map +1 -1
- package/dist/pool/client/ClientManager.js +35 -6
- package/dist/pool/client/ClientManager.js.map +1 -1
- package/dist/pool/utils/hash.d.ts +13 -1
- package/dist/pool/utils/hash.d.ts.map +1 -1
- package/dist/pool/utils/hash.js +14 -1
- package/dist/pool/utils/hash.js.map +1 -1
- package/dist/workflow.d.ts +27 -4
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +29 -6
- package/dist/workflow.js.map +1 -1
- package/package.json +2 -2
package/LICENSE
CHANGED
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -63,6 +63,8 @@ for (const img of (result.images?.images || [])) {
|
|
|
63
63
|
|
|
64
64
|
- **[WorkflowPool Documentation](./docs/workflow-pool.md)** – Production-ready pooling with health checks (v1.4.1+)
|
|
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
68
|
|
|
67
69
|
### Advanced Features
|
|
68
70
|
|
|
@@ -99,24 +101,35 @@ See [comparison guide](./docs/workflow-guide.md#choosing-workflow-vs-promptbuild
|
|
|
99
101
|
|
|
100
102
|
### WorkflowPool (v1.4.1+)
|
|
101
103
|
|
|
102
|
-
Production-ready multi-instance scheduling with automatic health checks:
|
|
104
|
+
Production-ready multi-instance scheduling with automatic health checks and intelligent hash-based routing:
|
|
103
105
|
|
|
104
106
|
```ts
|
|
105
|
-
import { WorkflowPool, MemoryQueueAdapter } from "comfyui-node";
|
|
107
|
+
import { WorkflowPool, MemoryQueueAdapter, SmartFailoverStrategy } from "comfyui-node";
|
|
106
108
|
|
|
107
109
|
const pool = new WorkflowPool([
|
|
108
110
|
new ComfyApi("http://localhost:8188"),
|
|
109
111
|
new ComfyApi("http://localhost:8189")
|
|
110
112
|
], {
|
|
113
|
+
failoverStrategy: new SmartFailoverStrategy({
|
|
114
|
+
cooldownMs: 60_000, // Block workflow for 60s after failure
|
|
115
|
+
maxFailuresBeforeBlock: 1 // Block on first failure
|
|
116
|
+
}),
|
|
111
117
|
healthCheckIntervalMs: 30000 // keeps connections alive
|
|
112
118
|
});
|
|
113
119
|
|
|
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
|
+
});
|
|
124
|
+
|
|
114
125
|
pool.on("job:progress", ev => console.log(ev.detail.jobId, ev.detail.progress));
|
|
115
126
|
|
|
116
127
|
const jobId = await pool.enqueue(workflow, { priority: 10 });
|
|
117
128
|
```
|
|
118
129
|
|
|
119
|
-
**New in v1.4.
|
|
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.
|
|
131
|
+
|
|
132
|
+
See [Hash-Based Routing Guide](./docs/hash-routing-guide.md) for details and demos.
|
|
120
133
|
|
|
121
134
|
## What's New in v1.4.1
|
|
122
135
|
|