mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-27 06:40:16 +08:00
trying some things but no luck
This commit is contained in:
parent
c8e0185921
commit
505821d982
Binary file not shown.
@ -7,6 +7,6 @@
|
||||
"\\web\\lib",
|
||||
"\\web\\scripts"
|
||||
],
|
||||
"SelectedNode": "\\web\\scripts\\ui.js",
|
||||
"SelectedNode": "\\web\\scripts\\widgets.js",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
@ -5,6 +5,9 @@ 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]);
|
||||
}
|
||||
|
||||
@ -173,10 +176,6 @@ 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;
|
||||
@ -193,7 +192,7 @@ app.registerExtension({
|
||||
constructor() {
|
||||
this.addOutput("connect to widget input", "*");
|
||||
this.serialize_widgets = true;
|
||||
this.isVirtualNode = true;
|
||||
this.isVirtualNode = true;
|
||||
}
|
||||
|
||||
applyToGraph() {
|
||||
@ -276,11 +275,19 @@ app.registerExtension({
|
||||
}
|
||||
|
||||
let widget;
|
||||
|
||||
if (type in ComfyWidgets) {
|
||||
widget = (ComfyWidgets[type](this, "value", inputData, app) || {}).widget;
|
||||
widget = (ComfyWidgets[type](this, widgetName/*"value*"*/, inputData, app) || {}).widget;
|
||||
if (widgetName == "seed") {
|
||||
addSeedControlWidget(node, node.widgets[0],"randomize");
|
||||
}
|
||||
} else {
|
||||
widget = this.addWidget(type, "value", null, () => {}, {});
|
||||
widget = this.addWidget(type, widgetName /*"value"*/, null, () => { }, {});
|
||||
if (widgetName == "seed") {
|
||||
addSeedControlWidget(node, node.widgets[0], "randomize");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (node?.widgets && widget) {
|
||||
const theirWidget = node.widgets.find((w) => w.name === widgetName);
|
||||
@ -288,9 +295,6 @@ app.registerExtension({
|
||||
widget.value = theirWidget.value;
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { addSeedControlWidget, ComfyWidgets } from "./widgets.js";
|
||||
import { ComfyWidgets } from "./widgets.js";
|
||||
import { ComfyUI } from "./ui.js";
|
||||
import { api } from "./api.js";
|
||||
import { defaultGraph } from "./defaultGraph.js";
|
||||
@ -771,23 +771,15 @@ 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) {
|
||||
widget.value = "randomize";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
this.#invokeExtensions("loadedGraphNode", node);
|
||||
}
|
||||
this.#invokeExtensions("loadedGraphNode", node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user