mix1009 / model-keyword

Automatic1111 WEBUI extension to autofill keyword for custom stable diffusion models and LORA models.
MIT License
248 stars 13 forks source link

Can't handle more than two keywords #14

Closed alfonslm closed 1 year ago

alfonslm commented 1 year ago

The current interface can't handle more than two keywords and ie. SynthPunk V.3 (https://civitai.com/models/2856/synthpunk-search) uses 3 keywords. I would probably solve it by using checkboxes and ordering them from an input number next to them or by having a drag and drop list with keywords at the start, end and inactive.

mix1009 commented 1 year ago

Extension only runs when you generate an image, or interact with the extension UI. I don't think it's possible to update the UI according to the current selected model. I could add 'keyword3', 'keyword4' ... etc. would it help?

alfonslm commented 1 year ago

Could you do something like foreach(keyword){print "keywordname" + selectionboxN} and add an update button that you press when you change diffusion model since using a hardcoded list will probably always have the wrong number of options in this case.

mix1009 commented 1 year ago

I'll check if it's possible to change the dropdown list when a button is pressed. But if user doesn't press the button it will not update and will confuse users more IMO.

You can see the keyword list by clicking "Check" button in 'Add Custom Mappings' section. I think adding 'keyword3', 'keyword4', 'keyword5' is the second best way to solve the problem. If there is no keywordX, it will default to keyword1.

alfonslm commented 1 year ago

If there is a button that says "Update keywords for new model" at the top it is hopefully good enough for most

mix1009 commented 1 year ago

Refresh button for Multiple keywords has been implemented :)

스크린샷 2023-01-17 오후 11 06 42

Button placement is a bit off. It's not easy to control using gradio components.

Thank you for the request.

alfonslm commented 1 year ago

So, this is only relevant since you got it working but what do you feel about adding a persistent list probably mostly for "Textual Inversion"

mix1009 commented 1 year ago

Interesting! Should it be included in this extension? Or maybe a new extension?

alfonslm commented 1 year ago

Not sure if it would be beneficial to have a second extension with some code removed with more or less the same usage. You don't need to use get_old_model_hash or do all of the elif since only the multiple_keywords condition is relevant for the keywords, at least sort of. It might be easier to try and optimize the code for the keywords also since they don't need any extra steps.

I guess that default settings per model could be the next step since some got keywords that is optional eg Arts and Eros list (ELDEN RING STYLE, MODELSHOOT STYLE, DREAMLIKEART, POSTAPOCALYPSE, ANALOG STYLEK, NOLLINGCASE, SWPUNK, SYNTHWAVE, CYBORGDIFFUSION)

mix1009 commented 1 year ago

If I add "textual inversion" dropdown separately to this extension, how should I order the keywords?

model_keyword ti_keyword or ti_keyword model_keyword

Should that be an option?

alfonslm commented 1 year ago

I guess ti_keyword makes more sense first if model_keyword will get a default setting. Otherwise it probably don't mater all that much

alfonslm commented 1 year ago

Right, model and textural inversion keyword should probably have a switch for what order it would be added. Model, Textural Inversion or Textural Inversion, Model

mix1009 commented 1 year ago

Textual Inversion is now implemented!