diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index bf9c66338..0058f1990 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -5,9 +5,6 @@ const CONVERTED_TYPE = "converted-widget"; const VALID_TYPES = ["STRING", "combo", "number"]; function isConvertableWidget(widget, config) { - if (widget.name == "seed control after generating") - widget.allowConvertToInput = false; - else return VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0]); } @@ -176,6 +173,10 @@ app.registerExtension({ node.pos = pos; node.connect(0, this, slot); node.title = input.name; + if (node.title == "seed") { + node.widgets.addSeedControlWidget(node, node.widgets[0], "randomize"); + value.widget.linkedWidgets = [seedControl]; + } // Prevent adding duplicates due to triple clicking input[ignoreDblClick] = true; @@ -192,7 +193,7 @@ app.registerExtension({ constructor() { this.addOutput("connect to widget input", "*"); this.serialize_widgets = true; - this.isVirtualNode = true; + this.isVirtualNode = true; } applyToGraph() { @@ -287,11 +288,10 @@ app.registerExtension({ widget.value = theirWidget.value; } } - - if (widget.type === "combo") { - addSeedControlWidget(this, widget, "randomize"); - } + if (widget.type === "combo") + addSeedControlWidget(this, widget, "randomize"); + // When our value changes, update other widgets to reflect our changes // e.g. so LoadImage shows correct image diff --git a/web/scripts/app.js b/web/scripts/app.js index 2c59a0e44..a19cfeb4c 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -1,4 +1,4 @@ -import { ComfyWidgets } from "./widgets.js"; +import { addSeedControlWidget, ComfyWidgets } from "./widgets.js"; import { ComfyUI } from "./ui.js"; import { api } from "./api.js"; import { defaultGraph } from "./defaultGraph.js"; @@ -781,7 +781,6 @@ class ComfyApp { } } } - this.#invokeExtensions("loadedGraphNode", node); } } diff --git a/web/scripts/widgets.js b/web/scripts/widgets.js index 2681675bc..c073f365e 100644 --- a/web/scripts/widgets.js +++ b/web/scripts/widgets.js @@ -57,7 +57,6 @@ function seedWidget(node, inputName, inputData) { const seed = ComfyWidgets.INT(node, inputName, inputData); const seedControl = addSeedControlWidget(node, seed.widget, "randomize"); - seed.widget.linkedWidgets = [seedControl]; return { widget: seed, seedControl }; }