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

[Feature Request]: Color coded Text in Prompt Field

Open ArmyOfPun1776 opened this issue 11 months ago • 4 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 ?

This feature would allow the user to set parameters for color coding text within the Prompt Field based on certain inputs.

e.g.:

  • lora:'x':'x' color=blue
  • ('xxxx':1.0) color=green
  • 'key word' color=red
  • 'embedding' color=yellow
  • etc.

Proposed workflow

  1. Go to Settings
  2. Select 'Color Codes' Tab under UI settings
  3. Set parameters based on the users preference.

Additional information

I've looked around and can't find an extension that does this. I am currently looking into how this would be done via an extension, as I'm sure it's possible.

Just thought that I'd suggest it here incase it's something y'all would be interested in implementing.

ArmyOfPun1776 avatar Feb 29 '24 01:02 ArmyOfPun1776

Great idea! I often 'lose' where I put Lora's etc. Also how about making things in brackets >1.0 red gradient, <1.0 green gradient would be good?

bobba84 avatar Mar 01 '24 00:03 bobba84

Great idea! I often 'lose' where I put Lora's etc. Also how about making things in brackets >1.0 red gradient, <1.0 green gradient would be good?

Yeah that's the whole idea my friend! LoRas, brackets, key words, etc. Anything that can get "lost in the sauce" as it were.

I lose things in my prompts all the time. Especially when they get to be above 50 or so tokens. I'm actually surprised that something like this doesn't exist already. As a feature or as an extension. I'd code it myself, but I'm and uber noob and wouldn't even know where to begin.

ArmyOfPun1776 avatar Mar 01 '24 03:03 ArmyOfPun1776

You might want to try this extension: https://github.com/Physton/sd-webui-prompt-all-in-one.git

howtecher avatar Mar 02 '24 14:03 howtecher

You might want to try this extension: https://github.com/Physton/sd-webui-prompt-all-in-one.git

How have I not found this... Thanks I'll give it a look see.

Edit:

So I've taken a look at this and used it for the past couple of hours. It's a cool extension. However, while it is cool, it is cumbersome as far as the UI is concerned. And some of the overlays get in the way. It also doesn't do what I'm specifically looking for as far as the color coding is concerned.

I appreciate you bringing it to my attention though. I'm gonna sift through the code and see how everything works. Might be able to find some cool ideas for when I finally am ready to start building my extension.

Thanks again friend.

ArmyOfPun1776 avatar Mar 02 '24 15:03 ArmyOfPun1776

After doing so pretty lengthy research on this, it seems to be a limitation issue with Gradio. It just doesn't allow for this type of color customization. As far as I can tell I would need to create an entirely new .css to get this working correctly. And even then it wouldn't function exactly how I'd want it to.

I'm going to continue to work on some ideas that will make the tracking of prompts easier. But their are certain hurdles associated with this that I'm having trouble getting around. Such as real time weight manipulation inside a saved group.

i.e.:

  • Prompt Group = 8k, High_Res, Best_Quality, etc... would be written to the Prompt box as a group under a tag like 'Quality' (The issue is not creating this group, obviously. The issue is how do you add weights to specific parts of the group without having to either rewrite the group or edit a text file. That would completely negate the point of having the group in the first place.)

Maybe by having the ability to expand, edit, save, and then contract the group within a secondary interface that is integrated into the UI.... But that just seems like it would be way too cumbersome and is actually somewhat similar to the suggested extension above.

I just started getting into this whole programming thing, and maybe my eyes are too big. But here to trying.

ArmyOfPun1776 avatar Mar 08 '24 01:03 ArmyOfPun1776

I tried to do something similar by placing formatted text over a prompt area https://github.com/bandifiu/sd-webui-prompt-style.git

prompts

bandifiu avatar May 25 '24 17:05 bandifiu