mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-27 14:50:20 +08:00
seedControl can no longer become an input, removes .vs files
This commit is contained in:
parent
3d856e62dd
commit
1518b385a7
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
{
|
||||
"CurrentProjectSetting": null
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
{
|
||||
"ExpandedNodes": [
|
||||
"",
|
||||
"\\web",
|
||||
"\\web\\extensions",
|
||||
"\\web\\extensions\\core",
|
||||
"\\web\\scripts"
|
||||
],
|
||||
"SelectedNode": "\\web\\scripts\\widgets.js",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
||||
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
@ -5,9 +5,13 @@ 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]);
|
||||
if (widget.name == "seed control after generating")
|
||||
widget.allowConvertToInput = false;
|
||||
else
|
||||
return VALID_TYPES.includes(widget.type) || VALID_TYPES.includes(config[0]);
|
||||
}
|
||||
|
||||
|
||||
function hideWidget(node, widget, suffix = "") {
|
||||
widget.origType = widget.type;
|
||||
widget.origComputeSize = widget.computeSize;
|
||||
|
||||
@ -773,8 +773,9 @@ class ComfyApp {
|
||||
}
|
||||
|
||||
if (widget.name == "seed control after generating") {
|
||||
if (widget.value == true)
|
||||
if (widget.value == true) {
|
||||
widget.value = "fixed seed";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,16 +10,17 @@ function getNumberDefaults(inputData, defaultStep) {
|
||||
return { val: defaultVal, config: { min, max, step: 10.0 * step } };
|
||||
}
|
||||
|
||||
export function addSeedControlWidget(node, targetWidget, defauly, options) {
|
||||
export function addSeedControlWidget(node, targetWidget, defaultValue = "fixed seed", values) {
|
||||
const seedControl = node.addWidget("combo", "seed control after generating", "fixed seed", function (v) { }, {
|
||||
values: ["fixed seed", "increment", "decrement", "randomize"] },)
|
||||
values: ["fixed seed", "increment", "decrement", "randomize"]
|
||||
})
|
||||
seedControl.afterQueued = () => {
|
||||
|
||||
var v = seedControl.value;
|
||||
|
||||
switch (v) {
|
||||
case ("fixed seed"):
|
||||
console.log("fixed seed");
|
||||
console.log("Fixed Seed");
|
||||
break;
|
||||
case ("increment"):
|
||||
targetWidget.value += 1;
|
||||
@ -49,7 +50,7 @@ export function addSeedControlWidget(node, targetWidget, defauly, options) {
|
||||
console.log("default (fail)");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return seedControl;
|
||||
}
|
||||
|
||||
@ -58,7 +59,7 @@ function seedWidget(node, inputName, inputData) {
|
||||
const seedControl = addSeedControlWidget(node, seed.widget, "fixed seed");
|
||||
|
||||
seed.widget.linkedWidgets = [seedControl];
|
||||
return { widget: seed, seedControl};
|
||||
return { widget: seed, seedControl };
|
||||
}
|
||||
|
||||
const MultilineSymbol = Symbol();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user