Browse Source

feat: add `Possible(left) + Copy(right)` for double-click feature

pull/379/head
dr.lt.data 10 months ago
parent
commit
e54c4b1f7b
  1. 2
      README.md
  2. 2
      __init__.py
  3. 1
      js/comfyui-manager.js
  4. 19
      js/node_fixer.js

2
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. * `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. * 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 ## 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. * 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.

2
__init__.py

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

1
js/comfyui-manager.js vendored

@ -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-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: '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: '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') api.fetchApi('/manager/dbl_click/policy')
.then(response => response.text()) .then(response => response.text())

19
js/node_fixer.js

@ -171,6 +171,25 @@ app.registerExtension({
connect_inputs(nearest_inputs, node); connect_inputs(nearest_inputs, node);
} }
break; 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;
} }
} }
}, },

Loading…
Cancel
Save