Comfy-Org / ComfyUI_frontend

Official front-end implementation of ComfyUI
https://www.comfy.org/
GNU General Public License v3.0
627 stars 115 forks source link

[Bug]: Large numbers of queued items cause lagging of the whole interface #1373

Open BrechtCorbeel opened 3 weeks ago

BrechtCorbeel commented 3 weeks ago

Frontend Version

current/any

Expected Behavior

I want to add queues without it affecting generation.

Actual Behavior

when going above 600-800 items in queue the GUI and the generation start lagging, the more you add the slower the Generation process becomes. Items are added more slowly and sometimes a bug that replicates the same prompt 100 or 100's of times is triggered.

In the following every time you see got prompt is a step it is causing lagging and slower generation, where normally it would just be going through the steps it prioritises getting the prompt and slows everything down.

There is no async in this functionality.

Steps to Reproduce

do a lot of items in queue

Debug Logs

/

Browser Logs

` got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt Using pytorch attention in VAE Using pytorch attention in VAE got prompt got prompt got prompt got prompt got prompt Requested to load FluxClipModel_ Loading 1 new model loaded completely 0.0 4777.53759765625 True got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt CLIP: [Inspired by the dynamic compositions of .] got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt Requested to load Flux Loading 1 new model got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt loaded completely 0.0 11350.048889160156 True 0%| | 0/20 [00:00<?, ?it/s]got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt got prompt 5%|▌ | 1/20 [00:16<05:18, 16.76s/it]got prompt got prompt 10%|█ | 2/20 [00:20<02:43, 9.08s/it]got prompt got prompt got prompt got prompt got prompt 15%|█▌ | 3/20 [00:30<02:40, 9.43s/it]got prompt got prompt got prompt got prompt got prompt 20%|██ | 4/20 [00:41<02:43, 10.24s/it]got prompt got prompt 25%|██▌ | 5/20 [00:54<02:46, 11.12s/it]got prompt got prompt got prompt 30%|███ | 6/20 [01:05<02:35, 11.14s/it]got prompt got prompt got prompt 35%|███▌ | 7/20 [01:15<02:18, 10.62s/it]got prompt got prompt got prompt got prompt got prompt 40%|████ | 8/20 [01:24<02:03, 10.33s/it]got prompt got prompt got prompt got prompt got prompt 45%|████▌ | 9/20 [01:34<01:51, 10.17s/it]got prompt got prompt got prompt got prompt got prompt 50%|█████ | 10/20 [01:44<01:39, 9.96s/it]got prompt got prompt got prompt got prompt got prompt 55%|█████▌ | 11/20 [01:54<01:31, 10.13s/it]got prompt got prompt got prompt got prompt got prompt 60%|██████ | 12/20 [02:05<01:21, 10.23s/it]got prompt got prompt got prompt got prompt got prompt 65%|██████▌ | 13/20 [02:15<01:11, 10.27s/it]got prompt got prompt got prompt got prompt got prompt 70%|███████ | 14/20 [02:25<01:00, 10.10s/it]got prompt got prompt got prompt got prompt got prompt 75%|███████▌ | 15/20 [02:35<00:51, 10.23s/it]got prompt got prompt got prompt got prompt got prompt 80%|████████ | 16/20 [02:46<00:40, 10.22s/it]got prompt got prompt got prompt got prompt got prompt 85%|████████▌ | 17/20 [02:56<00:30, 10.28s/it]got prompt got prompt got prompt got prompt got prompt 90%|█████████ | 18/20 [03:06<00:20, 10.28s/it]got prompt got prompt got prompt got prompt got prompt 95%|█████████▌| 19/20 [03:17<00:10, 10.39s/it]got prompt got prompt got prompt got prompt got prompt 100%|██████████| 20/20 [03:27<00:00, 10.40s/it] got prompt got prompt got prompt Requested to load AutoencodingEngine Loading 1 new model got prompt loaded completely 0.0 159.87335777282715 True got prompt got prompt got prompt got prompt got prompt got prompt got prompt

`

Setting JSON

/

What browsers do you use to access the UI ?

No response

Other

No response

yehonatan1202 commented 3 weeks ago

As for "Items are added more slowly" when the queue panel is open (by pressing the "View Queue" button), the prompt pending slows down as the queue grows bigger. This is because when the queue is open, a new HTTP request is being sent to the server to check on current status of the queue, as the queue grows bigger the response size of this request also grows and i think this is what causing the slows down.

BrechtCorbeel commented 3 weeks ago

As for "Items are added more slowly" when the queue panel is open (by pressing the "View Queue" button), the prompt pending slows down as the queue grows bigger. This is because when the queue is open, a new HTTP request is being sent to the server to check on current status of the queue, as the queue grows bigger the response size of this request also grows and i think this is what causing the slows down.

It does not however explain the duplicates of the same prompt over and over, there seems to be a pattern, it's ussually the same or similar files. from my experience there is a weird UTF-8 or something else issue that sometimes causes issues and bugs, but it is not immediately clear what exactly, maybe something hidden in Unicode that interferes with workflows.

the duplicates are annoying, I have queues of 1000s that every so often suddenly do 100s of the same prompt, while ignoring that I asked for multiple of others, I think when the lagging starts that it starts counting a single workflow multiple times instead of adding the new workflows with different settings/prompts.