comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
53.42k stars 5.66k forks source link

New API, using polling task ID to obtain accurate progress #4855

Open hmwl opened 1 month ago

hmwl commented 1 month ago

Feature Idea

When we use the Comfyui API, WS cannot accurately return progress, just like the Comfyui page (rgthread-Comfy node)

Existing Solutions

I used a rudimentary level of code to modify and implement similar effects in executors. py and servers. py (it seems that the results are not very accurate, please correct me) add CF progress API.zip After covering, use http://127.0.0.1:8188/api/node_status Can be viewed (continuously polling)

Other

I hope to have direct support in Comfyui, thank you

aileen5150 commented 1 month ago

直接调用 get_history 是否一样,我在使用while True: out = ws.recv() 发现此处会导致死循环,不知道与您所说的WS无法准确返回进度是一个问题 另外一个就是当ws长时间连接后,去执行query 也会无法获取到结果