cleanup return value of seedWidget

This commit is contained in:
flyingshutter 2023-03-31 23:27:06 +02:00
parent 662f297a1c
commit 21b0104602
2 changed files with 4 additions and 3 deletions

View File

@ -284,7 +284,8 @@ app.registerExtension({
// so let's check for those first // so let's check for those first
let combinedWidgetType = type + ":" + widgetName; let combinedWidgetType = type + ":" + widgetName;
if (combinedWidgetType in ComfyWidgets) { if (combinedWidgetType in ComfyWidgets) {
widget = (ComfyWidgets[combinedWidgetType](this, "value", inputData, app) || {}).widget; // widget = (ComfyWidgets[combinedWidgetType](this, "value", inputData, app) || {}).widget;
widget = (ComfyWidgets[combinedWidgetType](this, widgetName, inputData, app) || {}).widget;
} else { } else {
// we did not find a subtype, so proceed with "<type>" only // we did not find a subtype, so proceed with "<type>" only
if (type in ComfyWidgets) { if (type in ComfyWidgets) {
@ -302,7 +303,7 @@ app.registerExtension({
if (node?.widgets && widget) { if (node?.widgets && widget) {
const theirWidget = node.widgets.find((w) => w.name === widgetName); const theirWidget = node.widgets.find((w) => w.name === widgetName);
if (theirWidget) { if (theirWidget) {
widget.value = theirWidget.value; widget.value = theirWidget.value;
} }

View File

@ -59,7 +59,7 @@ function seedWidget(node, inputName, inputData) {
const seedControl = addSeedControlWidget(node, seed.widget, "randomize"); const seedControl = addSeedControlWidget(node, seed.widget, "randomize");
seed.widget.linkedWidgets = [seedControl]; seed.widget.linkedWidgets = [seedControl];
return { widget: seed, seedControl }; return seed;
} }
const MultilineSymbol = Symbol(); const MultilineSymbol = Symbol();