mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 13:42:12 -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.serializeValue = () => {
|
||||
// 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 },
|
||||
{ name: "__dummy_item2__", strength: 0, active: false, _isDummy: true }
|
||||
];
|
||||
return widgetValue;
|
||||
}
|
||||
|
||||
widget.onRemove = () => {
|
||||
|
||||
@@ -220,13 +220,8 @@ export function addTagsWidget(node, name, opts, callback) {
|
||||
// Set callback
|
||||
widget.callback = callback;
|
||||
|
||||
// Add serialization method to avoid ComfyUI serialization issues
|
||||
widget.serializeValue = () => {
|
||||
// Add dummy items to avoid the 2-element serialization issue
|
||||
return [...widgetValue,
|
||||
{ text: "__dummy_item__", active: false, _isDummy: true },
|
||||
{ text: "__dummy_item__", active: false, _isDummy: true }
|
||||
];
|
||||
return widgetValue
|
||||
};
|
||||
|
||||
return { minWidth: 300, minHeight: defaultHeight, widget };
|
||||
|
||||
Reference in New Issue
Block a user