seedControl can no longer become an input, removes .vs files

This commit is contained in:
Julien Lubimiv 2023-03-29 16:54:45 -04:00
parent 3d856e62dd
commit 1518b385a7
8 changed files with 13 additions and 21 deletions

Binary file not shown.

View File

@ -1,3 +0,0 @@
{
"CurrentProjectSetting": null
}

View File

@ -1,11 +0,0 @@
{
"ExpandedNodes": [
"",
"\\web",
"\\web\\extensions",
"\\web\\extensions\\core",
"\\web\\scripts"
],
"SelectedNode": "\\web\\scripts\\widgets.js",
"PreviewInSolutionExplorer": false
}

Binary file not shown.

View File

@ -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;

View File

@ -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";
}
}
}
}

View File

@ -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();