mirror of
https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator.git
synced 2024-01-11 09:00:44 +01:00
Compare commits
4 Commits
8b5c9f0f7e
...
57d621a781
| Author | SHA1 | Date | |
|---|---|---|---|
| 57d621a781 | |||
| ec7f2078b0 | |||
| 17d66b77be | |||
| c3e6565e61 |
@@ -1,2 +1 @@
|
||||
/javascript
|
||||
/style.css
|
||||
@@ -15,9 +15,11 @@ Adds a tab to the webui that allows the user to generate a prompt from a small b
|
||||
1. Write in the prompt in the *Start of the prompt* text box
|
||||
2. Click Generate and wait
|
||||
|
||||
The initial use of the model may take longer as it needs to be downloaded to your machine for offline use. The model will be used on your device and will be stored in the default location of `*username*/.cache/huggingface/hub/models`. The entire process of generating results will be done on your local machine and not require internet access.
|
||||
|
||||
## Parameters Explanation
|
||||
|
||||
- **Start of the prompt**: As the name, the start of the prompt that the generator should start with
|
||||
- **Start of the prompt**: As the name suggests, the start of the prompt that the generator should start with
|
||||
- **Temperature**: A higher temperature will produce more diverse results, but with a higher risk of less coherent text
|
||||
- **Top K**: Strategy is to sample from a shortlist of the top K tokens. This approach allows the other high-scoring tokens a chance of being picked.
|
||||
- **Max Length**: the maximum number of tokens for the output of the model
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
//Basically copied this from AUTOMATIC1111 implementation of the main UI
|
||||
|
||||
titles = {
|
||||
"Temperature": "A higher temperature will produce more diverse results, but with a higher risk of less coherent text",
|
||||
"Max Length": "The maximum number of tokens for the output of the model",
|
||||
"Top K": "Strategy is to sample from a shortlist of the top K tokens. This approach allows the other high-scoring tokens a chance of being picked.",
|
||||
"Repetition Penalty": "The parameter for repetition penalty. 1.0 means no penalty. Default setting is 1.2. Paper explaining it is linked to Github's readme",
|
||||
"How Many To Generate":"The number of results to generate. Not guaranteed if models fails to create them",
|
||||
"Generate Using Magic Prompt":"Be aware that sometimes the model fails to produce anything or less than the wanted amount, either try again or use a new prompt in that case"
|
||||
}
|
||||
|
||||
onUiUpdate(function(){
|
||||
gradioApp().querySelectorAll('span, button, select, p').forEach(function(span){
|
||||
tooltip = titles[span.textContent];
|
||||
|
||||
if(!tooltip){
|
||||
tooltip = titles[span.value];
|
||||
}
|
||||
|
||||
if(!tooltip){
|
||||
for (const c of span.classList) {
|
||||
if (c in titles) {
|
||||
tooltip = titles[c];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(tooltip){
|
||||
span.title = tooltip;
|
||||
}
|
||||
})
|
||||
|
||||
gradioApp().querySelectorAll('select').forEach(function(select){
|
||||
if (select.onchange != null) return;
|
||||
|
||||
select.onchange = function(){
|
||||
select.title = titles[select.value] || "";
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -168,6 +168,7 @@ def on_ui_tabs():
|
||||
lines=2, elem_id="promptTxt", label="Start of the prompt")
|
||||
with gr.Column():
|
||||
with gr.Row():
|
||||
#tooltip_slider = gr.tooltip("This is the tooltip text.")
|
||||
temp_slider = gr.Slider(
|
||||
elem_id="temp_slider", label="Temperature", interactive=True, minimum=0, maximum=1, value=0.9)
|
||||
max_length_slider = gr.Slider(
|
||||
|
||||
Reference in New Issue
Block a user