aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-20 20:23:53 +0000
committerGitHub <noreply@github.com>2023-05-20 20:23:53 +0000
commit3605407033fa50408239924e77ccf38dcd5225b9 (patch)
treeed6255be57afc1b67d25935157114ada78925219
parent05e6fc9aa944dd6e3ee01eae0817f8b51134ffab (diff)
parent373903d8518c8e0309fabd8e9d08ad61022b8447 (diff)
downloadstable-diffusion-webui-gfx803-3605407033fa50408239924e77ccf38dcd5225b9.tar.gz
stable-diffusion-webui-gfx803-3605407033fa50408239924e77ccf38dcd5225b9.tar.bz2
stable-diffusion-webui-gfx803-3605407033fa50408239924e77ccf38dcd5225b9.zip
Merge pull request #10576 from catboxanon/patch/hires-prompt-edit-attn
Support edit attention keyboard shortcuts in hires fix prompts
-rw-r--r--javascript/edit-attention.js2
-rw-r--r--modules/ui.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js
index fdf00b4d..ffa73147 100644
--- a/javascript/edit-attention.js
+++ b/javascript/edit-attention.js
@@ -1,6 +1,6 @@
function keyupEditAttention(event) {
let target = event.originalTarget || event.composedPath()[0];
- if (!target.matches("[id*='_toprow'] [id*='_prompt'] textarea")) return;
+ if (!target.matches("*:is([id*='_toprow'] [id*='_prompt'], .prompt) textarea")) return;
if (!(event.metaKey || event.ctrlKey)) return;
let isPlus = event.key == "ArrowUp";
diff --git a/modules/ui.py b/modules/ui.py
index 82820ab5..c0626587 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -272,12 +272,12 @@ def create_toprow(is_img2img):
with gr.Row():
with gr.Column(scale=80):
with gr.Row():
- prompt = gr.Textbox(label="Prompt", elem_id=f"{id_part}_prompt", show_label=False, lines=3, placeholder="Prompt (press Ctrl+Enter or Alt+Enter to generate)")
+ prompt = gr.Textbox(label="Prompt", elem_id=f"{id_part}_prompt", show_label=False, lines=3, placeholder="Prompt (press Ctrl+Enter or Alt+Enter to generate)", elem_classes=["prompt"])
with gr.Row():
with gr.Column(scale=80):
with gr.Row():
- negative_prompt = gr.Textbox(label="Negative prompt", elem_id=f"{id_part}_neg_prompt", show_label=False, lines=3, placeholder="Negative prompt (press Ctrl+Enter or Alt+Enter to generate)")
+ negative_prompt = gr.Textbox(label="Negative prompt", elem_id=f"{id_part}_neg_prompt", show_label=False, lines=3, placeholder="Negative prompt (press Ctrl+Enter or Alt+Enter to generate)", elem_classes=["prompt"])
button_interrogate = None
button_deepbooru = None
@@ -505,10 +505,10 @@ def create_ui():
with FormRow(elem_id="txt2img_hires_fix_row4", variant="compact", visible=opts.hires_fix_show_prompts) as hr_prompts_container:
with gr.Column(scale=80):
with gr.Row():
- hr_prompt = gr.Textbox(label="Prompt", elem_id="hires_prompt", show_label=False, lines=3, placeholder="Prompt for hires fix pass.\nLeave empty to use the same prompt as in first pass.")
+ hr_prompt = gr.Textbox(label="Prompt", elem_id="hires_prompt", show_label=False, lines=3, placeholder="Prompt for hires fix pass.\nLeave empty to use the same prompt as in first pass.", elem_classes=["prompt"])
with gr.Column(scale=80):
with gr.Row():
- hr_negative_prompt = gr.Textbox(label="Negative prompt", elem_id="hires_neg_prompt", show_label=False, lines=3, placeholder="Negative prompt for hires fix pass.\nLeave empty to use the same negative prompt as in first pass.")
+ hr_negative_prompt = gr.Textbox(label="Negative prompt", elem_id="hires_neg_prompt", show_label=False, lines=3, placeholder="Negative prompt for hires fix pass.\nLeave empty to use the same negative prompt as in first pass.", elem_classes=["prompt"])
elif category == "batch":
if not opts.dimensions_and_batch_together: