Commit 268a2dab authored by comfyanonymous's avatar comfyanonymous
Browse files

Merge branch 'queue-prompt-hotkey' of https://github.com/pythongosssss/ComfyUI

parents ff255d9d 01ec3db9
...@@ -405,6 +405,15 @@ class ComfyApp { ...@@ -405,6 +405,15 @@ class ComfyApp {
api.init(); api.init();
} }
#addKeyboardHandler() {
window.addEventListener("keydown", (e) => {
// Queue prompt using ctrl or command + enter
if ((e.ctrlKey || e.metaKey) && (e.key === "Enter" || e.keyCode === 13 || e.keyCode === 10)) {
this.queuePrompt(e.shiftKey ? -1 : 0);
}
});
}
/** /**
* Loads all extensions from the API into the window * Loads all extensions from the API into the window
*/ */
...@@ -471,6 +480,7 @@ class ComfyApp { ...@@ -471,6 +480,7 @@ class ComfyApp {
this.#addApiUpdateHandlers(); this.#addApiUpdateHandlers();
this.#addDropHandler(); this.#addDropHandler();
this.#addPasteHandler(); this.#addPasteHandler();
this.#addKeyboardHandler();
await this.#invokeExtensionsAsync("setup"); await this.#invokeExtensionsAsync("setup");
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment