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() {