stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Add Clear Prompt button to roll_col

Open papuSpartan opened this issue 2 years ago • 14 comments

Addresses #1692

Currently, my idea is to have the button appear by default if the user is on a device which is not using a traditional mouse. This would be done using css media feature tests and checking for certain user agents. I also want to make it so that the user has to press the button twice within a certain time frame. This would hopefully prevent too many mishaps caused by mis-clicks.

image

I do realize that this is less useful on traditional desktop setups but on many atypical setups such as using the web-ui through a VR HMD where you are using a limited pointer or pseudo-mouse, it would make an incredible difference.

image

Let me know what everyone thinks

papuSpartan avatar Oct 20 '22 00:10 papuSpartan

I really want a clear prompt button, but the place I need it the most is on my phone. Its awkward to try to clear out a long prompt on mobile. Because of this I don't want the button to go away on non-mouse devices.

MrKuenning avatar Oct 20 '22 03:10 MrKuenning

I really want a clear prompt button, but the place I need it the most is on my phone. Its awkward to try to clear out a long prompt on mobile. Because of this I don't want the button to go away on non-mouse devices.

Maybe I emphasized too much on "VR HMD's" but what I was saying is that it will visible by default if the user does not have a traditional mouse. Even then, I think I'm going to put a toggle in the settings to allow users to be able force it on if they so choose.

papuSpartan avatar Oct 20 '22 04:10 papuSpartan

"I SNEEEED IT!!!!"

Cybear227 avatar Oct 20 '22 06:10 Cybear227

This seems to be a duplicate of #2728. But since #2728's author is missing, can you add confirmation dialogue in this PR?

CookieHCl avatar Oct 20 '22 19:10 CookieHCl

This seems to be a duplicate of #2728. But since #2728's author is missing, can you add confirmation dialogue in this PR?

Yea sorry, I actually noticed my mistake last night after pushing 8931a82. But yea that's what I'm planning on doing.

papuSpartan avatar Oct 20 '22 21:10 papuSpartan

Demo: https://youtu.be/5Z6sYdkURPc

papuSpartan avatar Oct 26 '22 22:10 papuSpartan

I am excited for this to get added. How did you get the hypernetworks at the top in your demo?

MrKuenning avatar Oct 27 '22 06:10 MrKuenning

I am excited for this to get added. How did you get the hypernetworks at the top in your demo?

In the 'User Interface' section of the settings pane add sd_hypernetwork to the comma separated list of ids. image

Keep in mind you will also need to either fully restart the UI or restart the whole program for this to take effect.

papuSpartan avatar Oct 27 '22 18:10 papuSpartan

can this be done just clientside with javascript?

AUTOMATIC1111 avatar Oct 29 '22 06:10 AUTOMATIC1111

can this be done just clientside with javascript?

That's actually how I went to initially implement this but I realized because the prompts are not being cleared on the back-end as well it would not function as expected. I would clear the prompt then go to save a style and it would create a style containing what I just had deleted. The other issue was that the token counter would not be synchronized without binding another event to it or without overwriting the token counter.

papuSpartan avatar Oct 29 '22 07:10 papuSpartan

@AUTOMATIC1111 Are you saying it needs to be done purely in javascript to be merged?

papuSpartan avatar Oct 30 '22 06:10 papuSpartan

There are few parts of code in the project that edit gradio inputs clientside, and to make changes visible server-side, this seems to be enough:

textarea.dispatchEvent(new Event("input", { bubbles: true }))

AUTOMATIC1111 avatar Nov 01 '22 15:11 AUTOMATIC1111

Ok cool, forgot about that functionality. Will revert to js.

papuSpartan avatar Nov 01 '22 17:11 papuSpartan

Should be ready again @AUTOMATIC1111

papuSpartan avatar Nov 01 '22 19:11 papuSpartan