mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-27 23:00:20 +08:00
random commit
This commit is contained in:
parent
378e02c114
commit
ea5dc10e16
@ -5,9 +5,6 @@ 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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +173,10 @@ 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;
|
||||||
@ -192,7 +193,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() {
|
||||||
@ -287,11 +288,10 @@ app.registerExtension({
|
|||||||
widget.value = theirWidget.value;
|
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
|
// 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 { ComfyWidgets } from "./widgets.js";
|
import { addSeedControlWidget, 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";
|
||||||
@ -781,7 +781,6 @@ class ComfyApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#invokeExtensions("loadedGraphNode", node);
|
this.#invokeExtensions("loadedGraphNode", node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,6 @@ function seedWidget(node, inputName, inputData) {
|
|||||||
const seed = ComfyWidgets.INT(node, inputName, inputData);
|
const seed = ComfyWidgets.INT(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 { widget: seed, seedControl };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user