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

[Feature Request]: Enhance prompt autocomplete for Models/LoRA/etc

Open PaulCoddington opened this issue 2 years ago • 5 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 ?

Proposal to improve optional auto-population of prompts beyond currently implemented support.

Currently implemented support:

  • Selecting a LoRA adds basic "<lora:filename:1>" to prompt.
  • Selecting custom styles adds further information to prompts.

These are helpful, but it is still necessary to keep a notebook of preferred default settings and Trigger tags for numerous models, LoRA, etc.

Suggested improvements:

  • Custom styles expanded to optionally include/apply settings for Sampler, CFG Scale, Clip Skip, Steps, Resolution.

  • Option to automatically load preferred starter prompt and settings from a text file stored alongside the model/LoRA which has the same name in much the same way that a VAE of the same name is loaded, or a PNG of the same name is used as a preview if they exist.

Proposed workflow

If one desires more comprehensive autocompletion for a model/LoRA:

INITIAL PREPARATION

  1. Create a text file of matching name in the Model/Lora folder.

  2. Text file optionally contains default +/-Prompt, basic settings (such as Sampler, CFG Scale, Steps, Resolution, Style).

WORKFLOW

  1. Select models/LoRA as normal.

  2. Selecting a Model will automatically load the specified prompt/settings ONLY IF the prompt is currently empty.

  3. Selecting a LoRA will automatically append specified "<lora:filename:weight>, trigger_word, trigger_word, etc"

Additional information

No response

PaulCoddington avatar Apr 05 '23 23:04 PaulCoddington

You can already put the trigger words (or whatever else) in a matching text file. It's then displayed in the extra networks menu. image

missionfloyd avatar Apr 07 '23 00:04 missionfloyd

Can i ask how you did this?

mkossigit avatar Apr 08 '23 00:04 mkossigit

Make a matching text file, e.g., for Detroit Chloe v2.0.safetensors, you would make Detroit Chloe v2.0.txt.

It's treated as HTML, so you have to replace < with &lt;, > with &gt;, and & with &amp;

missionfloyd avatar Apr 08 '23 23:04 missionfloyd

Make a matching text file, e.g., for Detroit Chloe v2.0.safetensors, you would make Detroit Chloe v2.0.txt.

It's treated as HTML, so you have to replace < with &lt;, > with &gt;, and & with &amp;

Is there documentation for this, or a sample file?

It is not clear from this description whether "treated as HTML" means "plain text but substitute brackets and &" or "document must be valid HTML", or how one would distinguish positive and negative prompts.

Sounds like this might meet one aspect of the suggested enhancement, but more information is required to make it work.

PaulCoddington avatar Apr 10 '23 10:04 PaulCoddington

Sorry to keep you waiting.

"plain text but substitute brackets and &"

This one.

missionfloyd avatar May 07 '23 09:05 missionfloyd