krita-ai-diffusion icon indicating copy to clipboard operation
krita-ai-diffusion copied to clipboard

Display place in ComfyUI queue for processing

Open DVDMAN77 opened this issue 1 year ago • 6 comments

Hi @Acly could be nice to improve the AI Diffusion plugin to display the place in the server processing queue when connected via the remote server option. When several users do requests an AI generated process (generate, fill, expand, etc.) to a single server they have no visibility on and cannot access as a ComfyUI server processing view, they cannot know wheter they're they are the next ones, or 50th in queue. Could be useful at least to know this kind of information for them to wait or cancel. Waiting time would also be helpful but I presume this one might be tricky to provide, depending on processing time from various other requests and hardware capabilities.

Thank you! :-)

DVDMAN77 avatar Sep 02 '24 11:09 DVDMAN77

So far as I can tell this comes down to hitting /api/queue to see the remote queued tasks whenever we get a "status" notification, which usually corresponds to a "queue_remaining" change. Then we can tell how far down the queue our own task is. I'd like to take this one, it seems fun and easy. @Acly Does that seem a viable approach?

FeepingCreature avatar Sep 04 '24 15:09 FeepingCreature

That should work.

Note that:

  • Cancel current will cancel the currently running job even if it's "not yours"
  • Cancel all will cancel ALL jobs (including those of other users)

Sounds like maybe those things should also be changed/fixed to make it actually useful.

I'm rather hesitant regarding comitting work to multi-user Comfy, it's pretty barebones on the server end. And probably quite niche? But no objections if it's not too complex.

Acly avatar Sep 04 '24 18:09 Acly

Thank you both @FeepingCreature & @Acly , your solutions seem pretty good to my ears. 1/ Queue position display for any user on AI plugin in Krita 2/ Modify the "Cancel current" + "Cancel all" buttons behaviors in the Krita AI plugin for them to apply only to the specific user's queued jobs, this would be great indeed THANK YOU for your work, can't wait!! :-)

DVDMAN77 avatar Sep 05 '24 05:09 DVDMAN77

Thank you so much @FeepingCreature ! Can't wait to test it with the next release of the great AI Diffusion plugin :-)

DVDMAN77 avatar Sep 07 '24 06:09 DVDMAN77

Patience, it's not merged yet :) These things take time.

This is just a first proposal. Now we'll see how it fits in the codebase.

FeepingCreature avatar Sep 07 '24 07:09 FeepingCreature

I'm stepping back from working on this for now tbh, sorry. No point in leaving a dangling pr open.

FeepingCreature avatar Jan 22 '25 18:01 FeepingCreature