Fix Input node issue
This commit is contained in:
+1
-1
@@ -99,7 +99,7 @@ export function addOutputs(root_obj, workflow_name){
|
||||
}
|
||||
|
||||
|
||||
export function addInputs(node, inputs, widgets_values, initial = false) {
|
||||
export function addInputs(node, inputs) {
|
||||
// Phase 1: Préparer les données triées et simplifiées
|
||||
const mapped_input = Object.entries(inputs)
|
||||
.sort(([, a], [, b]) => a.position - b.position)
|
||||
|
||||
+4
-4
@@ -14,16 +14,16 @@ app.registerExtension({
|
||||
}
|
||||
switch (nodeData.name) {
|
||||
case "Workflow":
|
||||
setupWorkflowNode(nodeType, nodeData, app);
|
||||
setupWorkflowNode(nodeType);
|
||||
break;
|
||||
case "WorkflowInput":
|
||||
setupInputNode(nodeType, nodeData, app);
|
||||
setupInputNode(nodeType);
|
||||
break;
|
||||
case "WorkflowContinue":
|
||||
setupContinueNode(nodeType, nodeData, app);
|
||||
setupContinueNode(nodeType);
|
||||
break;
|
||||
case "WorkflowOutput":
|
||||
setupOutputNode(nodeType, nodeData, app);
|
||||
setupOutputNode(nodeType);
|
||||
break;
|
||||
case "WorkflowLipSync":
|
||||
setupLipSyncNode(nodeType, nodeData, app);
|
||||
|
||||
@@ -68,7 +68,13 @@ function serialize(info) {
|
||||
}
|
||||
|
||||
for (let w of this.widgets) {
|
||||
info.widgets_values[w.name] = {name: w.name, options : w.options, value: w.value, type: w.type, origType: w.origType, last_y: w.last_y};
|
||||
info.widgets_values[w.name] = {
|
||||
name: w.name,
|
||||
options : w.options,
|
||||
value: w.value,
|
||||
type: w.type,
|
||||
origType: w.origType,
|
||||
last_y: w.last_y};
|
||||
}
|
||||
for (let w of this.inputs){
|
||||
// if w.name exists in info.widgets_values
|
||||
@@ -89,16 +95,23 @@ function serialize(info) {
|
||||
}
|
||||
if (this.outputs.length > 0){
|
||||
if (this.outputs[0].links == null){
|
||||
info.outputs_values = {links: null, name: this.outputs[0].name, type: this.outputs[0].type};
|
||||
info.outputs_values = {
|
||||
links: null,
|
||||
name: this.outputs[0].name,
|
||||
type: this.outputs[0].type};
|
||||
}else{
|
||||
info.outputs_values = {links: [...this.outputs[0].links], name: this.outputs[0].name, slot_index: this.outputs[0].slot_index, type: this.outputs[0].type};
|
||||
info.outputs_values = {
|
||||
links: [...this.outputs[0].links],
|
||||
name: this.outputs[0].name,
|
||||
slot_index: this.outputs[0].slot_index,
|
||||
type: this.outputs[0].type};
|
||||
}
|
||||
}
|
||||
this.setSize(info.size);
|
||||
}
|
||||
|
||||
|
||||
export function setupContinueNode(nodeType, nodeData, app) {
|
||||
export function setupContinueNode(nodeType) {
|
||||
nodeType.prototype.onNodeCreated = function() {
|
||||
chainCallback(this, "onConfigure", configure);
|
||||
chainCallback(this, "onSerialize", serialize);
|
||||
|
||||
@@ -23,8 +23,8 @@ function initialisation(node) {
|
||||
ComfyWidgets.INT(
|
||||
node,
|
||||
"default",
|
||||
//['',{default: 0, "min": 0, "max": 18446744073709551616, "step": 1},],
|
||||
['',{default: 0},],
|
||||
['INT',{default: 0, "min": 0, "max": 18446744073709551616, "step": 1},],
|
||||
//['INT',{default: 0},],
|
||||
app,
|
||||
)
|
||||
break;
|
||||
@@ -33,7 +33,7 @@ function initialisation(node) {
|
||||
ComfyWidgets.FLOAT(
|
||||
node,
|
||||
"default",
|
||||
['',{default: 0, "min": 0.00, "max": 2048.00, "step": 0.01},],
|
||||
['FLOAT',{default: 0, "min": 0.00, "max": 2048.00, "step": 0.01},],
|
||||
app,
|
||||
)
|
||||
break;
|
||||
@@ -60,7 +60,7 @@ function initialisation(node) {
|
||||
function configure(info) {
|
||||
const inputs = {};
|
||||
inputs["default"] = {inputs: ["default", info.widgets_values[1], info.widgets_values[2]]};
|
||||
addInputs(this, inputs, info.widgets_values);
|
||||
addInputs(this, inputs);
|
||||
}
|
||||
|
||||
function serialize(info) {
|
||||
@@ -76,7 +76,7 @@ function serialize(info) {
|
||||
}
|
||||
}
|
||||
|
||||
export function setupInputNode(nodeType, nodeData, app) {
|
||||
export function setupInputNode(nodeType) {
|
||||
nodeType.prototype.onNodeCreated = function() {
|
||||
chainCallback(this, "onConfigure", configure);
|
||||
chainCallback(this, "onSerialize", serialize);
|
||||
|
||||
@@ -124,7 +124,7 @@ function serialize(info) {
|
||||
this.setSize(info.size);
|
||||
}
|
||||
|
||||
export function setupOutputNode(nodeType, nodeData, app) {
|
||||
export function setupOutputNode(nodeType) {
|
||||
|
||||
nodeType.prototype.onNodeCreated = function() {
|
||||
chainCallback(this, "onConfigure", configure);
|
||||
|
||||
@@ -14,7 +14,7 @@ function initialisation(node) {
|
||||
}else{
|
||||
node.widgets[1].value = importWorkflow(node, value, app);
|
||||
const inputs = app.lipsync_studio[value].inputs;
|
||||
addInputs(node, inputs, {}, true);
|
||||
addInputs(node, inputs);
|
||||
addOutputs(node, value);
|
||||
fitHeight(node);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ function configure(info) {
|
||||
if (info.widgets_values[0] != "None"){
|
||||
const inputs = app.lipsync_studio[info.widgets_values[0]].inputs;
|
||||
|
||||
addInputs(this, inputs, info.widgets_values);
|
||||
addInputs(this, inputs);
|
||||
addOutputs(this, info.widgets_values[0]);
|
||||
removeInputs(this, inputs, info.widgets_values);
|
||||
fitHeight(this);
|
||||
@@ -43,7 +43,7 @@ function configure(info) {
|
||||
this.widgets[1].value = data;
|
||||
const inputs = app.lipsync_studio[info.widgets_values[0]].inputs;
|
||||
|
||||
addInputs(this, inputs, info.widgets_values);
|
||||
addInputs(this, inputs);
|
||||
addOutputs(this, info.widgets_values[0]);
|
||||
removeInputs(this, inputs, info.widgets_values);
|
||||
fitHeight(this);
|
||||
@@ -67,7 +67,7 @@ function serialize(info) {
|
||||
}
|
||||
}
|
||||
|
||||
export function setupWorkflowNode(nodeType, nodeData, app) {
|
||||
export function setupWorkflowNode(nodeType) {
|
||||
nodeType.prototype.onNodeCreated = function() {
|
||||
chainCallback(this, "onConfigure", configure);
|
||||
chainCallback(this, "onSerialize", serialize);
|
||||
|
||||
Reference in New Issue
Block a user