picobyte / stable-diffusion-webui-wd14-tagger

Labeling extension for Automatic1111's Web UI
539 stars 64 forks source link

More api tweaks async #64

Closed picobyte closed 9 months ago

picobyte commented 9 months ago

This should only affect the interrogation via the api, and is intended to be backwards compatible, though that needs to be checked, Amended from last commit message:

The api receives two extra parameters, both empty strings by default queue: the name for a queue, which could be e.g. the person or subject name name_in_queue: the name for that particular image that is being queued, e.g. a file name.

If queue is empty, there is a single interrogation with response, which should be backwards compatible.

If not empty, if name_in_queue is given, the interrogation is queued under that name. If already in queue, that name is changed - clobbered - with #. An exception is if the given name is <sha256> in which case an image checksum will be used instead of a name. (actually there's something missing here in the code if a duplicate, I now realize..)

NB: The response for queueing an image is something different entirely: the number of all processed for all active queues & all models; progress so far.

If name_in_queue is empty, that particular queue is marked as finished, A response is awaited for remaining interrogations in this queue (if any are there still). The response is only for this queue. Other queues should still be reachable in the mean time,

At least that's how it's supposed to work. See checklist below. If you want this to work too, testing is appreciated, please mention if something does or does not work as intended.

54 and #23 show how you can use curl to test the working - I see defaults are not working as intended yet.

I may add some test cases below.

Also comments or missing from checklist.

Checklist