DrCyanide / cyanic-sd-krita

A Stable Diffusion plugin for Krita, compatible with A1111 and SD.Next
68 stars 4 forks source link

implemented interrogate widget #29

Closed tectin0 closed 8 months ago

tectin0 commented 9 months ago

I did the bare minimum to add an interrogate button for my own use

copy&pasted your generate.py and changed things to make the interrogate work

didn't go through the entire code and there might be left over stuff that I didn't understand

if you want you can clean it up and add it to your repository

DrCyanide commented 9 months ago

Thanks for contributing! In general this looks pretty good.

The biggest drawback I see is that it hardcodes deepdanbooru as the interrogation method, without checking if the user even has that extension installed. /sdapi/v1/options has several keys for deepbooru that show up if it is installed, so checking SDAPI's default_settings.keys() for something like deepbooru_sort_alpha sould solve that.

Another improvement I'd like to see is moving the Interrogation to it's own page. This would give the space for both a DeepDanBooru and a Clip interrogation button, without cramping the Img2Img page. If the PromptWidget is created with the 'img2img' mode in the constructor it'll still save the interrogated prompt to the Img2Img page. The new page can be added to the dropdown list by adding it in cyanic.py (just below Inpaint looks like a good spot for it).

If you can make these changes first then I'll happily pull it. If you can't, I'll pull it when I have time to make them myself.

tectin0 commented 9 months ago

Sure I wasn't even aware that deepdanbooru doesn't come by default I can implement some checks for that no problem

Having the interrogation on a separate page could definitely be useful to have additional control

Though my workflow quite often is:

..having the button on another page would (for me personally) make it quite less convenient

but it should be no problem to add that as an option to simplify ui, right?

I'll probably look into it this week still