Skip to content

Commit 7d2d6df

Browse files
authored
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
1 parent 4462dab commit 7d2d6df

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/extensions/core/keybinds.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import { app } from '../../scripts/app'
2+
import { api } from '../../scripts/api'
23

34
app.registerExtension({
45
name: 'Comfy.Keybinds',
56
init() {
67
const keybindListener = function (event) {
78
const modifierPressed = event.ctrlKey || event.metaKey
89

9-
// Queue prompt using ctrl or command + enter
10+
// Queue prompt using (ctrl or command) + enter
1011
if (modifierPressed && event.key === 'Enter') {
12+
// Cancel current prompt using (ctrl or command) + alt + enter
13+
if(event.altKey) {
14+
api.interrupt()
15+
return
16+
}
17+
// Queue prompt as first for generation using (ctrl or command) + shift + enter
1118
app.queuePrompt(event.shiftKey ? -1 : 0).then()
1219
return
1320
}

src/scripts/widgets.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ function addMultilineWidget(node, name, opts, app) {
313313
inputEl.className = 'comfy-multiline-input'
314314
inputEl.value = opts.defaultVal
315315
inputEl.placeholder = opts.placeholder || name
316+
inputEl.spellcheck = opts.spellcheck || false
316317

317318
const widget = node.addDOMWidget(name, 'customtext', inputEl, {
318319
getValue() {

0 commit comments

Comments
 (0)