Comfy-Org / Comfy-Org/ComfyUI

Avoid using time.sleep() and do network request async and/or another thread

Open
#8,673 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 10h
Merged PRs (30d)
153

Description

Frequently, the comfyUI becomes unresponsive. I take an action in the UI but it might take a minute till comfyUI acts. One of the reasons why comfyUI can be unresponsive is the one-threaded nature of Python coupled with avoiding async and using functions like time.sleep().

If one function calls `time.sleep(OneSecond)` that means that the UI gets frozen for one second. time.sleep() blocks the thread so that if the UI makes another call, that call is not answered until the first function is finished. UI lag creates a bad user experience, so this should be avoided by making the process async.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.