ctrl + enter

This commit is contained in:
Haoming 2025-09-18 11:22:12 +08:00
parent d7be554433
commit a0ff66d8a4
2 changed files with 3 additions and 1 deletions

View File

@ -390,6 +390,7 @@ options_templates.update(
"show_rescale_cfg": OptionInfo(False, "Display the Rescale CFG Slider").info("feature for v-pred checkpoints").needs_reload_ui(),
"show_mahiro": OptionInfo(False, "Display the MaHiRo Toggle").info('see <a href="https://huggingface.co/spaces/yoinked/blue-arxiv">blue-arxiv</a> - <b>id:</b> <ins>2024-1208.1</ins>').needs_reload_ui(),
"paste_safe_guard": OptionInfo(False, 'Disable the "Read generation parameters" button (↙️) when negative prompt is not empty'),
"ctrl_enter_interrupt": OptionInfo(False, "Revert [Ctrl + Enter] to only interrupt the generation").info('the current "intended" behavior is to interrupt the current generation then immediately start a new one'),
"div_classic": OptionDiv(),
"compact_prompt_box": OptionInfo(False, "Compact Prompt Layout").info("put prompts inside the Generate tab, leaving more space for the gallery").needs_reload_ui(),
"dimensions_and_batch_together": OptionInfo(True, "Show Width/Height and Batch sliders in same row").needs_reload_ui(),

View File

@ -159,8 +159,10 @@ document.addEventListener("keydown", function (e) {
get_uiCurrentTabContent().querySelector("button[id$=_skip]");
if (isCtrlKey && isEnter) {
e.preventDefault();
if (interruptButton.style.display === "block") {
interruptButton.click();
if (opts.ctrl_enter_interrupt) return;
const callback = (mutationList) => {
for (const mutation of mutationList) {
if (
@ -179,7 +181,6 @@ document.addEventListener("keydown", function (e) {
} else {
generateButton.click();
}
e.preventDefault();
}
if (isAltKey && isEnter) {