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
58.7k stars 6.23k forks source link

Queue rearrange API #684

Open space-nuko opened 1 year ago

space-nuko commented 1 year ago

It would be cool to have an API so that you could drag around items on the queue and the order would be updated on the backend, in addition to the deletion API already available

comfyanonymous commented 1 year ago

You can insert items in any position in the queue using the optional 'number' property that you can put in the json you send in the /queue post request.

The queue in the backend is a priority queue sorted by that number.

space-nuko commented 1 year ago

Could you decide to change the priority after the prompt is sent though

comfyanonymous commented 1 year ago

Yeah I could add an endpoint where you post the prompt id with a new number.

space-nuko commented 1 year ago

Preferably in such a way you could insert an existing prompt between two other prompts like number 6 and 7, so that there's no overlap for the numbers, thanks

comfyanonymous commented 1 year ago

the numbers are treated as floats so to insert a prompt between 6 and 7 you just have to use 6.5 or whatever number in between.

n0valis commented 2 weeks ago

You can insert items in any position in the queue using the optional 'number' property that you can put in the json you send in the /queue post request.

The queue in the backend is a priority queue sorted by that number.

Can you show me the documentation for that please. I woluld like do that, but from your statement that is impossible. req = request.Request("http://127.0.0.1:8188/prompt", data=data) Thanks.