diff --git a/README.md b/README.md index fafeae1..6dd3b69 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,8 @@ NODE_CLASS_MAPPINGS.update({ * `Possible Input Connections`: It connects all outputs that match the closest type within the specified range. * This connection links to the closest outputs among the nodes located on the left side of the target node. + + * `Possible(left) + Copy(right)`: When you Double-Click on the left half of the title, it operates as `Possible Input Connections`, and when you Double-Click on the right half, it operates as `Copy All Connections`. ## Troubleshooting * If your `git.exe` is installed in a specific location other than system git, please install ComfyUI-Manager and run ComfyUI. Then, specify the path including the file name in `git_exe = ` in the ComfyUI-Manager/config.ini file that is generated. diff --git a/__init__.py b/__init__.py index 75add7f..0fa384f 100644 --- a/__init__.py +++ b/__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, 6] +version = [2, 7] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") diff --git a/js/comfyui-manager.js b/js/comfyui-manager.js index 66f9375..00d5456 100644 --- a/js/comfyui-manager.js +++ b/js/comfyui-manager.js @@ -914,6 +914,7 @@ class ManagerMenuDialog extends ComfyDialog { dbl_click_policy_combo.appendChild($el('option', { value: 'copy-all', text: 'Double-Click: Copy All Connections' }, [])); dbl_click_policy_combo.appendChild($el('option', { value: 'copy-input', text: 'Double-Click: Copy Input Connections' }, [])); dbl_click_policy_combo.appendChild($el('option', { value: 'possible-input', text: 'Double-Click: Possible Input Connections' }, [])); + dbl_click_policy_combo.appendChild($el('option', { value: 'dual', text: 'Double-Click: Possible(left) + Copy(right)' }, [])); api.fetchApi('/manager/dbl_click/policy') .then(response => response.text()) diff --git a/js/node_fixer.js b/js/node_fixer.js index a696976..94b4c74 100644 --- a/js/node_fixer.js +++ b/js/node_fixer.js @@ -171,6 +171,25 @@ app.registerExtension({ connect_inputs(nearest_inputs, node); } break; + case "dual": + { + if(pos[0] < node.size[0]/2) { + // left: possible-input + let nearest_inputs = lookup_nearest_inputs(node); + if(nearest_inputs) + connect_inputs(nearest_inputs, node); + } + else { + // right: copy-all + if(node.inputs?.some(x => x.link != null) || node.outputs?.some(x => x.links != null && x.links.length > 0) ) + return; + + let src_node = lookup_nearest_nodes(node); + if(src_node) + node_info_copy(src_node, node, true); + } + } + break; } } },