mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-23 14:12:11 -03:00
Add lora stacker support and fix TriggerWord Toggle node
This commit is contained in:
@@ -35,8 +35,12 @@ app.registerExtension({
|
||||
// Enable widget serialization
|
||||
node.serialize_widgets = true;
|
||||
|
||||
node.addInput("lora_stack", 'LORA_STACK', {
|
||||
"shape": 7 // 7 is the shape of the optional input
|
||||
});
|
||||
|
||||
// Wait for node to be properly initialized
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
// Restore saved value if exists
|
||||
let existingLoras = [];
|
||||
if (node.widgets_values && node.widgets_values.length > 0) {
|
||||
|
||||
@@ -35,6 +35,10 @@ app.registerExtension({
|
||||
// Enable widget serialization
|
||||
node.serialize_widgets = true;
|
||||
|
||||
node.addInput("lora_stack", 'LORA_STACK', {
|
||||
"shape": 7 // 7 is the shape of the optional input
|
||||
});
|
||||
|
||||
// Wait for node to be properly initialized
|
||||
requestAnimationFrame(() => {
|
||||
// Restore saved value if exists
|
||||
@@ -105,8 +109,6 @@ app.registerExtension({
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
console.log("Lora Stacker node created:", node);
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -750,7 +750,6 @@ export function addLorasWidget(node, name, opts, callback) {
|
||||
widget.callback = callback;
|
||||
|
||||
widget.serializeValue = () => {
|
||||
console.log("Serializing loras data: ", widgetValue);
|
||||
// Add dummy items to avoid the 2-element serialization issue, a bug in comfyui
|
||||
return [...widgetValue,
|
||||
{ name: "__dummy_item1__", strength: 0, active: false, _isDummy: true },
|
||||
|
||||
@@ -20,14 +20,13 @@ app.registerExtension({
|
||||
if (node.comfyClass === "TriggerWord Toggle (LoraManager)") {
|
||||
// Enable widget serialization
|
||||
node.serialize_widgets = true;
|
||||
|
||||
node.addInput("trigger_words", 'string', {
|
||||
"shape": 7 // 7 is the shape of the optional input
|
||||
});
|
||||
|
||||
// Wait for node to be properly initialized
|
||||
requestAnimationFrame(() => {
|
||||
node.addInput("trigger_words", 'string', {
|
||||
"default": "",
|
||||
"defaultInput": false, // Changed to make it optional
|
||||
"optional": true // Marking the input as optional
|
||||
});
|
||||
// Get the widget object directly from the returned object
|
||||
const result = addTagsWidget(node, "toggle_trigger_words", {
|
||||
defaultVal: []
|
||||
@@ -60,8 +59,6 @@ app.registerExtension({
|
||||
this.updateTagsBasedOnMode(node, node.widgets[2].value, value);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("node ", node);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user