update
+ PainterNode, added inset image (as background or as image), when select image in the COMBO + added highlight mousemove items media in extension extras_preview_media + update version
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui_custom_nodes_alekpet"
|
||||
description = "Nodes: PoseNode, PainterNode, TranslateTextNode, TranslateCLIPTextEncodeNode, DeepTranslatorTextNode, DeepTranslatorCLIPTextEncodeNode, ArgosTranslateTextNode, ArgosTranslateCLIPTextEncodeNode, ChatGLM4TranslateCLIPTextEncodeNode, ChatGLM4TranslateTextNode, ChatGLM4InstructNode, ChatGLM4InstructMediaNode, ChatGLMImageGenerateNode, ChatGLMVideoGenerateNode, PreviewTextNode, HexToHueNode, ColorsCorrectNode, IDENode."
|
||||
version = "1.1.10"
|
||||
version = "1.1.11"
|
||||
license = { file = "LICENSE" }
|
||||
|
||||
[project.urls]
|
||||
|
||||
@@ -13,3 +13,8 @@
|
||||
background-blend-mode: multiply;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.alekpet_preview_media_higlight {
|
||||
background-color: rgb(204, 204, 204) !important;
|
||||
color: rgb(0, 0, 0) !important;
|
||||
}
|
||||
|
||||
@@ -312,6 +312,8 @@ app.registerExtension({
|
||||
const el = e.target.closest("[data-value]");
|
||||
if (!el) return;
|
||||
|
||||
el.classList.toggle("alekpet_preview_media_higlight");
|
||||
|
||||
const valueItem = el.dataset.value;
|
||||
const ext = valueItem
|
||||
.slice(valueItem.lastIndexOf(".") + 1)
|
||||
@@ -334,6 +336,19 @@ app.registerExtension({
|
||||
true
|
||||
);
|
||||
|
||||
// Pointer leave from item
|
||||
document.addEventListener(
|
||||
"pointerleave",
|
||||
(e) => {
|
||||
try {
|
||||
const el = e.target.closest("[data-value]");
|
||||
if (!el) return;
|
||||
el.classList.toggle("alekpet_preview_media_higlight");
|
||||
} catch (e) {}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
// Find node name on pointerdown
|
||||
app.canvas.canvas.addEventListener(
|
||||
"pointerdown",
|
||||
|
||||
@@ -167,8 +167,36 @@ class Painter {
|
||||
const self = this;
|
||||
const callb = this.node.callback;
|
||||
|
||||
this.image.callback = function () {
|
||||
this.image.callback = function (image_name) {
|
||||
self.image.value = self.node.name;
|
||||
|
||||
// Insert image
|
||||
self.getImageByName(image_name).then(async (image) => {
|
||||
if (image?.tagName !== "IMG") {
|
||||
createWindowModal({
|
||||
textTitle: "ERROR",
|
||||
textBody: [
|
||||
makeElement("div", {
|
||||
innerHTML: image ?? "Error load image",
|
||||
}),
|
||||
],
|
||||
...THEMES_MODAL_WINDOW.error,
|
||||
options: {
|
||||
auto: { autohide: true, autoshow: true, autoremove: true },
|
||||
close: { showClose: false },
|
||||
parent: self.canvas.wrapperEl,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (await comfyuiDesktopConfirm("Past as background?")) {
|
||||
self.pastAsBackground(image);
|
||||
} else if (await comfyuiDesktopConfirm("Past as image?")) {
|
||||
self.pastAsImage(image);
|
||||
}
|
||||
});
|
||||
|
||||
if (callb) {
|
||||
return callb.apply(this, arguments);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user