fix: connection copying

- don't copy if distance > 1000
- remove dbg message
- check nearest node not found
This commit is contained in:
dr.lt.data 2024-01-26 18:30:33 +09:00
parent 8b3d71fbcf
commit 2f0c7fb2be
2 changed files with 4 additions and 4 deletions

View File

@ -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})")

View File

@ -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);
}
},