koishijs / novelai-bot

Generate images by NovelAI | 基于 NovelAI 的画图机器人
https://bot.novelai.dev
MIT License
2.48k stars 204 forks source link

Bug: not allowed to use "AND" operator in sd-webui mode #95

Open MaikoTan opened 1 year ago

MaikoTan commented 1 year ago

sd-webui supports "AND" (upper case) to activate Composable-Diffusion, but currently the bot would convert all input into lower cases, which causes incompatible from sd-webui.

A possible workaround is to ignore the only upper case word "AND" to make it work.

sd-webui支持 "AND"(大写)来激活Composable-Diffusion,但目前机器人会将所有的输入转换成小写,这导致与sd-webui不兼容。

一个可能的解决方法是忽略唯一的大写字母单词 "AND "来使其工作。

shigma commented 1 year ago

To be honest I don't actually think this is a well-designed syntax, at least for chatbots. The use of upper-cased words as special syntax does not draw attention to the difference and will definately lose its semantics in the process of copying and dissemination. Although I can support this feature, I have some concerns that people will misuse it.

Still, can someone explain the difference between AND, | and commas? (on the docs)

MaikoTan commented 1 year ago

Oh, you remind me that the | in NAI seems be equal with AND in sd-webui.

(And | in sd-webui was used for prompt matrix...)

噢,你提醒了我 | 在 NAI 里等价于 sd-webui 中的 AND

(然后 sd-webui 中的 | 用作提示符矩阵……)

MaikoTan commented 1 year ago

references 参考

MaikoTan commented 1 year ago

So a possible way is that we accept | in the prompt. If the backend is sd-webui, we just replace it as AND (note spaces) before sending the payload. Also we need to update the document for explaining the differences between our plugin and sd-webui or others.

As for prompt matrix feature, as it only effects when you pass the payload with an explicit script name "prompt matrix". And currently we weren't even able to parse the prompt at all. I don't think we should implement this.

So what do you think? Is it worth doing this for now?

Best regard. Maiko Sinkyaet Tan