Fix Combo error

This commit is contained in:
NumZ
2025-05-18 15:29:29 +02:00
parent c36b5026f9
commit 194f8ecff3
3 changed files with 15 additions and 6 deletions
+6 -4
View File
@@ -140,17 +140,19 @@ export function addInputs(node, inputs, widgets_values) {
.sort(([, a], [, b]) => a.position - b.position)
.map(([, input], index) => {
let val = "";
if (input.inputs[1] == "COMBO") {
val = input.inputs[2][0];
let type = input.inputs[1];
if (input.inputs[2]?.values?.length > 0) {
type = "COMBO";
val = input.inputs[1];
} else {
val = input.inputs.length > 2 ? input.inputs[2] : undefined;
}
return {
name: input.inputs[0],
type: input.inputs[1],
type: type,
value: val,
orderIndex: index, // Ajouter un index d'ordre basé sur la position
options: input.inputs[1] == "COMBO" ? input.inputs[2][1] : undefined,
options: type == "COMBO" ? input.inputs[2] : undefined,
};
});
+1 -1
View File
@@ -52,7 +52,7 @@ function initialisation_preGraph(node) {
widget_input = other_node.widgets.find(
(w) => w.name == node_input.widget.name
);
if ("options" in widget_input) {
if (widget_input && "options" in widget_input) {
options = widget_input.options;
}
}
+8 -1
View File
@@ -107,7 +107,14 @@ function initialisation_preGraph(node) {
const inputs = app.lipsync_studio[value].inputs;
const outputs = app.lipsync_studio[value].outputs;
for (let [key, value] of Object.entries(inputs)) {
workflowJSON[key]["inputs"]["type"] = value["inputs"][1];
if (
value["inputs"][2]?.values &&
value["inputs"][2].values.length > 0
) {
workflowJSON[key]["inputs"]["type"] = "COMBO";
} else {
workflowJSON[key]["inputs"]["type"] = value["inputs"][1];
}
}
for (let [key, value] of Object.entries(outputs)) {
if (value["inputs"].length === undefined) {