DiffusionToolkit icon indicating copy to clipboard operation
DiffusionToolkit copied to clipboard

Boolean search

Open RoboFun3919 opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. Often times searching for prompts yields unwanted results, like how a search for "ice" can show you images with "office" or "pill" could result with "pillow". Other times you may want to search on more than one parameter like a search for "happy" or "smile" or "joy". Support for Boolean search would solve these problems and make the search feature far more powerful

Describe the solution you'd like The ability to separate parameters with AND, OR, NOT, and (Parenthesis) to make Boolean searching available. An example of an advanced Boolean search would look like this ( ( 1girl OR *girls ) NOT *boys NOT solo ) OR ( ( blonde hair OR red hair ) NOT ( platinum blonde hair OR orange hair ) ) which should return any results that either: have any amount of girls, but never more than one boy or a single girl by herself have blonde hair or have red hair, but not if that hair is platinum blonde or orange with symbols instead of words, that looks like this: ( ( 1girl ~ *girls ) -*boys -solo ) ~ ( ( blonde hair ~ red hair ) -( platinum blonde hair ~ orange hair ) )

Describe alternatives you've considered Alternatively, symbols like "-" and "~" have been widely adopted as stand-ins for NOT and OR respectively, and the comma "," serves as a AND already. If fully functional Boolean search proves too difficult to implement, a simple "NOT" field would be a good alternative. Something like a second search box where you can type in prompts to filter out. Maybe this field would be toggleable in the settings if it seems like too much clutter

Additional context pretty please

RoboFun3919 avatar Apr 16 '24 01:04 RoboFun3919

The problem is that prompts are already quite complex and can contain the words AND and OR and parentheses.

What I currently do is use commas as OR operators.

The second search box to have a "not contains" prompt seems more plausible.

RupertAvery avatar Apr 20 '24 22:04 RupertAvery

that solution is still 99% as good as full boolean search so I'd say go for it, especially with all the headaches that would come from integrating them with prompts. Also, isn't the comma an AND operator?

RoboFun3919 avatar Apr 21 '24 02:04 RoboFun3919

Ah, yes, you're right :) it's been a while since I've been working on this. Too busy with work!

RupertAvery avatar Apr 21 '24 13:04 RupertAvery