StableCanvas / comfyui-client

all ComfyUI http/ws APIs. support NodeJS / Browser environments. and advanced programmable workflow.
https://stablecanvas.github.io/comfyui-client/
MIT License
60 stars 10 forks source link

Enqueue is unable to provide progress updates #6

Closed Ucodia closed 2 months ago

Ucodia commented 2 months ago

Describe the bug Enqueue is unable to provide progress updates. The response shape of the WebSocket "progress" event is incorrectly defined for latest version of ComfyUI (v2362).

To Reproduce Trigger a workflow using the REST API and enqueue function with a progress event

const output = await client.enqueue(workflow, {
  progress: (p) => console.log(p),
});

Expected behavior Progress should be reported in the console.

Actual behavior Should report progress in the console. Error in the console coming from the library:

TypeError: Cannot read properties of undefined (reading 'prompt_id')
    at a2.<anonymous> (@stable-canvas_comfyui-client.js?v=eec9a95c:513:19)
    at a2.emit (@stable-canvas_comfyui-client.js?v=eec9a95c:56:24)
    at WebSocket.<anonymous> (@stable-canvas_comfyui-client.js?v=eec9a95c:201:25)

Desktop (please complete the following information):

Additional context The response shape does not have a progress top level object, the actual shape is as follows:

{
    "value": 4,
    "max": 4,
    "prompt_id": "f167addd-46ad-4e6e-b80f-982dafe8705c",
    "node": "36"
}