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
This commit is contained in:
Alistor
2024-07-30 17:34:54 -04:00
committed by GitHub
parent 4462dabc63
commit 7d2d6df57b
2 changed files with 9 additions and 1 deletions

View File

@@ -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
}

View File

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