mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 14:42:11 -03:00
refactor(widget-serialization): remove dummy items from serialization which was a fix to ComfyUI issues
This commit is contained in:
@@ -948,11 +948,7 @@ export function addLorasWidget(node, name, opts, callback) {
|
|||||||
widget.callback = callback;
|
widget.callback = callback;
|
||||||
|
|
||||||
widget.serializeValue = () => {
|
widget.serializeValue = () => {
|
||||||
// Add dummy items to avoid the 2-element serialization issue, a bug in comfyui
|
return widgetValue;
|
||||||
return [...widgetValue,
|
|
||||||
{ name: "__dummy_item1__", strength: 0, active: false, _isDummy: true },
|
|
||||||
{ name: "__dummy_item2__", strength: 0, active: false, _isDummy: true }
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.onRemove = () => {
|
widget.onRemove = () => {
|
||||||
|
|||||||
@@ -220,13 +220,8 @@ export function addTagsWidget(node, name, opts, callback) {
|
|||||||
// Set callback
|
// Set callback
|
||||||
widget.callback = callback;
|
widget.callback = callback;
|
||||||
|
|
||||||
// Add serialization method to avoid ComfyUI serialization issues
|
|
||||||
widget.serializeValue = () => {
|
widget.serializeValue = () => {
|
||||||
// Add dummy items to avoid the 2-element serialization issue
|
return widgetValue
|
||||||
return [...widgetValue,
|
|
||||||
{ text: "__dummy_item__", active: false, _isDummy: true },
|
|
||||||
{ text: "__dummy_item__", active: false, _isDummy: true }
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return { minWidth: 300, minHeight: defaultHeight, widget };
|
return { minWidth: 300, minHeight: defaultHeight, widget };
|
||||||
|
|||||||
Reference in New Issue
Block a user