From 7d2d6df57bfae4c9596c97b7bf7a9047a6182cf3 Mon Sep 17 00:00:00 2001 From: Alistor <95994251+UrzasLegacy@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:34:54 -0400 Subject: [PATCH] Add spellcheck option to Multiline widget, add Interrupt Queue keybind (#267) * Add spellcheck option to Multiline widget and set to false by default * Add Queue Interrupt Keybind * Update keybinds.ts Fixed indentation --- src/extensions/core/keybinds.ts | 9 ++++++++- src/scripts/widgets.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/extensions/core/keybinds.ts b/src/extensions/core/keybinds.ts index 64dda5c48..e0eef87f6 100644 --- a/src/extensions/core/keybinds.ts +++ b/src/extensions/core/keybinds.ts @@ -1,4 +1,5 @@ import { app } from '../../scripts/app' +import { api } from '../../scripts/api' app.registerExtension({ name: 'Comfy.Keybinds', @@ -6,8 +7,14 @@ app.registerExtension({ const keybindListener = function (event) { const modifierPressed = event.ctrlKey || event.metaKey - // Queue prompt using ctrl or command + enter + // Queue prompt using (ctrl or command) + enter if (modifierPressed && event.key === 'Enter') { + // Cancel current prompt using (ctrl or command) + alt + enter + if(event.altKey) { + api.interrupt() + return + } + // Queue prompt as first for generation using (ctrl or command) + shift + enter app.queuePrompt(event.shiftKey ? -1 : 0).then() return } diff --git a/src/scripts/widgets.ts b/src/scripts/widgets.ts index e2143e9f9..dda65da3d 100644 --- a/src/scripts/widgets.ts +++ b/src/scripts/widgets.ts @@ -313,6 +313,7 @@ function addMultilineWidget(node, name, opts, app) { inputEl.className = 'comfy-multiline-input' inputEl.value = opts.defaultVal inputEl.placeholder = opts.placeholder || name + inputEl.spellcheck = opts.spellcheck || false const widget = node.addDOMWidget(name, 'customtext', inputEl, { getValue() {