mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-22 20:30:25 +08:00
Merge remote-tracking branch 'upstream/master' into addBatchIndex
This commit is contained in:
commit
f167db1bd1
@ -112,6 +112,46 @@ class ComfyApp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#addNodeKeyHandler(node) {
|
||||||
|
const app = this;
|
||||||
|
const origNodeOnKeyDown = node.prototype.onKeyDown;
|
||||||
|
|
||||||
|
node.prototype.onKeyDown = function(e) {
|
||||||
|
if (origNodeOnKeyDown && origNodeOnKeyDown.apply(this, e) === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.flags.collapsed || !this.imgs || this.imageIndex === null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let handled = false;
|
||||||
|
|
||||||
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
||||||
|
if (e.key === "ArrowLeft") {
|
||||||
|
this.imageIndex -= 1;
|
||||||
|
} else if (e.key === "ArrowRight") {
|
||||||
|
this.imageIndex += 1;
|
||||||
|
}
|
||||||
|
this.imageIndex %= this.imgs.length;
|
||||||
|
|
||||||
|
if (this.imageIndex < 0) {
|
||||||
|
this.imageIndex = this.imgs.length + this.imageIndex;
|
||||||
|
}
|
||||||
|
handled = true;
|
||||||
|
} else if (e.key === "Escape") {
|
||||||
|
this.imageIndex = null;
|
||||||
|
handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (handled === true) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds Custom drawing logic for nodes
|
* Adds Custom drawing logic for nodes
|
||||||
* e.g. Draws images and handles thumbnail navigation on nodes that output images
|
* e.g. Draws images and handles thumbnail navigation on nodes that output images
|
||||||
@ -803,6 +843,7 @@ class ComfyApp {
|
|||||||
|
|
||||||
this.#addNodeContextMenuHandler(node);
|
this.#addNodeContextMenuHandler(node);
|
||||||
this.#addDrawBackgroundHandler(node, app);
|
this.#addDrawBackgroundHandler(node, app);
|
||||||
|
this.#addNodeKeyHandler(node);
|
||||||
|
|
||||||
await this.#invokeExtensionsAsync("beforeRegisterNodeDef", node, nodeData);
|
await this.#invokeExtensionsAsync("beforeRegisterNodeDef", node, nodeData);
|
||||||
LiteGraph.registerNodeType(nodeId, node);
|
LiteGraph.registerNodeType(nodeId, node);
|
||||||
|
|||||||
@ -162,7 +162,7 @@ class ComfyDialog {
|
|||||||
$el("p", { $: (p) => (this.textElement = p) }),
|
$el("p", { $: (p) => (this.textElement = p) }),
|
||||||
$el("button", {
|
$el("button", {
|
||||||
type: "button",
|
type: "button",
|
||||||
textContent: "CLOSE",
|
textContent: "Close",
|
||||||
onclick: () => this.close(),
|
onclick: () => this.close(),
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
@ -431,7 +431,7 @@ export class ComfyUI {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.menuContainer = $el("div.comfy-menu", { parent: document.body }, [
|
this.menuContainer = $el("div.comfy-menu", { parent: document.body }, [
|
||||||
$el("div", { style: { overflow: "hidden", position: "relative", width: "100%" } }, [
|
$el("div.drag-handle", { style: { overflow: "hidden", position: "relative", width: "100%", cursor: "default" } }, [
|
||||||
$el("span.drag-handle"),
|
$el("span.drag-handle"),
|
||||||
$el("span", { $: (q) => (this.queueSize = q) }),
|
$el("span", { $: (q) => (this.queueSize = q) }),
|
||||||
$el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }),
|
$el("button.comfy-settings-btn", { textContent: "⚙️", onclick: () => this.settings.show() }),
|
||||||
|
|||||||
@ -39,18 +39,19 @@ body {
|
|||||||
position: fixed; /* Stay in place */
|
position: fixed; /* Stay in place */
|
||||||
z-index: 100; /* Sit on top */
|
z-index: 100; /* Sit on top */
|
||||||
padding: 30px 30px 10px 30px;
|
padding: 30px 30px 10px 30px;
|
||||||
background-color: #ff0000; /* Modal background */
|
background-color: #353535; /* Modal background */
|
||||||
|
color: #ff4444;
|
||||||
box-shadow: 0px 0px 20px #888888;
|
box-shadow: 0px 0px 20px #888888;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
text-align: center;
|
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
max-width: 80vw;
|
max-width: 80vw;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-width: 60%;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-modal-content {
|
.comfy-modal-content {
|
||||||
@ -70,31 +71,11 @@ body {
|
|||||||
margin: 3px 3px 3px 4px;
|
margin: 3px 3px 3px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-modal button {
|
|
||||||
cursor: pointer;
|
|
||||||
color: #aaaaaa;
|
|
||||||
border: none;
|
|
||||||
background-color: transparent;
|
|
||||||
font-size: 24px;
|
|
||||||
font-weight: bold;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comfy-modal button:hover,
|
|
||||||
.comfy-modal button:focus {
|
|
||||||
color: #000;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comfy-menu {
|
.comfy-menu {
|
||||||
width: 200px;
|
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
right: 0%;
|
right: 0%;
|
||||||
background-color: white;
|
|
||||||
color: #000;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
width: 170px;
|
width: 170px;
|
||||||
@ -109,7 +90,8 @@ body {
|
|||||||
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
|
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
.comfy-menu button {
|
.comfy-menu button,
|
||||||
|
.comfy-modal button {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +112,8 @@ body {
|
|||||||
|
|
||||||
.comfy-menu > button,
|
.comfy-menu > button,
|
||||||
.comfy-menu-btns button,
|
.comfy-menu-btns button,
|
||||||
.comfy-menu .comfy-list button {
|
.comfy-menu .comfy-list button,
|
||||||
|
.comfy-modal button{
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
background-color: #222;
|
background-color: #222;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@ -220,11 +203,22 @@ button.comfy-queue-btn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.comfy-modal.comfy-settings {
|
.comfy-modal.comfy-settings {
|
||||||
background-color: var(--bg-color);
|
text-align: center;
|
||||||
color: var(--fg-color);
|
font-family: sans-serif;
|
||||||
|
color: #999;
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comfy-modal input,
|
||||||
|
.comfy-modal select {
|
||||||
|
color: #ddd;
|
||||||
|
background-color: #222;
|
||||||
|
border-radius: 8px;
|
||||||
|
border-color: #4e4e4e;
|
||||||
|
border-style: solid;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-height: 850px) {
|
@media only screen and (max-height: 850px) {
|
||||||
.comfy-menu {
|
.comfy-menu {
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
@ -239,26 +233,26 @@ button.comfy-queue-btn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.graphdialog {
|
.graphdialog {
|
||||||
min-height: 1em;
|
min-height: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graphdialog .name {
|
.graphdialog .name {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graphdialog button {
|
.graphdialog button {
|
||||||
margin-top: unset;
|
margin-top: unset;
|
||||||
vertical-align: unset;
|
vertical-align: unset;
|
||||||
height: 1.6em;
|
height: 1.6em;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graphdialog input, .graphdialog textarea, .graphdialog select {
|
.graphdialog input, .graphdialog textarea, .graphdialog select {
|
||||||
background-color: #222;
|
background-color: #222;
|
||||||
border: 2px solid;
|
border: 2px solid;
|
||||||
border-color: #444444;
|
border-color: #444444;
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
border-radius: 12px 0 0 12px;
|
border-radius: 12px 0 0 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user