From bb1503ed63eb49b43a4c1a5abd4df0872cac5d8a Mon Sep 17 00:00:00 2001 From: Silversith Date: Mon, 27 Mar 2023 07:16:22 +0200 Subject: [PATCH] Bugfix/include optional node inputs (#271) * Minor changes and extra nodes * Added Preview Image for Nodes * Add a delete images button on main floating menu * Add a confirmation dialog * Remove DeleteAll, Remove Custom KSampler, Remove Image List * Remove Image and Custom Json Load * Remove Custom Nodes * remove patch.diff --- nodes.py | 2 +- web/scripts/app.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index f24bc4a5..6fb7f017 100644 --- a/nodes.py +++ b/nodes.py @@ -1052,4 +1052,4 @@ def load_custom_nodes(): load_custom_nodes() -load_custom_node(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_extras"), "nodes_upscale_model.py")) +load_custom_node(os.path.join(os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy_extras"), "nodes_upscale_model.py")) \ No newline at end of file diff --git a/web/scripts/app.js b/web/scripts/app.js index a9d3485c..89eb7112 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -683,7 +683,10 @@ class ComfyApp { const nodeData = defs[nodeId]; const node = Object.assign( function ComfyNode() { - const inputs = nodeData["input"]["required"]; + var inputs = nodeData["input"]["required"]; + if (nodeData["input"]["optional"] != undefined){ + inputs = Object.assign({}, nodeData["input"]["required"], nodeData["input"]["optional"]) + } const config = { minWidth: 1, minHeight: 1 }; for (const inputName in inputs) { const inputData = inputs[inputName];