Physton / sd-webui-prompt-all-in-one

This is an extension based on sd-webui, aimed at improving the user experience of the prompt/negative prompt input box. It has a more intuitive and powerful input interface function, and provides automatic translation, history record, and bookmarking functions. 这是一个基于 sd-webui 的扩展,旨在提高提示词/反向提示词输入框的使用体验。它拥有更直观、强大的输入界面功能,它提供了自动翻译、历史记录和收藏等功能。
https://aiodoc.physton.com
MIT License
2.84k stars 252 forks source link

[Feature] Real-time synchronization between WEBUI input box and plugin #189

Closed kimproductions closed 1 year ago

kimproductions commented 1 year ago

Is this feature related to existing issues?

No response

What feature do you want or what suggestions do you have?

Hello, your extension is wonderful and has saved me so much time and effort! The only thing I would recommend is to have a setting that updates that updates the bottom prompt/tag area right when the top original prompt area changes. Like when copying and pasting prompts or sending to imgtoimg or other things. You could use some sort of debouncing to make sure the tag doesn't update too frequently. Like 1 second after the user has not typed in any more or the prompt has not changed, then update the tags.

Thanks!

Are there any similar competitors that can be referenced?

No response

Additional information

No response

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: [Feature]

Physton commented 1 year ago

Currently, when the original input box changes, you need to manually click anywhere on the plugin panel to update it. Are you aware of this?

Physton commented 1 year ago

Initially, it was set to update automatically, but it could cause some unexpected bugs. I can't remember the specific bugs at the moment.

kimproductions commented 1 year ago

Yes I am aware to click the empty area to update it. Perhaps you can do some sort of time delay like 1000 milliseconds after change? I don't know maybe I'll take a look at the code as well later when I have time. But thanks again for the plugin. You've done great work. It's very convenient to change the weight for each tag.

Physton commented 1 year ago

I will test real-time synchronization again when I have time. If there are no bugs, we can consider switching to real-time synchronization.

kimproductions commented 1 year ago

Thanks! Let me know if I can help in any way

Physton commented 1 year ago

It's nothing.

Physton commented 1 year ago

Version bade234 has implemented this feature. Please give it a try!

kimproductions commented 1 year ago

thanks! I gave it a try and it's much better. Although the best version of this would be to remove the line 783 if (document.activeElement === this.textarea) return since that would work better with real time updates without clicking anywhere. But adding this change makes the program remove commas every time the setInterval function runs, making it not possible to create tags. Seems to be due to some other logic possibly in splitTags.js. Pressing enter seems to still work and create the tags. I think the most ideal behavior would be to separate the tags based on commas while still updating frequently. I would try to implement this but unfortunately I'm more of a React dev, not Vue. Anyways, still the new change is much better!

Physton commented 1 year ago

It is not advisable to separate keywords based solely on the detection of commas, as there are special cases with keywords like the following:

[night light:magical forest: 5, 15] (fire extinguisher: 1.0, 2.0) [lion:bird:girl: , 7, 10] EasyNegative (normal quality,Low quality,worst quality:1.4) lora:clothesTransparent_v20:1:1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0 ...

Currently, the best approach, in my opinion, is to perform word segmentation using a tokenization algorithm after the user finishes inputting and the focus leaves the input box.

kimproductions commented 1 year ago

Ah I see. I didn't know it was possible to prompt like that. In that case the new change should be sufficient, thanks

Physton commented 1 year ago

Thanks for your feedback.