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"]; const VALID_TYPES = ["STRING", "combo", "number"];
function isConvertableWidget(widget, config) { 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 = "") { function hideWidget(node, widget, suffix = "") {
widget.origType = widget.type; widget.origType = widget.type;
widget.origComputeSize = widget.computeSize; widget.origComputeSize = widget.computeSize;

View File

@ -773,8 +773,9 @@ class ComfyApp {
} }
if (widget.name == "seed control after generating") { if (widget.name == "seed control after generating") {
if (widget.value == true) if (widget.value == true) {
widget.value = "fixed seed"; widget.value = "fixed seed";
}
} }
} }
} }

View File

@ -10,16 +10,17 @@ function getNumberDefaults(inputData, defaultStep) {
return { val: defaultVal, config: { min, max, step: 10.0 * step } }; 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) { }, { 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 = () => { seedControl.afterQueued = () => {
var v = seedControl.value; var v = seedControl.value;
switch (v) { switch (v) {
case ("fixed seed"): case ("fixed seed"):
console.log("fixed seed"); console.log("Fixed Seed");
break; break;
case ("increment"): case ("increment"):
targetWidget.value += 1; targetWidget.value += 1;
@ -58,7 +59,7 @@ function seedWidget(node, inputName, inputData) {
const seedControl = addSeedControlWidget(node, seed.widget, "fixed seed"); const seedControl = addSeedControlWidget(node, seed.widget, "fixed seed");
seed.widget.linkedWidgets = [seedControl]; seed.widget.linkedWidgets = [seedControl];
return { widget: seed, seedControl}; return { widget: seed, seedControl };
} }
const MultilineSymbol = Symbol(); const MultilineSymbol = Symbol();