diff --git a/.gitignore b/.gitignore index d311a2a09..df6adbe4b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ temp/ custom_nodes/ !custom_nodes/example_node.py.example extra_model_paths.yaml +/.vs diff --git a/.vs/ComfyUI/FileContentIndex/05b2f020-3ab2-4506-8e7d-0f3a76d67546.vsidx b/.vs/ComfyUI/FileContentIndex/05b2f020-3ab2-4506-8e7d-0f3a76d67546.vsidx deleted file mode 100644 index 861809101..000000000 Binary files a/.vs/ComfyUI/FileContentIndex/05b2f020-3ab2-4506-8e7d-0f3a76d67546.vsidx and /dev/null differ diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index 9acdb791e..37cd3fa05 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -5,9 +5,10 @@ const CONVERTED_TYPE = "converted-widget"; const VALID_TYPES = ["STRING", "combo", "number"]; function isConvertableWidget(widget, config) { - return VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0]); + return VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0]); } + function hideWidget(node, widget, suffix = "") { widget.origType = widget.type; widget.origComputeSize = widget.computeSize; @@ -23,7 +24,7 @@ function hideWidget(node, widget, suffix = "") { return widget.value; }; - // Hide any linked widgets, e.g. seed+randomize + // Hide any linked widgets, e.g. seed+seedControl if (widget.linkedWidgets) { for (const w of widget.linkedWidgets) { hideWidget(node, w, ":" + widget.name); @@ -40,7 +41,7 @@ function showWidget(widget) { delete widget.origComputeSize; delete widget.origSerializeValue; - // Hide any linked widgets, e.g. seed+randomize + // Hide any linked widgets, e.g. seed+seedControl if (widget.linkedWidgets) { for (const w of widget.linkedWidgets) { showWidget(w); @@ -172,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; @@ -188,7 +193,7 @@ app.registerExtension({ constructor() { this.addOutput("connect to widget input", "*"); this.serialize_widgets = true; - this.isVirtualNode = true; + this.isVirtualNode = true; } applyToGraph() { @@ -284,10 +289,17 @@ app.registerExtension({ } } +<<<<<<< HEAD if (widget.type === "combo") { addSeedControlWidget(this, widget, "randomize"); } +======= + if (widget.type === "combo") + addSeedControlWidget(this, widget, "randomize"); + + +>>>>>>> fbe3df1ec837d298aaab68bab81c967182d2bab6 // When our value changes, update other widgets to reflect our changes // e.g. so LoadImage shows correct image const callback = widget.callback; diff --git a/web/scripts/app.js b/web/scripts/app.js index 5faae5e2e..291867f91 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"; @@ -771,6 +771,13 @@ class ComfyApp { widget.value = widget.value.slice(7); } } + + if (widget.name == "seed control after generating") { + if (widget.value == true) { + widget.value = "randomize"; + + } + } } if (widget.name == "seed control after generating") { if (widget.value == true) { @@ -780,7 +787,6 @@ class ComfyApp { } } } - this.#invokeExtensions("loadedGraphNode", node); } } diff --git a/web/scripts/widgets.js b/web/scripts/widgets.js index da2cca41f..ee58c0815 100644 --- a/web/scripts/widgets.js +++ b/web/scripts/widgets.js @@ -54,7 +54,11 @@ export function addSeedControlWidget(node, targetWidget, defaultValue = "randomi } function seedWidget(node, inputName, inputData) { +<<<<<<< HEAD const seed = ComfyWidgets.COMBO(node, inputName, inputData); +======= + const seed = ComfyWidgets.INT(node, inputName, inputData); +>>>>>>> fbe3df1ec837d298aaab68bab81c967182d2bab6 const seedControl = addSeedControlWidget(node, seed.widget, "randomize"); seed.widget.linkedWidgets = [seedControl];