Fixes for combo node default value

This commit is contained in:
space-nuko
2023-05-18 02:12:42 -05:00
parent 7224543934
commit a25a78305b
3 changed files with 8 additions and 6 deletions

View File

@@ -821,13 +821,15 @@ export default class ComfyApp {
.flatMap(i => node.getInputSlotsConnectedTo(i))
.find(inp => "config" in inp && Array.isArray((inp.config as any).values))
let defaultValue = null;
if (foundInput != null) {
const comfyInput = foundInput as IComfyInputSlot;
console.warn("[refreshComboInNodes] found frontend config:", node.title, node.type, comfyInput.config.values)
values = comfyInput.config.values;
defaultValue = comfyInput.config.defaultValue;
}
comboNode.formatValues(values);
comboNode.formatValues(values, defaultValue);
}
await tick();
@@ -842,7 +844,7 @@ export default class ComfyApp {
comboNode.formatValues(rawValues as string[], true)
if (!rawValues?.includes(get(comboNode.value))) {
comboNode.setValue(rawValues[0])
comboNode.setValue(rawValues[0], comfyInput.config.defaultValue)
}
}
}