mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-15 16:02:32 +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\\lib",
|
||||||
"\\web\\scripts"
|
"\\web\\scripts"
|
||||||
],
|
],
|
||||||
"SelectedNode": "\\web\\scripts\\ui.js",
|
"SelectedNode": "\\web\\scripts\\widgets.js",
|
||||||
"PreviewInSolutionExplorer": false
|
"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"];
|
const VALID_TYPES = ["STRING", "combo", "number"];
|
||||||
|
|
||||||
function isConvertableWidget(widget, config) {
|
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]);
|
return VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,10 +176,6 @@ app.registerExtension({
|
|||||||
node.pos = pos;
|
node.pos = pos;
|
||||||
node.connect(0, this, slot);
|
node.connect(0, this, slot);
|
||||||
node.title = input.name;
|
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
|
// Prevent adding duplicates due to triple clicking
|
||||||
input[ignoreDblClick] = true;
|
input[ignoreDblClick] = true;
|
||||||
@ -193,7 +192,7 @@ app.registerExtension({
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.addOutput("connect to widget input", "*");
|
this.addOutput("connect to widget input", "*");
|
||||||
this.serialize_widgets = true;
|
this.serialize_widgets = true;
|
||||||
this.isVirtualNode = true;
|
this.isVirtualNode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyToGraph() {
|
applyToGraph() {
|
||||||
@ -276,11 +275,19 @@ app.registerExtension({
|
|||||||
}
|
}
|
||||||
|
|
||||||
let widget;
|
let widget;
|
||||||
|
|
||||||
if (type in ComfyWidgets) {
|
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 {
|
} 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) {
|
if (node?.widgets && widget) {
|
||||||
const theirWidget = node.widgets.find((w) => w.name === widgetName);
|
const theirWidget = node.widgets.find((w) => w.name === widgetName);
|
||||||
@ -288,9 +295,6 @@ app.registerExtension({
|
|||||||
widget.value = theirWidget.value;
|
widget.value = theirWidget.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (widget.type === "combo") {
|
|
||||||
addSeedControlWidget(this, widget, "randomize");
|
|
||||||
}
|
|
||||||
|
|
||||||
// When our value changes, update other widgets to reflect our changes
|
// When our value changes, update other widgets to reflect our changes
|
||||||
// e.g. so LoadImage shows correct image
|
// 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 { ComfyUI } from "./ui.js";
|
||||||
import { api } from "./api.js";
|
import { api } from "./api.js";
|
||||||
import { defaultGraph } from "./defaultGraph.js";
|
import { defaultGraph } from "./defaultGraph.js";
|
||||||
@ -771,23 +771,15 @@ class ComfyApp {
|
|||||||
widget.value = widget.value.slice(7);
|
widget.value = widget.value.slice(7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget.name == "seed control after generating") {
|
if (widget.name == "seed control after generating") {
|
||||||
if (widget.value == true) {
|
if (widget.value == true) {
|
||||||
widget.value = "randomize";
|
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