Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spellcheck option to Multiline widget, add Interrupt Queue keybind #267

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/extensions/core/keybinds.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import { app } from '../../scripts/app'
import { api } from '../../scripts/api'

app.registerExtension({
name: 'Comfy.Keybinds',
init() {
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
}
Expand Down
1 change: 1 addition & 0 deletions src/scripts/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading