Files
da2el-ai-D2-nodes-ComfyUI/web/D2_ImageStack.js
T

31 lines
845 B
JavaScript

import { app } from "/scripts/app.js";
import { findWidgetByName, handleInputsVisibility } from "./utils.js";
app.registerExtension({
name: "Comfy.D2.D2_ImageStack",
nodeCreated(node) {
if (node.constructor.title == "D2 Image Stack"){
if (node.widgets){
const countWidget = findWidgetByName(node, "image_count");
let widgetValue = countWidget.value;
handleInputsVisibility(node, widgetValue, ["image"], "IMAGE")
// lora_count.value の再定義
Object.defineProperty(countWidget, 'value', {
get() {
return widgetValue;
},
set(newVal) {
if (newVal !== widgetValue) {
widgetValue = newVal;
handleInputsVisibility(node, newVal, ["image"], "IMAGE")
}
}
});
}
}
}
});