Browse Source

fix: connection copying

- don't copy if distance > 1000
- remove dbg message
- check nearest node not found
pull/365/head
dr.lt.data 10 months ago
parent
commit
2f0c7fb2be
  1. 2
      __init__.py
  2. 6
      js/node_fixer.js

2
__init__.py

@ -29,7 +29,7 @@ except:
print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.")
version = [2, 4]
version = [2, 4, 1]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
print(f"### Loading: ComfyUI-Manager ({version_str})")

6
js/node_fixer.js

@ -27,7 +27,7 @@ function lookup_nearest_nodes(node) {
continue;
let dist = distance(node, other);
if (dist < nearest_distance) {
if (dist < nearest_distance && dist < 1000) {
nearest_distance = dist;
nearest_node = other;
}
@ -94,9 +94,9 @@ app.registerExtension({
if(node.inputs && node.outputs && node.inputs.length == 0 && node.outputs.length == 0)
return;
console.log(arguments);
let src_node = lookup_nearest_nodes(node);
node_info_copy(src_node, node);
if(src_node)
node_info_copy(src_node, node);
}
},

Loading…
Cancel
Save