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

Prompt weights as interactive buttons (with example)

Open esbe1175 opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

Managing weights in a prompt becomes tedious with clicking in and out and selecting text to edit, i propose a more visual button-focused feature to better suit an iterative process that feels more UX minded.

At this current moment in time, the easiest way to work with weights is using the (prompt:weight) tag combo and then whenever you want to change it you have to go find it and then select -> remove -> replace,

Instead a feature that converts tags/text wrapped in parentheses into buttons, or alternatively by simply marking the text and pressing a keyboard shortcut, with an embedded weight number.

So, a prompt that would look like this: visual weight buttons Before Would instead look like this: visual weight buttons After

The right side of the button that is inset where the number is would be single-click selectable so you can mark the whole number and type it that way if you like, while the left side of the button would be a clickable button where if you:

  • Left click the button it will increase the weight by 0.1 (or any number set in configuration)
  • Shift + Left click the button it will decrease the weight by 0.1 (or any number set in the configuration)
  • Right click or alternatively CTRL + Left Click it will select the tag/text

Some people may not like the function as theyre used to dealing with the way it's always been and as such i think it should be a toggleable feature.

I don't know if its possible but using the scroll-wheel to modify weight value by mouse-overing and scrolling would also be a very user-friendly process.

Proposed workflow

Creating a button weight (method one)

  1. Write your prompt
  2. decide a specific part of it should be weighted
  3. mark/select that specific part of the prompt
  4. hit a key combo
  5. Button weight is created

Creating a button weight (method two)

  1. Write your prompt
  2. decide a specific part of it should be weighted
  3. wrap that specific part in parentheses
  4. Button weight is created

Increasing the value of the button weight

  • Left Click the left side to increase the weight by X (Configurable, default 0.1)
  • Click the right side to select the weight number and enter a higher value

Decreasing the value of the button weight

  • Shift + Left Click the left side to decrease the weight by X (Configurable, default 0.1)
  • click the right side to selct the weight number and enter a lower value

Deleting a button weight

  • Place your cursor on the space to the right of the button weight
  • hit backspace, and the button weight gets converted to the text "hidden" behind it

Additional information

It must be considered that people are used to being able to select their prompt in the box and copy it to paste it somewhere else. As such, either a click-to-copy button in perhaps the bottom-right corner of the prompt inputs, or a way of making a ctrl+c input copy not the selected UI text but the prompt underneath would have to be devised.

The automatic parentheses-triggered conversion is prone to accidental conversions so it may be better to have it tied to a keybind, would need testing.

esbe1175 avatar Nov 03 '22 16:11 esbe1175

If you're not aware, pressing Ctrl+Up/Down when the text cursor is inside an already numerically weighted tag will increase/decrease the value in increments of 0.1.

I know it's not nearly as elaborate as what you're proposing but maybe you'll find it useful.

Also, you should give your request a title!

baloneysammich avatar Nov 04 '22 00:11 baloneysammich

If you're not aware, pressing Ctrl+Up/Down when the text cursor is inside an already numerically weighted tag will increase/decrease the value in increments of 0.1.

I know it's not nearly as elaborate as what you're proposing but maybe you'll find it useful.

Also, you should give your request a title!

ahh thats hugely useful! thanks a lot 👍 Knew i missed something 🤦

esbe1175 avatar Nov 04 '22 01:11 esbe1175

Would it be possible to have it such that if it isn't yet numerically weighted, to automatically add parenthesis and a weight? I find myself manually adding a lot of parenthesis and weights when trying to fine tune and debug loras.

uwidev avatar Apr 17 '23 19:04 uwidev

Would it be possible to have it such that if it isn't yet numerically weighted, to automatically add parenthesis and a weight? I find myself manually adding a lot of parenthesis and weights when trying to fine tune and debug loras.

You can mark that keyword and ctrl+up or down.

ukn47k avatar May 02 '23 01:05 ukn47k